| 1 |
$#include "patch_type.h" |
| 2 |
$#include "patch.h" |
| 3 |
$#include "patch_manager.h" |
| 4 |
|
| 5 |
|
| 6 |
class CPatchType |
| 7 |
{ |
| 8 |
const CGraphic *getGraphic() const; |
| 9 |
int getTileWidth() const; |
| 10 |
int getTileHeight() const; |
| 11 |
unsigned short getFlag(int x, int y); |
| 12 |
}; |
| 13 |
|
| 14 |
|
| 15 |
class CPatch |
| 16 |
{ |
| 17 |
CPatchType *getType(); |
| 18 |
void setPos(int x, int y); |
| 19 |
void setX(int x); |
| 20 |
int getX() const; |
| 21 |
void setY(int y); |
| 22 |
int getY() const; |
| 23 |
}; |
| 24 |
|
| 25 |
// The C++ functions may have const std::string & parameters, but |
| 26 |
// don't tell tolua++ about the references, because it would ignore |
| 27 |
// the const and generate code to copy the modified strings to |
| 28 |
// additional Lua return values. |
| 29 |
|
| 30 |
class CPatchManager |
| 31 |
{ |
| 32 |
CPatch *add(std::string typeName, int x, int y); |
| 33 |
|
| 34 |
void moveToTop(CPatch *patch); |
| 35 |
void moveToBottom(CPatch *patch); |
| 36 |
|
| 37 |
CPatch *getPatch(int x, int y) const; |
| 38 |
|
| 39 |
vector<string> getPatchTypeNames() const; |
| 40 |
vector<string> getPatchTypeNamesUsingGraphic(std::string graphicFile) const; |
| 41 |
|
| 42 |
CPatchType *newPatchType(std::string name, std::string file, |
| 43 |
int width, int height, int flags[width*height], std::string theme); |
| 44 |
bool computePatchSize(std::string graphicFile, |
| 45 |
int *width = 0, int *height = 0) const; |
| 46 |
}; |