public WeaponStationType CreateWeaponStationType(WeaponStationType.PointType type, string[] Weapons, WeaponFactoryType factoryType) { var weaponFactory = new ForcesWeaponsFactory(); var airweapons = new List <AircraftWeapon>(); var groundweapons = new List <GroundVehicleWeapon>(); var seaweapons = new List <SeaObjectWeapon>(); var we = new WeaponStationType() { WeaponsStationType = type }; if (Weapons.Length > 0) { for (int i = 0; i < Weapons.Length; i++) { switch (factoryType) { case WeaponFactoryType.Ground: we.ConfigWeapons.Add(weaponFactory.GetGroundWeaponBy(Weapons[i])); break; case WeaponFactoryType.Air: break; case WeaponFactoryType.Sea: we.ConfigWeapons.Add(weaponFactory.GetSeaWeaponBy(Weapons[i])); break; } } } return(we); }
public SeaObjectWeaponConfig CreateSeaConfigure(string name, float payload, WeaponStationType.PointType type, string[] Weapons) { var WeaponsStations = CreateWeaponStationType(type, Weapons, WeaponFactoryType.Sea); return(new SeaObjectWeaponConfig() { Name = name, MaxWeaponsPayload = payload, WeaponsStations = new List <WeaponStationType> { WeaponsStations } }); }