Example #1
0
 public bool CanBeApplied(InteractionState state)
 {
     return(state.InteractionObject is Box &&
            state.InteractingObject is Hero &&
            (
                state.NextToInteractionObject is Space ||
                state.NextToInteractionObject is Pit
            ));
 }
Example #2
0
 public InteractionState GetResolvedState(InteractionState state)
 {
     return(new InteractionState
     {
         InteractingObject = state.InteractingObject.Bottom,
         InteractionObject = state.InteractingObject.WithBottom(state.InteractionObject),
         NextToInteractionObject = state.NextToInteractionObject
     });
 }
Example #3
0
 public InteractionState GetResolvedState(InteractionState state)
 {
     (state.InteractingObject as Hero).State.CoinCount++;
     return(new InteractionState
     {
         InteractingObject = state.InteractingObject.Bottom,
         InteractionObject = state.InteractingObject,
         NextToInteractionObject = state.NextToInteractionObject
     });
 }
Example #4
0
        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
            });
        }
Example #5
0
 public bool CanBeApplied(InteractionState state)
 {
     return(state.InteractionObject is CounterWall &&
            state.InteractingObject is Hero);
 }
Example #6
0
 public bool CanBeApplied(InteractionState state)
 {
     return((state.InteractionObject is Space ||
             state.InteractionObject is Pit) &&
            state.InteractingObject is Hero);
 }
Example #7
0
 public bool CanBeApplied(InteractionState state)
 {
     return(state.InteractionObject is BreakableWall &&
            (state.InteractingObject as Hero)?.State?.CoinCount - 1 >= 0);
 }