public ModItemDefinition(Mod owner, ModObjectId id, ModItem item) { Owner = owner; Id = id; Item = item; }
/// <summary> /// Gets an item with the given id in the registry, or null if none is found. /// </summary> /// <param name="id">The id of the item to search for.</param> /// <returns>The item with the given id, or null if none was found.</returns> public ModItem GetItem(ModObjectId id) { var itemId = this.itemIds.GetValueOrDefault(id, -1); return(itemId == -1 ? null : this.registeredItems[itemId].Item); }
public ModItem(ModObjectId id, ModItemTier tier) { this.id = id; this.tier = tier; }
/// <summary> /// Checks if an item with the given id is present in the registry. /// </summary> /// <param name="id">The id of the item to search for.</param> /// <returns>true if the item was found in the registry, false otherwise.</returns> public bool IsItemPresent(ModObjectId id) { return(this.itemIds.ContainsKey(id)); }
public ItemStub(ModObjectId id, ModItemTier tier) : base(id, tier) { }