Exemple #1
0
        public Killer(string edName, string edModel, CombatRating rating)
        {
            this.name         = edName;
            this.combatRating = rating;

            // Might be a ship
            killerShip = ShipDefinitions.FromEDModel(edModel, false);

            // Might be a SRV or Fighter
            killerVehicle = VehicleDefinition.EDNameExists(edModel) ? VehicleDefinition.FromEDName(edModel) : null;

            // Might be an on foot commander
            killerCmdrSuit = Suit.EDNameExists(edModel) ? Suit.FromEDName(edModel) : null;

            // Might be an on foot NPC
            killerNpcSuitLoadout = NpcSuitLoadout.EDNameExists(edModel) ? NpcSuitLoadout.FromEDName(edModel) : null;
        }
Exemple #2
0
        public static Vehicle FromJson(int subslot, dynamic json)
        {
            if (json is null)
            {
                return(null);
            }

            string edName      = (string)json["name"];
            string loadoutName = (string)json["loadoutName"];

            Vehicle vehicle = new Vehicle()
            {
                loadout            = (string)json["loadout"],
                rebuilds           = (int)json["rebuilds"],
                subslot            = subslot,
                definition         = VehicleDefinition.FromEDName(edName),
                loadoutDescription = LoadoutDescription.FromLoadoutName(loadoutName)
            };

            return(vehicle);
        }