/// <summary> /// Активный объект карты /// </summary> /// <param name="Image">Картинка</param> /// <param name="DestroyedActiveObject">Разрушенный активный объект (если нет - null)</param> /// <param name="Size">Размер (в клетках карты)</param> /// <param name="Direction">Направление</param> /// <param name="ArmorType">Тип брони</param> /// <param name="Health">Здоровье (0...)</param> /// <param name="Passability">Проходимость (0..1)</param> public MapActiveObject(MapImage Image, MapActiveObject DestroyedActiveObject, MapSize Size, MapDirection Direction, MapArmorType ArmorType, UInt16 Health, MapPassability Passability) : base(new MapTile(Image, Size)) { if ((Passability < 0) || (Passability > 1)) throw new ArgumentOutOfRangeException("Passability", "Passability of Place must be in range 0..1"); this.DestroyedActiveObject = DestroyedActiveObject; this.BaseDirection = Direction; this.Health = Health; this.Passability = Passability; this.ArmorType = ArmorType; }
public static void SerializeMapArmorType(BinaryWriter Writer, MapArmorType ArmorType) { Writer.Write((UInt16)ArmorType); }
/// <summary> /// Активный объект карты /// </summary> /// <param name="Image">Картинка</param> /// <param name="DestroyedActiveObject">Разрушенный активный объект (если нет - null)</param> /// <param name="Size">Размер (в клетках карты)</param> /// <param name="Direction">Направление</param> /// <param name="ArmorType">Тип брони</param> /// <param name="Health">Здоровье (0...)</param> /// <param name="Passability">Проходимость (0..1)</param> public MapActiveObject(MapImage Image, MapActiveObject DestroyedActiveObject, MapSize Size, MapDirection Direction, MapArmorType ArmorType, UInt16 Health, MapPassability Passability) : base(new MapTile(Image, Size)) { if ((Passability < 0) || (Passability > 1)) { throw new ArgumentOutOfRangeException("Passability", "Passability of Place must be in range 0..1"); } this.DestroyedActiveObject = DestroyedActiveObject; this.BaseDirection = Direction; this.Health = Health; this.Passability = Passability; this.ArmorType = ArmorType; }