All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
LxS::Game::Potion Class Reference

potion - can be consumed More...

#include <item.hpp>

Inheritance diagram for LxS::Game::Potion:
Inheritance graph
Collaboration diagram for LxS::Game::Potion:
Collaboration graph

Public Types

enum  Rendermode { ForReal, ForCoords3D, ForCoordsGame }
 purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked" More...

Public Member Functions

int GetHealth ()
 how much health is restored upon drinking this potion (absolute value)
void SetHealth (int d)
 set health modifier
 Potion (Map *p)
 constructor of new potion for given map
 Potion (Potion *p)
 "copy" constructor with pointer as a parameter
int GetType ()
 return type of an item (ITEM,SWORD,POTION,COIN)
const std::string & GetName ()
 return name of an item
bool CollisionDetection (GameObject *cb, float _x, float _y, float _z)
 detect collision (so that character can notice and pick up an item)
void SetName (const std::string _n)
 set item's name (i.e. "Mighty sword of killing")
int GetAmount ()
 how many of this item?
void SetAmount (int a)
 set amount of item (by default: 1)
float GetValue ()
 get monetary value (essential for barter engine)
void SetValue (float a)
 set monetary value
float GetWeight ()
 get weight (in pounds)
void SetWeight (float a)
 set weight (in pounds)
LxS::CoreGraphics::p_Model GetModel ()
 return model of an item (only if it has a graphical representation)
void SetFilename (std::string fn)
 set name of file describing this particular game object (its models, textures, animation sequences etc)
const std::string GetFilename ()
 return filename
virtual void SelectAnimation (std::string seq_name)
 select animation sequences to be played
GetWalkableArea () const
 select area alongside which character is allowed to move
virtual void SetRotationY (float alpha)
 rotate around axis, that is perpendicular to the ground
virtual float GetRotationY ()
 for deserialization, status query etc.
virtual void Animate (float dt)
 move contents dt=delta time in seconds since last call to animate;
virtual void SetPosition (float x, float y, float z)
 set coordinates of game object in 3D space (its own 0/0/0 point is moved against global 0/0/0)
virtual float GetPositionX ()
 where it is (note, that this may be inaccurate if more than one gameobject is represented by the same model mesh; TODO: fix GetPositionX/Y/Z in GameObject)
virtual float GetPositionY ()
 where it is
virtual float GetPositionZ ()
 where it is
virtual void Initialize ()
 set up resources. (this is to facilitate late (delayed) initialization.
virtual void Render (Rendermode mode)
 render something
virtual void RefreshAssets ()
 To facilitate refreshing app after switching OpenGL Context (as in Android lifecycle)
virtual void UnloadResources ()
 free up consumed resources while (possibly temporarily) object is not critical
unsigned long GetTexelsCount ()
 sum of dimensionsxdepths of all textures
unsigned long GetFacesCount ()
 all 3D faces
float GetInitializedPercentage ()
 0= uninitialized; 100=ready; other? for progress bars

Protected Types

typedef std::map< std::string,
 sequence name, firstxo frame, last frame

Protected Member Functions

void CopyBasicProperties (Item *i)
 for use in various "copy" constructors

Protected Attributes

< LxS::CoreGraphics::Model
 pointer to a model
std::string object_fn
AnimationMap sequences
 all animation sequences supported
AnimationMap::iterator current_sequence
 current animation sequence that is played
float current_frame
 animation frame
 map containing this
float AnimationSpeedMultipiler
 set greater than 1 if want to accelerate animation;
float initialized_percentage
 0-100; 0- just constructed; 100 - redy to render; 0-100 - for progressbar

Detailed Description

potion - can be consumed

Member Enumeration Documentation

purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked"


proper rendering for display


rendering for coordinate detection


for detection of ingame coordinate system - unused

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