____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

CPatchManager Class Reference

#include <patch_manager.h>

List of all members.

Public Member Functions

 CPatchManager ()
 ~CPatchManager ()
CPatchadd (const std::string &typeName, int x, int y)
void remove (CPatch *patch)
void move (CPatch *patch, int x, int y)
void moveToTop (CPatch *patch)
void moveToBottom (CPatch *patch)
CPatchgetPatch (int x, int y, int *xOffset=NULL, int *yOffset=NULL) const
std::list< CPatch * > getPatches () const
std::vector< std::string > getPatchTypeNames () const
void load ()
void loadAll ()
void clear ()
CPatchTypenewPatchType (const std::string &name, const std::string &file, int tileWidth, int tileHeight, int *flags)
CPatchTypenewPatchType (const std::string &name, const std::string &file, int tileWidth, int tileHeight, unsigned short *flags)
CPatchTypegetPatchType (const std::string &name)
std::string savePatches (bool patchesOnly=false) const
std::string savePatchType (CPatchType *patchType) const


Detailed Description

Definition at line 42 of file patch_manager.h.


Constructor & Destructor Documentation

CPatchManager::CPatchManager (  ) 

Patch manager constructor

Definition at line 51 of file patch_manager.cpp.

CPatchManager::~CPatchManager (  ) 

Patch manager destructor

Definition at line 57 of file patch_manager.cpp.


Member Function Documentation

CPatch * CPatchManager::add ( const std::string &  typeName,
int  x,
int  y 
)

Create a new patch of type typeName at location x, y

Definition at line 89 of file patch_manager.cpp.

References Assert, CPatchType::getTileHeight(), and CPatchType::getTileWidth().

Referenced by EditorCallbackButtonDown(), and StartPatchEditor().

void CPatchManager::remove ( CPatch patch  ) 

void CPatchManager::move ( CPatch patch,
int  x,
int  y 
)

void CPatchManager::moveToTop ( CPatch patch  ) 

Move a patch to the top

Definition at line 145 of file patch_manager.cpp.

References CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), CPatch::getX(), and CPatch::getY().

void CPatchManager::moveToBottom ( CPatch patch  ) 

Move a patch to the bottom

Definition at line 157 of file patch_manager.cpp.

References CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), CPatch::getX(), and CPatch::getY().

CPatch * CPatchManager::getPatch ( int  x,
int  y,
int *  xOffset = NULL,
int *  yOffset = NULL 
) const

Get the patch at location x, y

Definition at line 169 of file patch_manager.cpp.

References CPatchType::getFlag(), and MapFieldTransparent.

Referenced by EditorCallbackKeyDown(), EditorCallbackMouse(), and CMinimap::UpdateTerrain().

std::list< CPatch * > CPatchManager::getPatches (  )  const

Get all of the patches

Definition at line 203 of file patch_manager.cpp.

Referenced by CViewport::DrawMapBackgroundInViewport().

std::vector< std::string > CPatchManager::getPatchTypeNames (  )  const

Get all of the patch names

Definition at line 209 of file patch_manager.cpp.

Referenced by CreatePatchIcons().

void CPatchManager::load (  ) 

Load the patches used in the map

Definition at line 223 of file patch_manager.cpp.

Referenced by CMap::Init(), and PatchEditorMainLoop().

void CPatchManager::loadAll (  ) 

Load all patches

Definition at line 232 of file patch_manager.cpp.

Referenced by CreatePatchIcons().

void CPatchManager::clear (  ) 

Clear the patches used in the map

Definition at line 254 of file patch_manager.cpp.

References clearPatches().

Referenced by CMap::Clean(), and StartPatchEditor().

CPatchType * CPatchManager::newPatchType ( const std::string &  name,
const std::string &  file,
int  tileWidth,
int  tileHeight,
int *  flags 
)

Define a new patch type. Types should be created only once and last for the duration of the game.

Definition at line 272 of file patch_manager.cpp.

Referenced by StartPatchEditor().

CPatchType * CPatchManager::newPatchType ( const std::string &  name,
const std::string &  file,
int  tileWidth,
int  tileHeight,
unsigned short *  flags 
)

Define a new patch type. Types should be created only once and last for the duration of the game.

Definition at line 287 of file patch_manager.cpp.

CPatchType * CPatchManager::getPatchType ( const std::string &  name  ) 

Get a patch type

Definition at line 302 of file patch_manager.cpp.

Referenced by CreatePatchIcons(), and StartPatchEditor().

std::string CPatchManager::savePatches ( bool  patchesOnly = false  )  const

Save all of the patches

Definition at line 308 of file patch_manager.cpp.

References savePatchType().

Referenced by CMap::Save(), and WriteMapSetup().

std::string CPatchManager::savePatchType ( CPatchType patchType  )  const


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

Generated on Sat Feb 21 00:28:23 2009 for Bos Wars by  doxygen 1.5.6