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); }
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)); }
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)); }