/// <summary> /// Initializes a new instance of the <see cref="Asset" /> class. /// </summary> /// <param name="src">The source.</param> /// <exception cref="System.ArgumentNullException">src</exception> internal Asset(SerializableAssetListItem src) { src.ThrowIfNull(nameof(src)); LocationID = src.LocationID; Quantity = src.Quantity; Item = StaticItems.GetItemByID(src.TypeID); FlagID = src.EVEFlag; m_flag = EveFlag.GetFlagText(src.EVEFlag); TypeOfBlueprint = GetTypeOfBlueprint(src.RawQuantity); Container = String.Empty; Volume = GetVolume(); TotalVolume = Quantity * Volume; }
/// <summary> /// Initializes a new instance of the <see cref="Asset" /> class. /// </summary> /// <param name="src">The source.</param> /// <param name="character">The owning character.</param> /// <exception cref="System.ArgumentNullException">src</exception> internal Asset(EsiAssetListItem src, CCPCharacter character) { src.ThrowIfNull(nameof(src)); int flagID = EveFlag.GetFlagID(src.EVEFlag); LocationID = src.LocationID; Quantity = src.Quantity; Item = StaticItems.GetItemByID(src.TypeID); FlagID = (short)flagID; m_character = character; m_flag = EveFlag.GetFlagText(flagID); TypeOfBlueprint = GetTypeOfBlueprint(src.IsBPC); Container = string.Empty; Volume = GetVolume(); TotalVolume = Quantity * Volume; }
public SerializableAssetListItem ToXMLItem() { int qty = Quantity; var ret = new SerializableAssetListItem() { TypeID = TypeID, ItemID = ItemID, // LocationID: // <60 000 000 = solar system in space // 60 014 861..60 014 928 = immensea // 61 000 000..66 000 000 = outpost // 66 000 000..67 000 000 = station, subtract 6 000 001 for station ID // 67 000 000..68 000 000 = outpost, subtract 6 000 000 for station ID // >68 000 000 = citadel LocationID = LocationID, Quantity = qty, Singleton = (byte)(Singleton ? 1 : 0), RawQuantity = (qty > 0) ? qty : 1, EVEFlag = (short)EveFlag.GetFlagID(EVEFlag) }; // Contents are filled in later return(ret); }