Namely: - get rid of unsafe memory management; - use vectors / Planes everywhere; - return a vector from serialization functions; - have read functions take a vector; - improve constness; - hide a few implementation details from GameSave.h; - get rid of GameSave copy constructor; - better member initialization; - use the slightly more C++-looking BZ2 wrappers. The BSON library still takes ownership of the data it parses, and GameSave ownership is still a joke. Those will need to be fixed later.
40 lines
560 B
C++
40 lines
560 B
C++
#ifndef SIGN_H_
|
|
#define SIGN_H_
|
|
#include "Config.h"
|
|
|
|
#include "common/String.h"
|
|
|
|
#include <utility>
|
|
|
|
class Simulation;
|
|
|
|
struct sign
|
|
{
|
|
enum Justification
|
|
{
|
|
Left = 0,
|
|
Middle = 1,
|
|
Right = 2,
|
|
None = 3
|
|
};
|
|
|
|
enum Type
|
|
{
|
|
Normal,
|
|
Save,
|
|
Thread,
|
|
Button,
|
|
Search
|
|
};
|
|
|
|
int x, y;
|
|
Justification ju;
|
|
String text;
|
|
|
|
sign(String text_, int x_, int y_, Justification justification_);
|
|
String getDisplayText(Simulation *sim, int &x, int &y, int &w, int &h, bool colorize = true, bool *v95 = nullptr) const;
|
|
std::pair<int, Type> split() const;
|
|
};
|
|
|
|
#endif
|