Пример #1
0
        public void CreateItem(Creature itemOwner, ItemGenerator item)
        {
            Item newItem = new Item(this.IssueItemID(), item);

            this.CatalogueAddItemTo(newItem.ID, newItem);
            itemOwner.InventoryAddItem(newItem);
        }
Пример #2
0
 public Item(UInt32 itemID, ItemGenerator generator)
     : this(itemID)
 {
     this._itemName      = generator.name;
     this._itemBitmap    = generator.itemBitmap;
     this._itemFunctions = generator.functions;
     this._itemType      = generator.typeOfItem;
 }
Пример #3
0
 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.");
     }
 }