public FriendSquadron(List<Collidable> collidableList, CollidableType type, float boundingRadius, BasicModel friendModel, List<Friend> friendList, WeaponSystem2D weaponSystem, Vector3 basePosition, int defaultLife, int amtShips, int shipsArsenal) { CollidableReference = collidableList; FriendList = friendList; CollidableReference.AddRange(FriendList); _basePosition = basePosition; _friendModel = friendModel; _weaponSystem = weaponSystem; _type = type; _boundingRadius = boundingRadius; _randomVar = new Random(); //Copies the first friend into a template, so a friend could be easily generated. _friendTemplate = new Friend(friendList[0].CollidableType, friendList[0].BoundingSphereRadius, friendList[0].ShipPosition, friendList[0].ShipRotation, friendList[0].MinShipSpeed, friendList[0].MaxShipSpeed, friendList[0].Acceleration, friendList[0].TurningSpeed, friendList[0].DistanceThresholdFriend, friendList[0].DistanceThresholdEnemy, friendList[0].Life); _defaultLife = defaultLife; _amountShips = amtShips; _soundDump = new List<Sound>(); ShipsArsenal = shipsArsenal; }
public void GenerateEnemyAtBase() { Friend friend1 = new Friend(_friendTemplate.CollidableType, _friendTemplate.BoundingSphereRadius, _friendTemplate.ShipPosition, _friendTemplate.ShipRotation, _friendTemplate.MinShipSpeed, _friendTemplate.MaxShipSpeed, _friendTemplate.Acceleration, _friendTemplate.TurningSpeed, _randomVar.Next(3, (int)_friendTemplate.DistanceThresholdFriend + 8), _friendTemplate.DistanceThresholdEnemy, _friendTemplate.Life); friend1.Life = _defaultLife; friend1.ShipPosition = new Vector3(_basePosition.X + _randomVar.Next(300), _basePosition.Y + _randomVar.Next(300), _basePosition.Z + _randomVar.Next(300)); CollidableReference.Add(friend1); FriendList.Add(friend1); }