Example #1
0
        public void endTurnTrigger(BotMovement bot)
        {
            TurnManager turnManager = FindObjectOfType <TurnManager>();
            Deck        deck        = bot.GetComponent <Deck>();

            deck.DiscardCard(spamCard);
            turnManager.AddPlayerToQueue(bot);
        }
Example #2
0
 void OnActivateObstacles()
 {
     if (gridPositionHandler.CurrentWaypoint.GetComponent <IObstacle>() != null)
     {
         gridPositionHandler.CurrentWaypoint.GetComponent <IObstacle>().endTurnTrigger(this);
     }
     else
     {
         turnManager.AddPlayerToQueue(this);
     }
 }
Example #3
0
 void Update()
 {
     if (currentRound == turnManager.CurrentRound)
     {
         if (turnManager.GetPlayersInQueue().Count == players.Length)
         {
             bot.ProcessNextRound();
             turnManager.AddPlayerToQueue(bot);
             currentRound++;
             DrawAndPlayAllCards();
         }
     }
 }
Example #4
0
 private void HandleCardCommandsInRegister()
 {
     foreach (Card card in cards)
     {
         bot.AddCardToProcessor(card.GetCardConfig);
         if (!card.GetCardConfig.DestroyCardAfterPlaying)
         {
             deck.DiscardCard(card.GetCardConfig);
         }
         Destroy(card.gameObject);
     }
     turnManager.AddPlayerToQueue(bot);
 }
Example #5
0
        public void endTurnTrigger(BotMovement bot)
        {
            BoardProcessor board          = FindObjectOfType <BoardProcessor>();
            TurnManager    turnManager    = FindObjectOfType <TurnManager>();
            Vector3        botPosition    = bot.transform.position;
            Waypoint       moveToWaypoint = board.GetNearestWaypoint(new Vector2Int(
                                                                         Mathf.RoundToInt(botPosition.x + transform.forward.x * moveSpaces),
                                                                         Mathf.RoundToInt(botPosition.z + transform.forward.z * moveSpaces)
                                                                         ));

            if (moveToWaypoint != null)
            {
                bot.AddCommandToQueue(new Command("MOVE", moveToWaypoint));
            }
            turnManager.AddPlayerToQueue(bot);
        }