public MailAttachedItem(Item item, byte pos) { Position = pos; AttachID = (int)item.GetGUID().GetCounter(); Item = new ItemInstance(item); Count = item.GetCount(); Charges = item.GetSpellCharges(); MaxDurability = item.GetUInt32Value(ItemFields.MaxDurability); Durability = item.GetUInt32Value(ItemFields.Durability); Unlocked = !item.IsLocked(); for (EnchantmentSlot slot = 0; slot < EnchantmentSlot.MaxInspected; slot++) { if (item.GetEnchantmentId(slot) == 0) { continue; } Enchants.Add(new ItemEnchantData((int)item.GetEnchantmentId(slot), item.GetEnchantmentDuration(slot), (int)item.GetEnchantmentCharges(slot), (byte)slot)); } byte i = 0; foreach (ItemDynamicFieldGems gemData in item.GetGems()) { if (gemData.ItemId != 0) { ItemGemData gem = new ItemGemData(); gem.Slot = i; gem.Item = new ItemInstance(gemData); Gems.Add(gem); } ++i; } }
public InspectItemData(Item item, byte index) { CreatorGUID = item.GetGuidValue(ItemFields.Creator); Item = new ItemInstance(item); Index = index; Usable = true; // @todo for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant) { uint enchId = item.GetEnchantmentId(enchant); if (enchId != 0) { Enchants.Add(new InspectEnchantData(enchId, (byte)enchant)); } } byte i = 0; foreach (ItemDynamicFieldGems gemData in item.GetGems()) { if (gemData.ItemId != 0) { ItemGemData gem = new ItemGemData(); gem.Slot = i; gem.Item = new ItemInstance(gemData); Gems.Add(gem); } ++i; } }
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public virtual void Stamp(Entity entity) { OrderOfPlay = entity.OrderOfPlay; _data.Stamp(entity._data); entity.Enchants.ForEach(p => Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers))); entity.Triggers.ForEach(p => Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner))); }
public InspectItemData(Item item, byte index) { CreatorGUID = item.GetCreator(); Item = new ItemInstance(item); Index = index; Usable = true; // @todo for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant) { uint enchId = item.GetEnchantmentId(enchant); if (enchId != 0) { Enchants.Add(new InspectEnchantData(enchId, (byte)enchant)); } } byte i = 0; foreach (SocketedGem gemData in item.m_itemData.Gems) { if (gemData.ItemId != 0) { ItemGemData gem = new(); gem.Slot = i; gem.Item = new ItemInstance(gemData); Gems.Add(gem); } ++i; } AzeriteItem azeriteItem = item.ToAzeriteItem(); if (azeriteItem != null) { SelectedAzeriteEssences essences = azeriteItem.GetSelectedAzeriteEssences(); if (essences != null) { for (byte slot = 0; slot < essences.AzeriteEssenceID.GetSize(); ++slot) { AzeriteEssenceData essence = new(); essence.Index = slot; essence.AzeriteEssenceID = essences.AzeriteEssenceID[slot]; if (essence.AzeriteEssenceID != 0) { essence.Rank = azeriteItem.GetEssenceRank(essence.AzeriteEssenceID); essence.SlotUnlocked = true; } else { essence.SlotUnlocked = azeriteItem.HasUnlockedEssenceSlot(slot); } AzeriteEssences.Add(essence); } } } }
public void Stamp(IZone zone) { zone.GetAll.ToList().ForEach(p => { IPlayable copy = Entity.FromCard(Controller, p.Card, null, null, p.Id); copy.Stamp(p as Entity); MoveTo(copy, copy.ZonePosition); }); zone.Enchants.ForEach(p => Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers))); zone.Triggers.ForEach(p => Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner))); }
public void Stamp(IZone zone) { zone.GetAll.ForEach(p => { IPlayable copy = Entity.FromCard(Controller, p.Card, null, null, p.Id); copy.Stamp(p as Entity); MoveTo(copy, ((Entity)copy).GetNativeGameTag(GameTag.ZONE_POSITION) - 1); }); zone.Enchants.ForEach(p => Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers))); zone.Triggers.ForEach(p => Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner))); }
public override void Stamp(Zone <IPlayable> zone) { foreach (IPlayable p in zone) { IPlayable copy = p.Clone(Controller); Entities.Add(copy); copy.Zone = this; } zone.Enchants.ForEach(p => Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers))); zone.Triggers.ForEach(p => Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner))); }
public override void Stamp(Zone <T> zone) { foreach (T entity in zone) { var copy = (T)entity.Clone(Controller); copy.Zone = this; Entities[_count] = copy; _count++; } zone.Enchants.ForEach(p => Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers))); zone.Triggers.ForEach(p => Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner))); }
private void ReadEnchants(SQLiteHelper db, HeroesTextHelper HeroesText) { using (DbDataReader reader2 = db.GetReader("SELECT * FROM EnchantInfo ORDER BY EnchantLevel;")) { while (reader2 != null && reader2.Read()) { EnchantInfo info = new EnchantInfo(reader2, HeroesText); if (info.Class.EndsWith("_100")) { continue; } if (!Enchants.ContainsKey(info.Class)) { Enchants.Add(info.Class, info); } } } }
/// <summary> /// A copy constructor. This constructor is only used to the inherited copy constructors. /// </summary> /// <param name="game"><see cref="Model.Game"/> instance of a copied entity.</param> /// <param name="entity">A source <see cref="Entity"/>.</param> protected Entity(Game game, Entity entity) { Game = game; _data = new EntityData(entity._data); Id = entity.Id; OrderOfPlay = entity.OrderOfPlay; if (game == null) { return; } for (int i = 0; i < entity.Enchants.Count; i++) { Enchant p = entity.Enchants[i]; Enchants.Add(p.Copy(p.SourceId, Game, p.Turn, Enchants, p.Owner, p.RemoveTriggers)); } for (int i = 0; i < entity.Triggers.Count; i++) { Trigger p = entity.Triggers[i]; Triggers.Add(p.Copy(p.SourceId, Game, p.Turn, Triggers, p.Owner)); } }