Class that represents and allows to manipulate an item in the inventory.
More...
List of all members.
Low Level Methods |
string | GetName () |
| Get the name of the item / the attribute the item represents.
|
void | SetCategory (string category) |
| Set the category group the item belongs to.
|
string | GetCategory () |
| Get the name of the category group the item belongs to.
|
Window | GetWindow () |
| Get the window representing the item.
|
Window | GetTextWindow () |
| Get window holding the item's description.
|
Window | GetValueWindow () |
| Get window holding the item's value.
|
string | GetText () |
| Get description of the item.
|
void | SelectForUse (int decrease=1) |
| Select the item for use with the Use key.
|
void | DeselectFromUse () |
| Deselect the item from use with the Use key.
|
void | Modify (string attribute, int amount, int decrease=1) |
| Modify a different attribute.
|
int | Combine (InventoryItem other) |
| Try to combine the item with a different item.
|
int | Combine (string other) |
| Try to combine the item with a different item.
|
int | Combine (string other, string result, int increaseResult=1, int decrease=1, int decreaseOther=1) |
| Try to combine the item with a different item.
|
void | AddCombination (string other, string result, int increaseResult=1, int decrease=1, int decreaseOther=1) |
| Allow to combine the item with a different item.
|
void | RemoveCombination (string other) |
| Remove the possibility to combine this item with the other item.
|
Detailed Description
Class that represents and allows to manipulate an item in the inventory.
Member Function Documentation
string InventoryItem::GetName |
( |
| ) |
|
Get the name of the item / the attribute the item represents.
- Returns:
- String holding the name of this item.
void InventoryItem::SetCategory |
( |
string |
category | ) |
|
Set the category group the item belongs to.
- Parameters:
-
category | String holding the name of the category group the item belongs to. |
string InventoryItem::GetCategory |
( |
| ) |
|
Get the name of the category group the item belongs to.
- Returns:
- String holding the name of this item's category.
Window InventoryItem::GetWindow |
( |
| ) |
|
Get the window representing the item.
- Returns:
- the Window object representing the item.
Window InventoryItem::GetTextWindow |
( |
| ) |
|
Get window holding the item's description.
- Returns:
- the Window object holding the item's description if defined, else null.
Window InventoryItem::GetValueWindow |
( |
| ) |
|
Get window holding the item's value.
- Returns:
- the Window object holding the item's value if defined, else null.
string InventoryItem::GetText |
( |
| ) |
|
Get description of the item.
- Returns:
- String holding the description of the item.
void InventoryItem::SelectForUse |
( |
int |
decrease = 1 | ) |
|
Select the item for use with the Use key.
- Parameters:
-
decrease | Amount that the item will be decreased when used. |
- Returns:
- Nothing.
void InventoryItem::DeselectFromUse |
( |
| ) |
|
Deselect the item from use with the Use key.
- Returns:
- Nothing.
void InventoryItem::Modify |
( |
string |
attribute, |
|
|
int |
amount, |
|
|
int |
decrease = 1 |
|
) |
| |
Modify a different attribute.
- Parameters:
-
attribute | Attribute to be modified. |
amount | Amount that the attribute will be modifies. |
decrease | Amount that the item will be decreased. |
- Returns:
- Nothing.
Try to combine the item with a different item.
- Parameters:
-
other | Item to combine this item with. |
- Returns:
- 0 if items are not combineable,
- 1 on successful combination,
- -1 if amount of item is too low,
- -2 if amount of other item is too low.
int InventoryItem::Combine |
( |
string |
other | ) |
|
Try to combine the item with a different item.
- Parameters:
-
other | String holding the name of the item to combine this item with. |
- Returns:
- 0 if items are not combineable,
- 1 on successful combination,
- -1 if amount of item is too low,
- -2 if amount of other item is too low.
int InventoryItem::Combine |
( |
string |
other, |
|
|
string |
result, |
|
|
int |
increaseResult = 1 , |
|
|
int |
decrease = 1 , |
|
|
int |
decreaseOther = 1 |
|
) |
| |
Try to combine the item with a different item.
- Parameters:
-
other | Item to combine the item with. |
result | Item resulting from the combination. |
increaseResult | Amount that the item resulting from the combination will be intcreased. |
decrease | Amount that the item will be decreased. |
decreaseOther | Amount that the other item will be decreased. |
- Returns:
- 0 if items are not combineable,
- 1 on successful combination,
- -1 if amount of item is too low,
- -2 if amount of other item is too low.
void InventoryItem::AddCombination |
( |
string |
other, |
|
|
string |
result, |
|
|
int |
increaseResult = 1 , |
|
|
int |
decrease = 1 , |
|
|
int |
decreaseOther = 1 |
|
) |
| |
Allow to combine the item with a different item.
- Parameters:
-
other | Item to combine the item with. |
result | Item resulting from the combination. |
increaseResult | Amount that the item resulting from the combination will be intcreased. |
decrease | Amount that the item will be decreased. |
decreaseOther | Amount that the other item will be decreased. |
- Returns:
- 1 on success.
- 0 if item combination already exists.
void InventoryItem::RemoveCombination |
( |
string |
other | ) |
|
Remove the possibility to combine this item with the other item.
- Parameters:
-
other | Item not to combine this item with. |