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