Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline fool  
#1 Posted : Thursday, May 3, 2012 2:10:28 PM(UTC)
fool

Joined: 8/24/2011(UTC)
Posts: 34
Location: New Zealand

Thanks: 4 times
I really like this Command stuff, but could I suggest an improvement? It would be easier to use a fluent style when configuring with code, so if Add and AddTrigger were tweaked to return the Command (i.e. 'this') that would be nice. ;)

To clarify, this would mean the code could be written like the following:

Code:

Input.Commands["Test"]
    .AddTrigger(new CommandTrigger { /* trigger1 */ })
    .AddTrigger(new CommandTrigger { /* trigger2 */ })
    .AddTrigger(new CommandTrigger { /* trigger3 */ })
    .Add(this, trigger => /* command callback */);

Edited by user Sunday, May 6, 2012 4:54:47 AM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Monday, May 7, 2012 2:34:27 AM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Done (see v0.9.5.18). Good suggestion!
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.032 seconds.