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

Map and it's contents - basically renderable game world! More...

#include <map.hpp>

Inheritance diagram for LxS::Game::Map:
Inheritance graph
Collaboration diagram for LxS::Game::Map:
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

void RemoveObject (GameObject *go)
 remove object from map. note that this function will erase reference to this object but won't free memory More...
 
void SetFilename (std::string s)
 to start with saved game, not a new game
 
ItemGetItem (const std::string &name)
 spawn a new item of a particular type and return a pointer to it
 
MapWindow::mode_t GetMode ()
 get current mode of game;
 
const gridverticesGetUsableGrid () const
 return grid as set of vertices - for a pathfinding algorithm
 
void RefreshAssets ()
 To facilitate refreshing app after switching OpenGL Context (as in Android lifecycle)
 
CharacterGetProtagonist ()
 return pointer to main character
 
CharacterGetCurrentEnemy ()
 return pointer to enemy, character is fighting against
 
const
LxS::CoreGraphics::TriangleSet
GetWalkableArea () const
 retrieve preprocessed navigation grid
 
 Map ()
 default constructor - only zeroing stuff, no loading etc;
 
void AttachOverlay (MapWindowOverlay *_o)
 so that Map class can report things
 
MapWindowOverlayGetOverlay ()
 if you want to print something over the map
 
void SetMapWindow (MapWindow *_win)
 so that from game we can configure a window
 
void EnterExplorationMode ()
 leave battle/talk mode
 
void EnterTalkMode (Character *adversary)
 Upon approaching friendly NPC enters talk mode.
 
void EnterBattleMode (Character *enemy)
 Upon approaching enemy enters battle mode.
 
virtual void Initialize ()
 load and set up some resources
 
void SaveFile ()
 Serialize map to the internetz or to the disk file.
 
virtual void Animate (float dt)
 move contents dt=delta time in seconds since last call to animate;
 
virtual void Render (Rendermode mode)
 render
 
virtual void UnloadResources ()
 free textures but not the status
 
void ClickPosition (float x, float y, float z)
 pass message that map was clicked in certain position in 3D space
 
void SetDirection (float x, float y)
 set movement direction for Protagonist (in menu/combat mode other actions are taken)
 
LxS::CoreGraphics::R3DCameraGetCamera ()
 retrieve dynamic camera object
 
void RotateView (float x, float y)
 quite obvious More...
 
GameObjectCollisionDetection (GameObject *cb, float x, float y, float z)
 
unsigned long GetTexelsCount ()
 sum of dimensionsxdepths of all textures
 
unsigned long GetFacesCount ()
 all 3D faces
 
virtual float GetInitializedPercentage ()
 100= fully initialized; 0-uninitialized
 
void DisplayHintBoxIfRequired (std::string hint)
 

Protected Attributes

float initialized_percentage
 0-100; 0- just constructed; 100 - redy to render; 0-100 - for progressbar
 

Friends

class LxS::CoreGraphics::R3DCamera
 

Detailed Description

Map and it's contents - basically renderable game world!

contains all characters, visible objects, sectors

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

Member Function Documentation

GameObject * Map::CollisionDetection ( GameObject cb,
float  x,
float  y,
float  z 
)

check whenever object CB collides with something at point x/y/z. If it does, return what did it collide against

Parameters
cb- colliding body - object in question
x,y,z- x,y,z coordinates
Returns
a pointer to object (if collision detected) or null pointer if free way
void Map::DisplayHintBoxIfRequired ( std::string  hint)

if hint named "hint" wasn't displayed, display it right now.

void Map::RemoveObject ( GameObject go)

remove object from map. note that this function will erase reference to this object but won't free memory

Parameters
goan object to be removed
void Map::RotateView ( float  x,
float  y 
)

quite obvious

dragging view *within reasonable limits)


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