#include <item.h>
Public Member Functions | |
| Item (IntPoint _coords) | |
| Item (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords) | |
| int | get_weight () |
| Tile * | get_sprite () |
| virtual void | perform_action ()=0 |
| IntPoint | get_coords () |
| void | set_coords (IntPoint _c) |
| std::string | get_name () |
| int | get_rarity () |
| std::string | get_description () |
| int | get_size () |
Public Attributes | |
| bool | can_equip |
| bool | can_use |
| bool | can_wield |
| bool | can_consume |
Protected Attributes | |
| std::string | name |
| std::string | description |
| int | weight |
| IntPoint | coords |
| Tile | sprite |
| int | rarity |
| int | size |
The base class for all item types. This class acts as a base for all items, including equipment, weapons, consumables, and other item types.
| Item::Item | ( | IntPoint | _coords | ) |
The basic constructor for an item.
| _coords | The coordinates to place the item at. |
A constructor for an item.
| _rarity | Sets the class member rarity. |
| _weight | Sets the weight of the item. |
| _sprite | Sets the sprite of the item.. |
| _name | Sets the name of the item. |
| _coords | Set the coordinates of the item. |
| IntPoint Item::get_coords | ( | ) |
Public accessor for the coordinates.
| std::string Item::get_description | ( | ) |
Public accessor for the description.
| std::string Item::get_name | ( | ) |
Public accessor for the name.
| int Item::get_rarity | ( | ) |
Public accessor for the rarity.
| int Item::get_size | ( | ) |
Public accessor for the size.
| Tile * Item::get_sprite | ( | ) |
Public accessor for the member variable sprite.
| int Item::get_weight | ( | ) |
Public accessor for the member variable weight.
|
pure virtual |
| void Item::set_coords | ( | IntPoint | _c | ) |
Public setter for the coordinates.
| _c | The new coords to be set. |
| bool Item::can_consume |
Whether or not a character can consume an item.
| bool Item::can_equip |
Whether or not the item can be equipped by any character.
| bool Item::can_use |
Whether the item has a usable component. If this is yes, that means that the item has some active component other than its base use, e.g. a sword that has a spell attached to it.
| bool Item::can_wield |
Whether or not an item can be wielded as a weapon by a character.
|
protected |
Where the item currently is. This is only used as a way to graphically represent the item when it is on the ground. When an item is in a character's inventory, the coordinates are wherever it was picked up, and are only updated when the item is dropped again.
|
protected |
A brief description of the item.
|
protected |
What the item is called.
|
protected |
How likely it is that the item will appear.
|
protected |
The size of the item. Will factor into what can use it and how much can be carried at a time (using a unit system that I'm going to conveniently make up whenever I feel like it).
|
protected |
A graphical representation of the item.
|
protected |
How much the item weighs.
1.8.8