Пример #1
0
 private IMovementCommandService m_movementService;      // The movment service
 public WorkerStateMachine()
 {
     m_movementService = DependencyContainer.Instance.Resolve <IMovementCommandService>();
     m_currentState    = new State();
     movementDic       = new Dictionary <DirectionEnum, int[]>()
     {
         { DirectionEnum.UP, new int[] { -1, 0 } },
         { DirectionEnum.DOWN, new int[] { 1, 0 } },
         { DirectionEnum.RIGHT, new int[] { 0, 1 } },
         { DirectionEnum.LEFT, new int[] { 0, -1 } }
     };
     movementVisitor = new MovementVisitor(m_currentState, m_movementService);
 }
Пример #2
0
 private IMovementCommandService m_movementService; // Service used to make movement on the board
 public MovementVisitor(State a_state, IMovementCommandService moveService)
 {
     m_currentState      = a_state;      // Storing the state
     NumberOfBoxesPushed = 0;            // Set the defualt number of packages pushed
     m_movementService   = moveService;  // Storing the move service
 }