public bool CanBeApplied(InteractionState state) { return(state.InteractionObject is Box && state.InteractingObject is Hero && ( state.NextToInteractionObject is Space || state.NextToInteractionObject is Pit )); }
public InteractionState GetResolvedState(InteractionState state) { return(new InteractionState { InteractingObject = state.InteractingObject.Bottom, InteractionObject = state.InteractingObject.WithBottom(state.InteractionObject), NextToInteractionObject = state.NextToInteractionObject }); }
public InteractionState GetResolvedState(InteractionState state) { (state.InteractingObject as Hero).State.CoinCount++; return(new InteractionState { InteractingObject = state.InteractingObject.Bottom, InteractionObject = state.InteractingObject, NextToInteractionObject = state.NextToInteractionObject }); }
public InteractionState GetResolvedState(InteractionState state) { var decreasedCounterWall = new CounterWall((state.InteractionObject as CounterWall).Count - 1); var bottom = decreasedCounterWall.Count > 0 ? decreasedCounterWall as GameObject : new Wall() as GameObject; return(new InteractionState { InteractingObject = state.InteractingObject.Bottom, InteractionObject = state.InteractingObject.WithBottom(bottom), NextToInteractionObject = state.NextToInteractionObject }); }
public bool CanBeApplied(InteractionState state) { return(state.InteractionObject is CounterWall && state.InteractingObject is Hero); }
public bool CanBeApplied(InteractionState state) { return((state.InteractionObject is Space || state.InteractionObject is Pit) && state.InteractingObject is Hero); }
public bool CanBeApplied(InteractionState state) { return(state.InteractionObject is BreakableWall && (state.InteractingObject as Hero)?.State?.CoinCount - 1 >= 0); }