Labyrinth
 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::Sword Class Reference

melee weapon More...

#include <item.hpp>

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

Public Types

enum  { ITEM, SWORD, POTION, COIN }
 
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 GetDamage ()
 damage modifier of particular sword (die class)
 
void SetDamage (int d)
 set damage modifier(die class)
 
 Sword (Map *p)
 default ctor
 
 Sword (Sword *s)
 "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
 
const
LxS::CoreGraphics::TriangleSet
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
AnimationMap
 sequence name, firstxo frame, last frame
 

Protected Member Functions

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

Protected Attributes

boost::shared_ptr
< LxS::CoreGraphics::Model
p_Model
 pointer to a model
 
std::string object_fn
 filename
 
AnimationMap sequences
 all animation sequences supported
 
AnimationMap::iterator current_sequence
 current animation sequence that is played
 
float current_frame
 animation frame
 
Mapparent_map
 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

melee weapon

Member Enumeration Documentation

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

Enumerator
ForReal 

proper rendering for display

ForCoords3D 

rendering for coordinate detection

ForCoordsGame 

for detection of ingame coordinate system - unused


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