Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MapComponent Class Reference

A MapComponent represents any kind of item that can be placed on the map by the user. More...

#include <ed_mapcomponent.h>

Inheritance diagram for MapComponent:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MapComponent (const MapItemType *item)
const MapItemTypegetItemType () const
virtual int displayWidth () const =0
virtual int displayHeight () const =0
virtual MapComponentclone () const =0
virtual int place (const MapCoordinate &mc) const =0
virtual bool remove (const MapCoordinate &mc) const
void vPlace (const MapCoordinate &mc) const
 just a wrapper so we have a function return void
virtual void display (Surface &s, const SPoint &pos) const =0
virtual bool supportMultiFieldPlacement () const
void displayClip (PG_Widget *parent, SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst) const
virtual ~MapComponent ()

Static Public Attributes

static const int fontHeight = 20

Protected Member Functions

virtual SurfacegetClippingSurface () const =0
int getPlayer () const

Protected Attributes

const MapItemTypemapItem

Detailed Description

A MapComponent represents any kind of item that can be placed on the map by the user.

It is the abstract class on which the Brush edit function operates

Definition at line 44 of file ed_mapcomponent.h.


Constructor & Destructor Documentation

MapComponent::MapComponent const MapItemType item  ) 
 

Definition at line 44 of file ed_mapcomponent.cpp.

References SelectionHolder::playerChanged, and selection.

virtual MapComponent::~MapComponent  )  [inline, virtual]
 

Definition at line 66 of file ed_mapcomponent.h.


Member Function Documentation

virtual MapComponent* MapComponent::clone  )  const [pure virtual]
 

Implemented in VehicleItem, BuildingItem, ObjectItem, TerrainItem, and MineItem.

Referenced by SelectionHolder::setSelection().

virtual void MapComponent::display Surface s,
const SPoint pos
const [pure virtual]
 

Implemented in VehicleItem, BuildingItem, ObjectItem, TerrainItem, and MineItem.

Referenced by displayClip().

void MapComponent::displayClip PG_Widget parent,
SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
const
 

Definition at line 100 of file edselfnt.cpp.

References PG_Draw::BlitSurface(), Surface::createSurface(), display(), displayHeight(), displayWidth(), fontHeight, getClippingSurface(), PG_Widget::GetFontAscender(), getItemType(), PG_Rect::null, and PG_FontEngine::RenderText().

virtual int MapComponent::displayHeight  )  const [pure virtual]
 

Implemented in BasicItem< Item >, BuildingItem, BasicItem< TerrainType >, BasicItem< MineType >, BasicItem< ObjectType >, and BasicItem< Vehicletype >.

Referenced by displayClip().

virtual int MapComponent::displayWidth  )  const [pure virtual]
 

Implemented in BasicItem< Item >, BuildingItem, BasicItem< TerrainType >, BasicItem< MineType >, BasicItem< ObjectType >, and BasicItem< Vehicletype >.

Referenced by displayClip().

virtual Surface& MapComponent::getClippingSurface  )  const [protected, pure virtual]
 

Implemented in BasicItem< Item >, BuildingItem, BasicItem< TerrainType >, BasicItem< MineType >, BasicItem< ObjectType >, and BasicItem< Vehicletype >.

Referenced by displayClip().

const MapItemType* MapComponent::getItemType  )  const [inline]
 

Definition at line 55 of file ed_mapcomponent.h.

References mapItem.

Referenced by displayClip().

int MapComponent::getPlayer void   )  const [inline, protected]
 

Definition at line 51 of file ed_mapcomponent.h.

virtual int MapComponent::place const MapCoordinate mc  )  const [pure virtual]
 

Implemented in VehicleItem, BuildingItem, ObjectItem, TerrainItem, and MineItem.

Referenced by vPlace().

virtual bool MapComponent::remove const MapCoordinate mc  )  const [inline, virtual]
 

Reimplemented in ObjectItem.

Definition at line 60 of file ed_mapcomponent.h.

virtual bool MapComponent::supportMultiFieldPlacement  )  const [inline, virtual]
 

Reimplemented in BuildingItem.

Definition at line 64 of file ed_mapcomponent.h.

void MapComponent::vPlace const MapCoordinate mc  )  const [inline]
 

just a wrapper so we have a function return void

Definition at line 62 of file ed_mapcomponent.h.

References place().

Referenced by placeCurrentItem().


Member Data Documentation

const int MapComponent::fontHeight = 20 [static]
 

Definition at line 54 of file ed_mapcomponent.h.

Referenced by displayClip().

const MapItemType* MapComponent::mapItem [protected]
 

Definition at line 49 of file ed_mapcomponent.h.

Referenced by getItemType().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:18:02 2008 for Advanced Strategic Command by  doxygen 1.4.2