Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Attributes | List of all members
Equipment Class Reference

#include <item.h>

Inheritance diagram for Equipment:
Item

Public Member Functions

 Equipment (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords, int bp, int t)
 
 Equipment (IntPoint _coords, EquipType eqp)
 
void perform_action ()
 
int get_body_part ()
 
int get_hit (int type)
 
float get_dam (int type)
 
- Public Member Functions inherited from Item
 Item (IntPoint _coords)
 
 Item (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords)
 
int get_weight ()
 
Tileget_sprite ()
 
IntPoint get_coords ()
 
void set_coords (IntPoint _c)
 
std::string get_name ()
 
int get_rarity ()
 
std::string get_description ()
 
int get_size ()
 

Protected Attributes

int body_part
 
int type
 
std::vector< int > to_hit
 
std::vector< float > to_dam
 
- Protected Attributes inherited from Item
std::string name
 
std::string description
 
int weight
 
IntPoint coords
 
Tile sprite
 
int rarity
 
int size
 

Additional Inherited Members

- Public Attributes inherited from Item
bool can_equip
 
bool can_use
 
bool can_wield
 
bool can_consume
 

Detailed Description

The class responsible for creating equipiment. Equipment refers to anything wearable on the body.

See also
EquipType

Constructor & Destructor Documentation

Equipment::Equipment ( int  _rarity,
int  _weight,
Tile  _sprite,
std::string  _name,
IntPoint  _coords,
int  bp,
int  t 
)

The constructor for the equipment.

Parameters
_raritySets the rarity of the equipment.
_weightSets the weight of the equipment.
_spriteSets the sprite for the equipment.
_nameSets the name of the equipment.
_coordsSets the coordinates of the equipments.
bpSets the body_part for the equipment.
tSets the type of the equipment.
acSets the armor_class of the equipment.
Equipment::Equipment ( IntPoint  _coords,
EquipType  eqp 
)

Constructor for the equipment. This is the normally used constructor, relying on the defined EquipTypes and taking a set of coordinates.

Parameters
_coordsSets the coordinates of the equipment.
eqpTHe template for the equipment.

Member Function Documentation

int Equipment::get_body_part ( )

Public accessor for body_part.

float Equipment::get_dam ( int  type)

Public accessor for to_dam.

int Equipment::get_hit ( int  type)

Public accessor for to_hit.

void Equipment::perform_action ( )
virtual

For performaing an action other than increasing the armor class.

See also
Item::perform_action()

Implements Item.

Member Data Documentation

int Equipment::body_part
protected

Which body part the equipment will be worn on. This corresponds to the index in the Characters equipment

See also
Character::equipment
EquipType::body_part
std::vector<float> Equipment::to_dam
protected

Determines the damage bonus gained from the equipment.

std::vector<int> Equipment::to_hit
protected

Determines hit bonus gained from the equipment.

int Equipment::type
protected

Determines which type of armor it is.

See also
EquipType::type
WeaponType::type

The documentation for this class was generated from the following files: