Пример #1
0
 public RightwardDirection(DirectionState state)
 {
     this.ValidNewDirections =
         new List <Direction> {
         Direction.Up, Direction.Down
     };
     this.Snake = state.Snake;
 }
Пример #2
0
 public DownwardDirection(DirectionState state)
 {
     this.ValidNewDirections =
         new List <Direction> {
         Direction.Right, Direction.Left
     };
     this.Snake = state.Snake;
 }
Пример #3
0
 private DirectionState GetNewOrientationState(Direction newDirection, DirectionState caller)
 {
     return((DirectionState)Activator.CreateInstance(this.directionToTypeMapper[newDirection], caller));
 }