Exemplo n.º 1
0
 private ShipData(ShipSerializable serializable, Database database)
 {
     ItemId             = new ItemId <ShipData>(serializable.Id, serializable.FileName);
     ShipCategory       = serializable.ShipCategory;
     Name               = serializable.Name;
     Faction            = database.GetFactionId(serializable.Faction);
     SizeClass          = serializable.SizeClass;
     IconImage          = new SpriteId(serializable.IconImage);
     IconScale          = new NumericValue <float>(serializable.IconScale, 0.1f, 100f);
     ModelImage         = new SpriteId(serializable.ModelImage);
     ModelScale         = new NumericValue <float>(serializable.ModelScale, 0.1f, 100f);
     EnginePosition     = serializable.EnginePosition;
     EngineColor        = Utils.ColorUtils.ColorFromString(serializable.EngineColor);
     EngineSize         = new NumericValue <float>(serializable.EngineSize, 0f, 1f);
     EnergyResistance   = new NumericValue <float>(serializable.EnergyResistance, 0f, 100f);
     KineticResistance  = new NumericValue <float>(serializable.KineticResistance, 0f, 100f);
     HeatResistance     = new NumericValue <float>(serializable.HeatResistance, 0f, 100f);
     Regeneration       = serializable.Regeneration;
     BaseWeightModifier = new NumericValue <float>(serializable.BaseWeightModifier, -0.9f, 100f);
     BuiltinDevices     = serializable.BuiltinDevices?.Select(item => new Wrapper <DeviceData> {
         Item = database.GetDeviceId(item)
     }).ToArray();
     Layout  = new Layout(serializable.Layout);
     Barrels = serializable.Barrels?.Select(item => BarrelData.Deserialize(item, database)).ToArray();
 }
Exemplo n.º 2
0
 private SatelliteData(SatelliteSerializable serializable, Database database)
 {
     ItemId     = new ItemId <SatelliteData>(serializable.Id, serializable.FileName);
     Name       = serializable.Name;
     ModelImage = new SpriteId(serializable.ModelImage);
     ModelScale = new NumericValue <float>(serializable.ModelScale, 0.1f, 100f);
     SizeClass  = serializable.SizeClass;
     Layout     = new Layout(serializable.Layout);
     Barrels    = serializable.Barrels?.Select(item => BarrelData.Deserialize(item, database)).ToArray();
 }