예제 #1
0
        public void BetweenD4A1_B2C3()
        {
            // arrange
            var p = new AttackPath("D4", "A1");
            var expected = Bitboard.With.B2.C3.Build();

            // act

            // assert
            p.AsBoard.Should().Be(expected);
            p.IsValid.Should().Be(true);
        }
예제 #2
0
        public void BetweenA1F1_B1C1D1E1()
        {
            // arrange
            var p = new AttackPath("A1", "F1");
            var expected = Bitboard.With.B1.C1.D1.E1.Build();

            // act

            // assert
            p.AsBoard.Should().Be(expected);
            p.IsValid.Should().Be(true);
        }
예제 #3
0
        public void BetweenA1A4_A2A3()
        {
            // arrange
            var p = new AttackPath("A1", "A4");
            var expected = Bitboard.With.A2.A3.Build();

            // act

            // assert
            p.AsBoard.Should().Be(expected);
            p.IsValid.Should().Be(true);
        }
예제 #4
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    //
    /// </summary>
    /// <param name="subwaveEnemies"></param>
    private void SpawnSubwave(List <WorldObject> subwaveEnemies)
    {
        // Notify HUD
        ///_CurrentLockdownPad.LockdownPadHud.Flash();

        // Spawn units
        List <Vector3> spawnPositions = _CurrentLockdownPad.GetSpawnLocations(subwaveEnemies.Count);

        for (int i = 0; i < subwaveEnemies.Count; i++)
        {
            GameObject obj    = ObjectPooling.Spawn(subwaveEnemies[i].gameObject, spawnPositions[i]);
            Player     player = GameManager.Instance.Players[0];

            // Initialize the object as a unit
            Unit unit = obj.GetComponent <Unit>();
            if (unit != null)
            {
                unit.Team = GameManager.Team.Attacking;
                unit.OnSpawn();
                unit.CreateHealthBar(unit, player.CameraAttached);

                if (unit is AirVehicle)
                {
                    unit.AgentAttackObject(CentralCore.GetAttackObject());
                }
                else
                {
                    AttackPath path = _CurrentLockdownPad.GetRandomAttackPath();
                    unit.SetAttackPath(path);
                    unit.AgentSeekPosition(unit.GetAttackPath().GetFirstNodeWithOffset(), false, false);
                    unit.SetPathInterupted(false);
                }

                // Set lockdown base reference for the unit
                unit.SetLockdownBase(_CurrentLockdownPad.BuildingSlotAttached.AttachedBase);
                _CurrentLockdownPad.BuildingSlotAttached.AttachedBase.GetEnemyUnitList().Add(unit);
                _CurrentWaveEnemies.Add(unit);
            }
        }
        _CurrentSubwave++;
    }
예제 #5
0
        public void BetweenD5A1_Empty()
        {
            // arrange
            var p = new AttackPath("D5", "A1");
            var expected = Bitboard.Empty;

            // act

            // assert
            p.AsBoard.Should().Be(expected);
            p.IsValid.Should().Be(false);
        }
예제 #6
0
        public void BetweenH1E4_G2F3()
        {
            // arrange
            var p = new AttackPath("H1", "E4");
            var expected = Bitboard.With.G2.F3.Build();

            // act

            // assert
            p.AsBoard.Should().Be(expected);
            p.IsValid.Should().Be(true);
        }