Example #1
0
    public void TakeTurn()
    {
        ++turnCount;

        if (sim.currentTurn == Turn.Type.Player)
        {
            var playerProcessor = new PlayerProcessor(sim);
            playerProcessor.TakeTurn();
        }
        else if (sim.currentTurn == Turn.Type.Game)
        {
            var gameProcessor = new GameProcessor(sim);
            gameProcessor.TakeTurn();
        }

        bool atTurnLimit = (turnCount >= maxTurnCount);

        if (sim.requiresInput || atTurnLimit)
        {
            NotificationCenter.PostNotification(Constants.OnRenderEvents);
            return;
        }
        else
        {
            TakeTurn();
        }
    }
Example #2
0
    public void TakeTurn()
    {
        ++turnCount;

        if (sim.currentTurn == Turn.Type.Player) {
          var playerProcessor = new PlayerProcessor(sim);
          playerProcessor.TakeTurn();
        } else if (sim.currentTurn == Turn.Type.Game) {
          var gameProcessor = new GameProcessor(sim);
          gameProcessor.TakeTurn();
        }

        bool atTurnLimit = (turnCount >= maxTurnCount);

        if (sim.requiresInput || atTurnLimit) {
          NotificationCenter.PostNotification(Constants.OnRenderEvents);
          return;
        } else {
          TakeTurn();
        }
    }