Map Class Reference
[Engine Module]

#include <map.h>

Inheritance diagram for Map:

Preloaded Root Object TreeNode< Root > Referenced Counted Serialized List< Root > ListNode< Root >

List of all members.

Public Types

enum  ChangeDirection {
  CD_NONE = 0x00, CD_MOVE_UP = 0x01, CD_MOVE_DOWN = 0x02, CD_MOVE_LEFT = 0x04,
  CD_MOVE_RIGHT = 0x08, CD_ZOOM_IN = 0x10, CD_ZOOM_OUT = 0x20, CD_ZOOM_RESET = 0x40
}

Public Member Functions

 Map (const char *id)
virtual ~Map ()
virtual void SetActive (bool active)
void Render ()
SchemeGetScheme ()
const MapSizeGetSize ()
void UpdateViewport (ushort_t width, ushort_t height)
void SetMoveSpeed (float move_speed)
void SetZoomSpeed (float zoom_speed)
void ChangeView (byte_t direction)
void SetVisibleSegment (MapEnums::Segment segment)
MapEnums::Segment GetVisibleSegment ()
const MapAreaGetVisibleArea ()
void SetWarfogEnabled (bool enabled)
bool IsWarfogEnabled ()
void AddUnit (Unit *unit)
void RemoveUnit (Unit *unit)
void AddSceneObject (MapEnums::Segment segment_id, SceneObject *scene_object)
void RemoveSceneObject (MapEnums::Segment segment_id, SceneObject *scene_object)
bool IsInMap (const MapPosition2D &position) const
bool IsInMap (const MapPosition2D &position, const MapSize &size) const
void ScreenToMap (MapEnums::Segment segment, const vector2 &screen_position, vector2 &map_position) const
void MapToScreen (MapEnums::Segment segment, const vector2 &map_position, vector2 &screen_position) const
UnitFindPickUnit (ushort_t screen_x, ushort_t screen_y) const
bool FindUnitsInRectangle (const vector2 &corner1, const vector2 &corner2, list< Unit * > &units) const
byte_t GetSurface (const MapPosition2D &position) const
FieldGetField (const MapPosition3D &position) const

Protected Member Functions

virtual void ClearHeader ()
virtual void ClearBody ()
virtual bool ReadHeader (Serializer &serializer)
virtual bool ReadBody (Serializer &serializer)
virtual bool WriteHeader (Serializer &serializer)
virtual bool WriteBody (Serializer &serializer)
bool ReadFragments (Serializer &serializer)
bool ReadFragment (Serializer &serializer, Fragment &fragment)
void UpdateProjection ()
void UpdateView ()
void UpdateVisibleArea ()
bool UpdateSurface (const MapPosition2D &position, const Scheme::Fragment &fragment)
UnitFindPickUnit (MapEnums::Segment segment, ushort_t screen_x, ushort_t screen_y) const

Static Protected Member Functions

static bool OnAction (const string &action, int position, void *data)

Protected Attributes

string name
 Full map name.
string author_name
string author_contact
MapSize size
Segment segments [MapEnums::SEG_COUNT]
vector< Fragmentfragments
byte_t ** surface
Ref< Schemescheme
Projection projection
Viewport viewport
float projection_coef_h
float projection_coef_v
float move_speed
 <0.0, 1.0>
float zoom_speed
 <0.0, 1.0>
vector2 position
float zoom
bool view_changed
byte_t change_direction
MapEnums::Segment visible_segment
MapArea visible_area
bool warfog_enabled
bool catched
bool frame_moving

Classes

struct  Field
struct  Fragment
struct  Segment


Member Enumeration Documentation

enum Map::ChangeDirection

Enumerator:
CD_NONE 
CD_MOVE_UP 
CD_MOVE_DOWN 
CD_MOVE_LEFT 
CD_MOVE_RIGHT 
CD_ZOOM_IN 
CD_ZOOM_OUT 
CD_ZOOM_RESET 


Constructor & Destructor Documentation

Map::Map ( const char *  id  ) 

Constructor.

Map::~Map (  )  [virtual]

Destructor.


Member Function Documentation

void Map::SetActive ( bool  active  )  [virtual]

Sets active state.

Parameters:
active Active state.

Reimplemented from Preloaded.

void Map::Render (  ) 

Scheme * Map::GetScheme (  )  [inline]

