2012-08-23 12:46:22 +02:00
|
|
|
/*
|
|
|
|
* =====================================================================
|
|
|
|
* Version: 1.0
|
|
|
|
* Created: 23.08.2012 12:35:59
|
|
|
|
* Author: Miroslav Bendík
|
|
|
|
* Company: LinuxOS.sk
|
|
|
|
* =====================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TILEGENERATOR_H_JJNUCARH
|
|
|
|
#define TILEGENERATOR_H_JJNUCARH
|
|
|
|
|
2012-08-23 12:55:31 +02:00
|
|
|
#include <stdint.h>
|
2012-08-23 12:46:22 +02:00
|
|
|
#include <string>
|
2012-08-23 12:55:31 +02:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
struct Color {
|
|
|
|
uint8_t r;
|
|
|
|
uint8_t g;
|
|
|
|
uint8_t b;
|
|
|
|
};
|
2012-08-23 12:46:22 +02:00
|
|
|
|
|
|
|
class TileGenerator
|
|
|
|
{
|
2012-08-23 12:55:31 +02:00
|
|
|
private:
|
|
|
|
typedef std::map<std::string, Color> ColorMap;
|
|
|
|
|
2012-08-23 12:46:22 +02:00
|
|
|
public:
|
|
|
|
TileGenerator();
|
|
|
|
~TileGenerator();
|
|
|
|
void setBgColor(const std::string &bgColor);
|
|
|
|
void setScaleColor(const std::string &scaleColor);
|
|
|
|
void setOriginColor(const std::string &originColor);
|
|
|
|
void setPlayerColor(const std::string &playerColor);
|
|
|
|
void setDrawOrigin(bool drawOrigin);
|
|
|
|
void setDrawPlayers(bool drawPlayers);
|
|
|
|
void setDrawScale(bool drawScale);
|
|
|
|
void setDrawUnderground(bool drawUnderground);
|
|
|
|
void generate(const std::string &input, const std::string &output);
|
2012-08-23 12:55:31 +02:00
|
|
|
void parseColorsFile(const std::string &fileName);
|
2012-08-23 12:46:22 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_bgColor;
|
|
|
|
std::string m_scaleColor;
|
|
|
|
std::string m_originColor;
|
|
|
|
std::string m_playerColor;
|
|
|
|
bool m_drawOrigin;
|
|
|
|
bool m_drawPlayers;
|
|
|
|
bool m_drawScale;
|
|
|
|
bool m_drawUnderground;
|
2012-08-23 12:55:31 +02:00
|
|
|
ColorMap m_colors;
|
2012-08-23 12:46:22 +02:00
|
|
|
}; /* ----- end of class TileGenerator ----- */
|
|
|
|
|
|
|
|
#endif /* end of include guard: TILEGENERATOR_H_JJNUCARH */
|
|
|
|
|