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); }
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); }
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); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <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++; }
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); }
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); }