예제 #1
0
        public MatrixPlayer(int playerNumber, int boardSize, Config playerConfig) : base(playerNumber, boardSize, playerConfig)
        {
            Size         = boardSize;
            PlayerNumber = playerNumber;
            Me           = PlayerNumber == 1 ? Players.PlayerType.Blue : Players.PlayerType.Red;
            MaxLevels    = GetDefault(playerConfig, "maxLevels", 20);
            Name         = playerConfig.name;
            Board        = new MatrixHex[Size, Size];
            for (int row = 0; row < Size; row++)
            {
                for (int col = 0; col < Size; col++)
                {
                    Board[row, col] = new MatrixHex(Size);
                }
            }

            MyMoves = Matrix <int> .Build.Dense(Size, Size);

            MyMoves.Clear();
            EnemyMoves = Matrix <int> .Build.Dense(Size, Size);

            EnemyMoves.Clear();

            //Startup();
        }
예제 #2
0
        private IEnumerator PlayEnemyMoves()
        {
            foreach (KeyValuePair <Rigidbody2D, Vector2> pair in EnemyMoves)
            {
                const float MoveDuration = 0.1f;
                pair.Key.DOMove(pair.Value, MoveDuration);
            }

            yield return(null);

            EnemyMoves.Clear();
            CurrentPhase.Value = Phase.PlayerMove;
        }