Steam Fort 0.5
Classes | Typedefs | Enumerations | Functions

src/item.hpp File Reference

#include <string>
#include "libtcod.hpp"

Go to the source code of this file.

Classes

class  Item
 Contains all informations about item. More...

Typedefs

typedef enum ItemTypes ITEMTYPE
 Contains items types.

Enumerations

enum  ItemTypes {
  TREE, ROCK, STONE, WOOD,
  RESOURCE, OBJECT, FUEL, VEIN,
  TIN, COPPER, COAL, ORE,
  BRONZE, METAL, LEG, ARM,
  TORSO, HEAD, HELMET, BRACERS,
  ARMOR, GREAVES, UPGRADE1, UPGRADE2,
  UPGRADE3, UPGRADE4, UPGRADE5, UPGRADE6,
  UPGRADE7, UPGRADE8, UPGRADE9, IRON,
  STEEL, COKE, SAND, HUPGRADE,
  AUPGRADE, TUPGRADE, LUPGRADE, WEAPON,
  LEATHER, BONE
}
 

Contains items types.

More...

Functions

void buildItemsUI ()
 Build items user interface.
void setVisibleItems (bool visible)
 Show/hide information about items.
int find_proto_obj (std::string name, TCODList< int > *types=new TCODList< int >())
 Find proto object by name or type.
int find_obj (std::string name, int x=-1, int y=-1, TCODList< int > *types=new TCODList< int >(), bool hidden=false)
 Find item by name, position or type.
int find_near_obj (std::string name, int x, int y, int radius, TCODList< int > *types, bool stored=true, bool hidden=false)
 Find nearest item from selected position.
TCODList< int > find_all_proto_obj (TCODList< int > types)
 Find all prototypes with selected types.
TCODList< int > find_all_obj (TCODList< int > types)
 Find all objects with selected types.

Typedef Documentation

typedef enum ItemTypes ITEMTYPE

Contains items types.


Enumeration Type Documentation

enum ItemTypes

Contains items types.

Enumerator:
TREE 
ROCK 
STONE 
WOOD 
RESOURCE 
OBJECT 
FUEL 
VEIN 
TIN 
COPPER 
COAL 
ORE 
BRONZE 
METAL 
LEG 
ARM 
TORSO 
HEAD 
HELMET 
BRACERS 
ARMOR 
GREAVES 
UPGRADE1 
UPGRADE2 
UPGRADE3 
UPGRADE4 
UPGRADE5 
UPGRADE6 
UPGRADE7 
UPGRADE8 
UPGRADE9 
IRON 
STEEL 
COKE 
SAND 
HUPGRADE 
AUPGRADE 
TUPGRADE 
LUPGRADE 
WEAPON 
LEATHER 
BONE 

Function Documentation

void buildItemsUI ( )

Build items user interface.

TCODList<int> find_all_obj ( TCODList< int >  types)

Find all objects with selected types.

Parameters:
typesItem types to find.
Returns:
List of indexes of objects.
TCODList<int> find_all_proto_obj ( TCODList< int >  types)

Find all prototypes with selected types.

Parameters:
typesItem types to find.
Returns:
List of indexes of objects.
int find_near_obj ( std::string  name,
int  x,
int  y,
int  radius,
TCODList< int > *  types,
bool  stored,
bool  hidden 
)

Find nearest item from selected position.

Parameters:
nameName of item to find.
xX-axis of start search position.
yY-axis of start search position.
radiusSize of radius to search.
typesTypes of item to find. Default empty.
storedCheck for objects in storehouse? Default is true.
hiddenCheck for visible or not objects? Default is false (only visible).
Returns:
Index of item in fortobjs vector. If item not found, return -1.
int find_obj ( std::string  name,
int  x,
int  y,
TCODList< int > *  types,
bool  hidden 
)

Find item by name, position or type.

Parameters:
nameName of item to find. If we don't want search by name, put empty string here.
xX-axis position of item. Default is -1.
yY-axis position of item. Default is -1.
typesTypes of item to find.
hiddenCheck for hidden items too.
Returns:
Index of item in fortobjs vector. If not found, return -1.
int find_proto_obj ( std::string  name,
TCODList< int > *  types 
)

Find proto object by name or type.

Parameters:
nameName of object to find
typesTypes of object to find
Returns:
Object index in protoobjs
void setVisibleItems ( bool  visible)

Show/hide information about items.

Parameters:
visibleIf true, show items, otherwise hide menu.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines