Interface IInventory
The character's inventory. Those are the items that the character holds in his/her (usually) imaginary bag. It is composed of a list of inventory items, and one active item that the character holds in his/her hand.
Inherited Members
System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IInventory : INotifyPropertyChanged
Properties
| Improve this Doc View SourceActiveItem
Gets/sets the character's current active inventory item (for example the item that character currently holds in his/her hand). Setting it will update the mouse cursor if appropriate. To deselect the current inventory, set it to null.
Declaration
IInventoryItem ActiveItem { get; set; }
Property Value
Type | Description |
---|---|
IInventoryItem | The active inventory item. |
Examples
cEgo.ActiveInventory = iKey; //The character is now "holding" the key.
private async void onDoorClicked()
{
if (cEgo.ActiveInventory == iKey) openDoor();
else await cEgo.SayAsync("I can't open the door without holding the key!");
}
|
Improve this Doc
View Source
Items
Gets the list of inventory items the character has.
Declaration
IAGSBindingList<IInventoryItem> Items { get; }
Property Value
Type | Description |
---|---|
IAGSBindingList<IInventoryItem> | The inventory items. |
Examples
Do I have the key?
if (Items.Any(item => item == iKey)) await cEgo.SayAsync("I have the key!");
else await cEgo.SayAsync("I don't have the key!");