Exemplo n.º 1
0
        private void WaitForEnemyTurnSignal(Character enemy)
        {
            Character   player     = field.Player;
            ITurnAction turnAction =
                attackPossibility.IsPossible(enemy, player)
                                        ? attackTurnActionFactory.Create(enemy, player) as ITurnAction
                                        : moveTurnActionFactory.Create(
                    enemy, enemyMovePositionPicker.PickPosition(enemy));

            enemyTurnSignal.Fire(turnAction);
        }
Exemplo n.º 2
0
        private void FireSignalfNeeded(Direction direction)
        {
            Position position = player.Position.Offset(direction);

            if (!field.IsPositionValid(position))
            {
                return;
            }

            verticalFlickGesture.Flicked   -= VerticalFlickGestureFlicked;
            horizontalFlickGesture.Flicked -= HorizontalFlickGestureFlicked;
            playerTurnSignal.Fire(
                moveTurnActionFactory.Create(player, position));
        }
Exemplo n.º 3
0
        private void TapGestureTapped(object sender, System.EventArgs e)
        {
            Position position = positionScreenPointMapper.ScreenPointToPosition(
                tapGesture.ScreenPosition);

            Character player = field.Player;

            if (!field.IsPositionValid(position) || !player.Position.IsNeightbourWith(position))
            {
                return;
            }

            tapGesture.Tapped -= TapGestureTapped;
            playerTurnSignal.Fire(
                moveTurnActionFactory.Create(player, position));
        }