Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 private void init(WeaponType wep, ArmorType a, EngineType e, Sprite s)
 {
     weapon = wep;
     armor = a;
     engine = e;
     image = s;
     protoType = new Unit(this);
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 internal Armor(ArmorType t)
     : base()
 {
     Type = t;
     strength = t.Strength;
 }
Ejemplo n.º 6
0
 internal Armor(ArmorType t)
     : base()
 {
     Type     = t;
     strength = t.Strength;
 }
Ejemplo n.º 7
0
        /// <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);
        }