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 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 ASCString getName () const

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 54 of file ed_mapcomponent.h.


Constructor & Destructor Documentation

MapComponent::MapComponent ( const MapItemType item  ) 

Definition at line 49 of file ed_mapcomponent.cpp.

References SelectionHolder::playerChanged, and selection.


Member Function Documentation

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

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

Referenced by displayClip().

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

Definition at line 61 of file ed_mapcomponent.h.

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

Definition at line 65 of file ed_mapcomponent.h.

References mapItem.

Referenced by displayClip(), and Maped_MainScreenWidget::selectionChanged().

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

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

Referenced by displayClip(), and SelectionItemWidget::eventDraw().

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

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

Referenced by displayClip(), and SelectionItemWidget::eventDraw().

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

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

Referenced by displayClip(), and SelectionItemWidget::eventDraw().

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

Implements Placeable.

Reimplemented in BuildingItem.

Definition at line 69 of file ed_mapcomponent.h.

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

Definition at line 101 of file edselfnt.cpp.

References Surface::createSurface(), display(), displayHeight(), displayWidth(), fontHeight, getClippingSurface(), getItemType(), and getName().

virtual ASCString MapComponent::getName (  )  const [inline, virtual]

Implements Placeable.

Reimplemented in BasicItem< Item >, BuildingItem, BasicItem< VehicleType >, BasicItem< TerrainType >, BasicItem< MineType >, and BasicItem< ObjectType >.

Definition at line 71 of file ed_mapcomponent.h.

References MapItemType::getName(), and mapItem.

Referenced by displayClip().


Member Data Documentation

const MapItemType* MapComponent::mapItem [protected]

Definition at line 59 of file ed_mapcomponent.h.

Referenced by getItemType(), and getName().

const int MapComponent::fontHeight = 20 [static]

Definition at line 64 of file ed_mapcomponent.h.

Referenced by displayClip().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:46:58 2012 for Advanced Strategic Command by  doxygen 1.5.1