Esempio n. 1
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);
        }
Esempio n. 2
0
 public override void Use(BotMovement bot)
 {
     bot.AddCommandToQueue(new Command("ROTATE", null, (config as RotateConfig).NumRotations));
     Destroy(bot.GetComponent <RotateBehavior>());
 }
Esempio n. 3
0
 private void MoveBot(BotMovement bot, Waypoint nextWaypoint)
 {
     bot.AddCommandToQueue(new Command("MOVE", nextWaypoint));
 }