const MapSize & Map::GetSize (  )  [inline]

void Map::UpdateViewport ( ushort_t  width,
ushort_t  height 
)

void Map::SetMoveSpeed ( float  move_speed  )  [inline]

void Map::SetZoomSpeed ( float  zoom_speed  )  [inline]

void Map::ChangeView ( byte_t  direction  )  [inline]

void Map::SetVisibleSegment ( MapEnums::Segment  segment  )  [inline]

MapEnums::Segment Map::GetVisibleSegment (  )  [inline]

const MapArea & Map::GetVisibleArea (  )  [inline]

void Map::SetWarfogEnabled ( bool  enabled  )  [inline]

bool Map::IsWarfogEnabled (  )  [inline]

void Map::AddUnit ( Unit unit  ) 

void Map::RemoveUnit ( Unit unit  ) 

void Map::AddSceneObject ( MapEnums::Segment  segment_id,
SceneObject scene_object 
)

void Map::RemoveSceneObject ( MapEnums::Segment  segment_id,
SceneObject scene_object 
)

bool Map::IsInMap ( const MapPosition2D position  )  const [inline]

bool Map::IsInMap ( const MapPosition2D position,
const MapSize size 
) const [inline]

void Map::ScreenToMap ( MapEnums::Segment  segment,
const vector2 screen_position,
vector2 map_position 
) const [inline]

void Map::MapToScreen ( MapEnums::Segment  segment,
const vector2 map_position,
vector2 screen_position 
) const [inline]

Unit * Map::FindPickUnit ( ushort_t  screen_x,
ushort_t  screen_y 
) const [inline]

bool Map::FindUnitsInRectangle ( const vector2 corner1,
const vector2 corner2,
list< Unit * > &  units 
) const

byte_t Map::GetSurface ( const MapPosition2D position  )  const [inline]

Map::Field * Map::GetField ( const MapPosition3D position  )  const [inline]

void Map::ClearHeader (  )  [protected, virtual]

Reimplemented from Preloaded.

void Map::ClearBody (  )  [protected, virtual]

Reimplemented from Preloaded.

bool Map::ReadHeader ( Serializer serializer  )  [protected, virtual]

Reimplemented from Preloaded.

bool Map::ReadBody ( Serializer serializer  )  [protected, virtual]

Reimplemented from Preloaded.

bool Map::WriteHeader ( Serializer serializer  )  [protected, virtual]

Todo:
Implement

Reimplemented from Preloaded.

bool Map::WriteBody ( Serializer serializer  )  [protected, virtual]

Todo:
Implement

Reimplemented from Preloaded.

bool Map::ReadFragments ( Serializer serializer  )  [protected]

bool Map::ReadFragment ( Serializer serializer,
Fragment fragment 
) [protected]

bool Map::OnAction ( const string &  action,
int  position,
void *  data 
) [static, protected]

void Map::UpdateProjection (  )  [protected]

void Map::UpdateView (  )  [protected]

void Map::UpdateVisibleArea (  )  [protected]

bool Map::UpdateSurface ( const MapPosition2D position,
const Scheme::Fragment fragment 
) [protected]

Unit * Map::FindPickUnit ( MapEnums::Segment  segment,
ushort_t  screen_x,
ushort_t  screen_y 
) const [protected]


Member Data Documentation

string Map::name [protected]

Full map name.

string Map::author_name [protected]

string Map::author_contact [protected]

MapSize Map::size [protected]

Segment Map::segments[MapEnums::SEG_COUNT] [protected]

vector<Fragment> Map::fragments [protected]

byte_t** Map::surface [protected]

Ref<Scheme> Map::scheme [protected]

Projection Map::projection [protected]

Viewport Map::viewport [protected]

float Map::projection_coef_h [protected]

float Map::projection_coef_v [protected]

float Map::move_speed [protected]

<0.0, 1.0>

float Map::zoom_speed [protected]

<0.0, 1.0>

vector2 Map::position [protected]

float Map::zoom [protected]

bool Map::view_changed [protected]

byte_t Map::change_direction [protected]

MapEnums::Segment Map::visible_segment [protected]

MapArea Map::visible_area [protected]

bool Map::warfog_enabled [protected]

bool Map::catched [protected]

bool Map::frame_moving [protected]


The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:32 2007 for Dark Oberon by  doxygen 1.5.3