C# Class Descent.Model.Player.Figure.HeroStuff.Inventory

The inventory of a hero
ファイルを表示 Open project: nezbo/Descent Class Usage Examples

Public Methods

Method Description
CanEquipWeapon ( Equipment equipment ) : bool

Do you have enough hands left to equip this weapon?

EquipArmor ( Equipment armor ) : void

Equip an armor

EquipPotion ( Equipment potion ) : void

Places a potion in the first

EquipShield ( Equipment shield ) : void

Equip a shield.

EquipToBackpack ( int index, Equipment item ) : void

Equip an item to backpack.

EquipToOther ( int index, Equipment item ) : void

Equip an item to 'other'.

EquipToPotions ( int index, Equipment item ) : void

Equip an item to potions.

EquipWeapon ( Equipment weapon ) : void

Equip a weapon

Inventory ( Hero hero ) : System.Diagnostics.Contracts

Initializes a new instance of the Inventory class. The inventory of a hero

UnequipArmor ( ) : Equipment

Unequip the armor.

UnequipFromBackpack ( int index ) : Equipment

Returns and removes a equipment from the backpack.

UnequipFromOther ( int index ) : Equipment

Unequips an other item, and returns it

UnequipFromPotions ( int index ) : Equipment

Returns and removes a potion from the inventory

UnequipShield ( ) : Equipment

Unequip the shield.

UnequipWeapon ( ) : Equipment

Unequip the weapon.

this ( int slot ) : Equipment

Gets an equipment at a

Private Methods

Method Description
CanEquipAtIndex ( int slot, Equipment equipment ) : bool
ObjectInvariant ( ) : void

Method Details

CanEquipWeapon() public method

Do you have enough hands left to equip this weapon?
public CanEquipWeapon ( Equipment equipment ) : bool
equipment Equipment /// A piece of equipment. ///
return bool

EquipArmor() public method

Equip an armor
public EquipArmor ( Equipment armor ) : void
armor Equipment /// The armor to be equipped ///
return void

EquipPotion() public method

Places a potion in the first
public EquipPotion ( Equipment potion ) : void
potion Equipment /// The potion to be equipped ///
return void

EquipShield() public method

Equip a shield.
public EquipShield ( Equipment shield ) : void
shield Equipment /// The shield to be equipped ///
return void

EquipToBackpack() public method

Equip an item to backpack.
public EquipToBackpack ( int index, Equipment item ) : void
index int The index where the item should be placed.
item Equipment The item to place.
return void

EquipToOther() public method

Equip an item to 'other'.
public EquipToOther ( int index, Equipment item ) : void
index int The index where the item should be placed.
item Equipment The item to place.
return void

EquipToPotions() public method

Equip an item to potions.
public EquipToPotions ( int index, Equipment item ) : void
index int The indexwhere the item should be placed.
item Equipment The item to place.
return void

EquipWeapon() public method

Equip a weapon
public EquipWeapon ( Equipment weapon ) : void
weapon Equipment /// The weapon to be equipped ///
return void

Inventory() public method

Initializes a new instance of the Inventory class. The inventory of a hero
public Inventory ( Hero hero ) : System.Diagnostics.Contracts
hero Hero /// The hero, that has this inventory. ///
return System.Diagnostics.Contracts

UnequipArmor() public method

Unequip the armor.
public UnequipArmor ( ) : Equipment
return Equipment

UnequipFromBackpack() public method

Returns and removes a equipment from the backpack.
public UnequipFromBackpack ( int index ) : Equipment
index int /// The index from where to remove. ///
return Equipment

UnequipFromOther() public method

Unequips an other item, and returns it
public UnequipFromOther ( int index ) : Equipment
index int /// The index from where to remove. ///
return Equipment

UnequipFromPotions() public method

Returns and removes a potion from the inventory
public UnequipFromPotions ( int index ) : Equipment
index int /// The index from where to remove the potion ///
return Equipment

UnequipShield() public method

Unequip the shield.
public UnequipShield ( ) : Equipment
return Equipment

UnequipWeapon() public method

Unequip the weapon.
public UnequipWeapon ( ) : Equipment
return Equipment

this() public method

Gets an equipment at a
public this ( int slot ) : Equipment
slot int /// The slot to access in the inventory ///
return Equipment