Skip to content

Instantly share code, notes, and snippets.

@smoothdeveloper
Created September 1, 2010 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smoothdeveloper/560739 to your computer and use it in GitHub Desktop.
Save smoothdeveloper/560739 to your computer and use it in GitHub Desktop.
// thing that hold state
public interface ISwitchableBehaviourState<TThingToAlter>
{
void RegisterThingToAlterWithReversibleAction(TThingToAlter thingToAlter, Func<TThingToAlter, Action<TThingToAlter>> reversibleAction);
}
// thing that will be manipulated
public interface ISwitchableBehaviourActuator
{
void EnlistReversibleActionAsCompoundBehaviour<TThingToAlter>(TThingToAlter thingToAlter,
Func<TThingToAlter, Action<TThingToAlter>>
reversibleAction);
void ActivateIfNotAlreadyActivated();
void DesactivateIfActivated();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment