Advanced Strategic Command
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MapComponent Class Referenceabstract

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]

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
 
- Public Member Functions inherited from Placeable
virtual ~Placeable ()
 
virtual int place (const MapCoordinate &mc) const =0
 
void vPlace (const MapCoordinate &mc) const
 just a wrapper so we have a function return void More...
 
virtual Placeableclone () const =0
 
virtual bool remove (const MapCoordinate &mc) 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 void MapComponent::display ( Surface s,
const SPoint pos 
) const
pure virtual
void MapComponent::displayClip ( PG_Widget *  parent,
SDL_Surface *  surface,
const PG_Rect &  src,
const PG_Rect &  dst 
) const
virtual int MapComponent::displayHeight ( ) const
pure virtual
virtual int MapComponent::displayWidth ( ) const
pure virtual
virtual Surface& MapComponent::getClippingSurface ( ) const
protectedpure virtual
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 ASCString MapComponent::getName ( ) const
inlinevirtual
int MapComponent::getPlayer ( void  ) const
inlineprotected

Definition at line 61 of file ed_mapcomponent.h.

virtual bool MapComponent::supportMultiFieldPlacement ( ) const
inlinevirtual

Implements Placeable.

Reimplemented in BuildingItem.

Definition at line 69 of file ed_mapcomponent.h.

Member Data Documentation

const int MapComponent::fontHeight = 20
static

Definition at line 64 of file ed_mapcomponent.h.

Referenced by displayClip().

const MapItemType* MapComponent::mapItem
protected

Definition at line 59 of file ed_mapcomponent.h.

Referenced by getItemType(), and getName().


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