This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/simulation/Sign.h
Tamás Bálint Misius ab600780d0
Clean up GameSave somewhat
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.
2022-11-10 15:15:10 +01:00

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