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); }
public T Accept <T>(IBoardComponentVisitor <T> visitor) { return(visitor.Visit(this)); }
public void Accept(IBoardComponentVisitor visitor) { visitor.Visit(this); }
private IBoardComponentVisitor <string> m_componentImplementor; // The implemenation of a single component on the board public ConsoleDisplayer(IBoardComponentVisitor <string> implementor) { m_componentImplementor = implementor; }
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; }
public abstract T Accept <T>(IBoardComponentVisitor <T> visitor);
public abstract void Accept(IBoardComponentVisitor visitor);