public void CreateItem(Creature itemOwner, ItemGenerator item) { Item newItem = new Item(this.IssueItemID(), item); this.CatalogueAddItemTo(newItem.ID, newItem); itemOwner.InventoryAddItem(newItem); }
public Item(UInt32 itemID, ItemGenerator generator) : this(itemID) { this._itemName = generator.name; this._itemBitmap = generator.itemBitmap; this._itemFunctions = generator.functions; this._itemType = generator.typeOfItem; }
public void CreateItem(Coords startPoint, ItemGenerator item) { //Coords bedLocation = new Coords((Int32)((bottomRight.X + topLeft.X) * 0.5), (Int32)((bottomRight.Y + topLeft.Y) * 0.5)); if (TileIsPassable(startPoint)) { Item newItem = new Item(this.IssueItemID(), item); this.CatalogueAddItemTo(newItem.ID, newItem); Tile itemTile = this.GetTile(startPoint); itemTile.InventoryAddItem(newItem); } else { throw new Exception("Unable to generate item on impassable terrain."); } }