Пример #1
0
 private TapPlayerController(
     TapGesture tapGesture,
     PlayerTurnSignal playerTurnSignal,
     IPositionScreenPointMapper positionScreenPointMapper,
     WaitForPlayerTurnSignal waitForPlayerTurnSignal,
     Field field,
     MoveTurnAction.PositionFactory moveTurnActionFactory)
 {
     this.tapGesture                = tapGesture;
     this.playerTurnSignal          = playerTurnSignal;
     this.positionScreenPointMapper = positionScreenPointMapper;
     this.waitForPlayerTurnSignal   = waitForPlayerTurnSignal;
     this.field = field;
     this.moveTurnActionFactory = moveTurnActionFactory;
 }
Пример #2
0
 private FieldController(
     Field field,
     FieldView fieldView,
     IPositionScreenPointMapper positionVerctor2Mapper,
     CharacterView.Factory characterViewFactory,
     ObstacleView.Factory obstacleViewFactory,
     ExitView.Factory exitViewFactory,
     RearrangeViewsSignal rearrangeViewsSignal)
 {
     this.field = field;
     this.positionVerctor2Mapper = positionVerctor2Mapper;
     this.characterViewFactory   = characterViewFactory;
     this.obstacleViewFactory    = obstacleViewFactory;
     this.exitViewFactory        = exitViewFactory;
     this.positionHolderViewMap  = new Dictionary <PositionHolder, PositionHolderView> ();
     this.rearrangeViewsSignal   = rearrangeViewsSignal;
 }
Пример #3
0
        private MoveTurnAction(
            Character character,
            [InjectOptional] Direction direction,
            [InjectOptional] Position targetPosition,
            ICharacterViewResolver characterViewResolver,
            IPositionScreenPointMapper positionVerctor2Mapper,
            RearrangeViewsSignal rearrangeViewsSignal)
        {
            this.character              = character;
            this.characterView          = characterViewResolver.Resolve(character);
            this.positionVerctor2Mapper = positionVerctor2Mapper;
            this.rearrangeViewsSignal   = rearrangeViewsSignal;

            if (targetPosition != null)
            {
                this.targetPosition = targetPosition;
                this.direction      = character.Position.GetDirectionTo(targetPosition);
            }
            else
            {
                this.direction      = direction;
                this.targetPosition = character.Position.Offset(direction);
            }
        }