Steam Fort 0.5
Functions | Variables

src/item.cpp File Reference

#include "utils.hpp"
#include "main.hpp"
#include <map>
#include <stdio.h>
#include "ui.hpp"
#include "item.hpp"
#include "map.hpp"
#include "adventure.hpp"

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)
 Find proto object by name or type.
int find_obj (std::string name, int x, int y, TCODList< int > *types, bool hidden)
 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, bool hidden)
 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.

Variables

Container * itemsmenu = new Container(0, 0, 100, 75)

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.

Variable Documentation

Container* itemsmenu = new Container(0, 0, 100, 75)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines