protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Flags", true, out subEle); subEle.Value = MagicEffectFlags.ToString(); ele.TryPathTo("BaseCost", true, out subEle); subEle.Value = BaseCost.ToString("G15"); ele.TryPathTo("AssociatedItem", true, out subEle); AssociatedItem.WriteXML(subEle, master); ele.TryPathTo("MagicSchool", true, out subEle); subEle.Value = MagicSchool.ToString(); ele.TryPathTo("ResistanceType", true, out subEle); subEle.Value = ResistanceType.ToString(); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToString(); WriteUnusedXML(ele, master); ele.TryPathTo("Light", true, out subEle); Light.WriteXML(subEle, master); ele.TryPathTo("ProjectileSpeed", true, out subEle); subEle.Value = ProjectileSpeed.ToString("G15"); ele.TryPathTo("EffectShader", true, out subEle); EffectShader.WriteXML(subEle, master); ele.TryPathTo("ObjectDisplayShader", true, out subEle); ObjectDisplayShader.WriteXML(subEle, master); ele.TryPathTo("EffectSound", true, out subEle); EffectSound.WriteXML(subEle, master); ele.TryPathTo("BoltSound", true, out subEle); BoltSound.WriteXML(subEle, master); ele.TryPathTo("HitSound", true, out subEle); HitSound.WriteXML(subEle, master); ele.TryPathTo("AreaSound", true, out subEle); AreaSound.WriteXML(subEle, master); ele.TryPathTo("ConstantEffectEnchantmentFactor", true, out subEle); subEle.Value = ConstantEffectEnchantmentFactor.ToString("G15"); ele.TryPathTo("ConstantEffectBarterFactor", true, out subEle); subEle.Value = ConstantEffectBarterFactor.ToString("G15"); ele.TryPathTo("Archetype", true, out subEle); subEle.Value = Archetype.ToString(); ele.TryPathTo("ActorValue", true, out subEle); subEle.Value = ActorValue.ToString(); }
public IEnumerable <Property> ToProperties() { // Add simple fields. var properties = new List <Property> { new Property(nameof(WorldSize), WorldSize.ToString(), comment: "The width and height of the game world."), new Property(nameof(MsPerFrame), MsPerFrame.ToString(), comment: "The number of milliseconds to spend per frame. FPS = 1000 / MsPerFrame."), new Property(nameof(FramesPerShot), FramesPerShot.ToString(), comment: "The number of frames to pause between each firing of a projectile."), new Property(nameof(RespawnRate), RespawnRate.ToString(), comment: "How many frames before a dead ship respawns."), new Property(nameof(ShipHitpoints), ShipHitpoints.ToString(), comment: "How many hitpoints ships should start with."), new Property(nameof(ProjectileSpeed), ProjectileSpeed.ToString(CultureInfo.InvariantCulture), comment: "How many units per frame that projectiles travel."), new Property(nameof(ShipEngineStrength), ShipEngineStrength.ToString(CultureInfo.InvariantCulture), comment: "How many units per frame that ships accellerate when thrusting."), new Property(nameof(ShipTurningRate), ShipTurningRate.ToString(CultureInfo.InvariantCulture), comment: "The degrees that a ship can rotate per frame."), new Property(nameof(ShipCollisionRadius), ShipCollisionRadius.ToString(CultureInfo.InvariantCulture), comment: "How close a projectile must get to collide with a ship."), new Property(nameof(StarCollisionRadius), StarCollisionRadius.ToString(CultureInfo.InvariantCulture), comment: "How close a projectile or ship must get to collide with a star."), new Property(nameof(ExplosiveGameMode), ExplosiveGameMode.ToString(), comment: "Set to true to enable the explosive game mode, where a large number of projectiles are spawned each time a sihp dies.") }; // Add all stars. foreach (var star in Stars) { properties.Add(new Property( nameof(Star), attributes: new Dictionary <string, string> { ["x"] = star.Location.GetX().ToString(CultureInfo.InvariantCulture), ["y"] = star.Location.GetY().ToString(CultureInfo.InvariantCulture), ["mass"] = star.Mass.ToString(CultureInfo.InvariantCulture) }, comment: "The location and mass of a star." )); } return(properties); }