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