____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"#include <patch_manager.h>
Public Member Functions | |
| CPatchManager () | |
| ~CPatchManager () | |
| CPatch * | add (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) |
| CPatch * | getPatch (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 () |
| CPatchType * | newPatchType (const std::string &name, const std::string &file, int tileWidth, int tileHeight, int *flags) |
| CPatchType * | newPatchType (const std::string &name, const std::string &file, int tileWidth, int tileHeight, unsigned short *flags) |
| CPatchType * | getPatchType (const std::string &name) |
| std::string | savePatches (bool patchesOnly=false) const |
| std::string | savePatchType (CPatchType *patchType) const |
Definition at line 42 of file patch_manager.h.
| 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.
| 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 | ) |
Remove a patch
Definition at line 107 of file patch_manager.cpp.
References CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), CPatch::getX(), and CPatch::getY().
Referenced by EditorCallbackKeyDown().
| void CPatchManager::move | ( | CPatch * | patch, | |
| int | x, | |||
| int | y | |||
| ) |
Move a patch's location
Definition at line 118 of file patch_manager.cpp.
References CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), CPatch::getX(), CPatch::getY(), and CPatch::setPos().
Referenced by EditorCallbackMouse().
| 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 |
Save a patch type
Definition at line 330 of file patch_manager.cpp.
References CGraphic::File, CPatchType::getFlag(), CPatchType::getGraphic(), CPatchType::getName(), CPatchType::getTileHeight(), and CPatchType::getTileWidth().
Referenced by PatchSaveButtonListener::action(), and savePatches().
1.5.6