/// <summary> /// Loads Factory data from an XML file. See online /// documentation/existing mods for formatting. /// </summary> /// <param name="xml">The xml document to read from.</param> public void loadXmlData(XmlDocument xml) { Units.ArmorType armor = new Units.ArmorType(10, 5); Units.EngineType engine = new Units.EngineType(15.0f, 3.0f, 2.0f); Units.WarheadType warhead = new Units.WarheadType(5, 5, Units.WarheadType.Types.BALlISTIC); Units.WeaponType weapon = new Units.WeaponType(warhead); Units.UnitType unit1 = new Units.UnitType(weapon, armor, engine, Sprites.SpriteBin.The.getSprite("PersonSprite")); Units.UnitType unit2 = new Units.UnitType(weapon, armor, engine, Sprites.SpriteBin.The.getSprite("GunSprite")); addType("BasicArmor", armor); addType("BasicEngine", engine); addType("BasicWarhead", warhead); addType("BasicWeapon", weapon); addType("TestUnit", unit1); addType("OtherUnit", unit2); Tiles.TileType firstTile = new LessThanOk.GameData.GameObjects.Tiles.TileType(Sprites.SpriteBin.The.getSprite("grassTile")); Tiles.TileType secondTile = new LessThanOk.GameData.GameObjects.Tiles.TileType(Sprites.SpriteBin.The.getSprite("yellowTile")); addType("grassTile", firstTile); addType("yellowTile", secondTile); }
/// <summary> /// Create a new unit type /// </summary> /// <param name="weps"> /// The weapons <see cref="List<WeaponType>"/> /// </param> /// <param name="a"> /// The armor <see cref="ArmorType"/> /// </param> /// <param name="e"> /// the engine <see cref="EngineType"/> /// </param> public UnitType(WeaponType wep, ArmorType a, EngineType e, Sprite s) { init(wep, a, e, s); }
private void init(WeaponType wep, ArmorType a, EngineType e, Sprite s) { weapon = wep; armor = a; engine = e; image = s; protoType = new Unit(this); }
internal Armor(ArmorType t) : base() { Type = t; strength = t.Strength; }
/// <summary> /// Loads Factory data from an XML file. See online /// documentation/existing mods for formatting. /// </summary> /// <param name="xml">The xml document to read from.</param> public void loadXmlData(XmlDocument xml) { Units.ArmorType armor = new Units.ArmorType(10, 5); Units.EngineType engine = new Units.EngineType(15.0f, 3.0f, 2.0f); Units.WarheadType warhead = new Units.WarheadType(5, 5, Units.WarheadType.Types.BALlISTIC); Units.WeaponType weapon = new Units.WeaponType(warhead); Units.UnitType unit1 = new Units.UnitType(weapon, armor, engine, Sprites.SpriteBin.The.getSprite("PersonSprite")) ; Units.UnitType unit2 = new Units.UnitType(weapon, armor, engine, Sprites.SpriteBin.The.getSprite("GunSprite")); addType("BasicArmor", armor); addType("BasicEngine", engine); addType("BasicWarhead", warhead); addType("BasicWeapon", weapon); addType("TestUnit", unit1); addType("OtherUnit", unit2); Tiles.TileType firstTile = new LessThanOk.GameData.GameObjects.Tiles.TileType(Sprites.SpriteBin.The.getSprite("grassTile")); Tiles.TileType secondTile = new LessThanOk.GameData.GameObjects.Tiles.TileType(Sprites.SpriteBin.The.getSprite("yellowTile")); addType("grassTile", firstTile); addType("yellowTile", secondTile); }