コード例 #1
0
    protected override void Execute(List <InputEntity> entities)
    {
        // input from Player allowed only in a specific game state
        Debug.Log("Execute Input System");
        foreach (var entity in entities)
        {
            if (!_contexts.gameState.gameStateEntity.isWaitingPlayerState)
            {
                entity.isClick = false;
                continue;
            }
            if (entity.isAttackInput)
            {
                AttackTargetService.PrepareAttackTarget(_enemies, _characters);
                _contexts.gameState.gameStateEntity.isWaitingPlayerState = false;
                _contexts.gameState.gameStateEntity.isPlayersTurnState   = true;
            }

            if (entity.isSwitchInput)
            {
                Debug.Log("Launch Switch Target");
                SwitchTargetService.SwitchTarget(_enemies);
            }

            entity.isClick = false;
        }
    }
コード例 #2
0
 protected override void Execute(List <GameStateEntity> entities)
 {
     Debug.Log("Enemy attack started");
     foreach (var gameStateEntity in entities)
     {
         if (gameStateEntity.isAITurnState)
         {
             // initiate enemy attack
             AttackTargetService.PrepareAttackTarget(_characters, _enemies);
             gameStateEntity.isAITurnState = false;
         }
     }
 }