public void endTurnTrigger(BotMovement bot) { TurnManager turnManager = FindObjectOfType <TurnManager>(); Deck deck = bot.GetComponent <Deck>(); deck.DiscardCard(spamCard); turnManager.AddPlayerToQueue(bot); }
void OnActivateObstacles() { if (gridPositionHandler.CurrentWaypoint.GetComponent <IObstacle>() != null) { gridPositionHandler.CurrentWaypoint.GetComponent <IObstacle>().endTurnTrigger(this); } else { turnManager.AddPlayerToQueue(this); } }
void Update() { if (currentRound == turnManager.CurrentRound) { if (turnManager.GetPlayersInQueue().Count == players.Length) { bot.ProcessNextRound(); turnManager.AddPlayerToQueue(bot); currentRound++; DrawAndPlayAllCards(); } } }
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); }
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); }