Example #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);
 }
Example #2
0
 public T Accept <T>(IBoardComponentVisitor <T> visitor)
 {
     return(visitor.Visit(this));
 }
Example #3
0
 public void Accept(IBoardComponentVisitor visitor)
 {
     visitor.Visit(this);
 }
Example #4
0
        private IBoardComponentVisitor <string> m_componentImplementor;        // The implemenation of a single component on the board

        public ConsoleDisplayer(IBoardComponentVisitor <string> implementor)
        {
            m_componentImplementor = implementor;
        }
Example #5
0
        public IMovementImplementer <char> m_movmentImplementor;     // What Input will translate to which action

        public ConsoleOutputInputFactory(IBoardComponentVisitor <string> a_displayImplementor,
                                         IMovementImplementer <char> a_movmentImplementor)
        {
            m_displayImplementor = a_displayImplementor;
            m_movmentImplementor = a_movmentImplementor;
        }
Example #6
0
 public abstract T Accept <T>(IBoardComponentVisitor <T> visitor);
Example #7
0
 public abstract void Accept(IBoardComponentVisitor visitor);