Jazz2/Editor/Common/StampClipboard.h file

Namespaces

namespace Jazz2
Root namespace of Jazz² Resurrection.
namespace Jazz2::Editor
namespace Jazz2::Editor::StampClipboard
Stamps as text in the clipboard of the system, so they can be pasted into another instance of the game.

Classes

struct Jazz2::Editor::LayeredStamp
A rectangle of tiles of several layers with the events in it, copied and pasted as one.
struct Jazz2::Editor::LayeredStamp::Layer
Tiles of a layer.

Functions

auto WriteTiles(const TileStamp& stamp, const LevelDocument* document = nullptr) -> String
Returns tiles as text, with the tile sets of document they're of if it's given.
auto ReadTiles(StringView text, TileStamp& stamp, const LevelDocument* document = nullptr) -> bool
Reads tiles from text, returns false if it isn't a stamp, with document they're found in its tile sets.
auto WriteEvents(const EventStamp& stamp) -> String
Returns events as text.
auto ReadEvents(StringView text, EventStamp& stamp) -> bool
Reads events from text, returns false if there are none.
auto WriteLayered(const LayeredStamp& stamp, const LevelDocument* document = nullptr) -> String
Returns tiles of several layers and events as text, with the tile sets of document as WriteTiles().
auto ReadLayered(StringView text, LayeredStamp& stamp, const LevelDocument* document = nullptr) -> bool
Reads tiles of several layers and events from text, returns false if it isn't such a stamp, see ReadTiles().
auto HasTile(const LevelDocument& document, const TileRef& tile) -> bool
Returns whether a level has a tile, a stamp copied from another level can refer to tile sets and animated tiles it hasn't.
void RemoveUnknownTiles(const LevelDocument& document, TileStamp& stamp)
Leaves tiles the level doesn't have out of a stamp, as if they weren't copied.

Variables

std::int32_t MaxStampSide constexpr
The longest side of a stamp in tiles, larger ones aren't read, nor picked.
std::int32_t MaxStampTiles constexpr
The most tiles a stamp has, larger ones aren't read, nor picked.