예제 #1
0
 public ModItemDefinition(Mod owner, ModObjectId id, ModItem item)
 {
     Owner = owner;
     Id    = id;
     Item  = item;
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public ModItem(ModObjectId id, ModItemTier tier)
 {
     this.id   = id;
     this.tier = tier;
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 public ItemStub(ModObjectId id, ModItemTier tier) : base(id, tier)
 {
 }