载入中...
搜索中...
未找到
LevelDocument.cpp
浏览该文件的文档.
73 if (!layer(from) || to < 0 || to >= int(layers_.size()) || from == to) return LevelChange::Unchanged;
149void LevelDocument::setProperty(const std::string& key, const std::string& value) { properties_[key] = value; }
150std::string LevelDocument::getProperty(const std::string& key, const std::string& fallback) const {
const std::string & getLayerName(int index) const
Returns the layer name.
Definition LevelDocument.cpp:89
int addObject(int layerIndex, const std::string &type, float x, float y)
Adds object.
Definition LevelDocument.cpp:115
std::string getProperty(const std::string &key, const std::string &fallback={}) const
Returns the property.
Definition LevelDocument.cpp:150
LevelChange removeObject(int layerIndex, int objectIndex)
Removes object.
Definition LevelDocument.cpp:142
void setOrientation(const std::string &orientation)
Sets the orientation.
Definition LevelDocument.cpp:41
void setLayerName(int index, const std::string &name)
Sets the layer name.
Definition LevelDocument.cpp:94
void resize(int width, int height)
Changes map dimensions and resizes all tile layers.
Definition LevelDocument.cpp:27
eve::OptionalRef< LevelObject > object(int layerIndex, int objectIndex)
Object.
Definition LevelDocument.cpp:130
LevelDocument(int width=1, int height=1, float tileWidth=32.f, float tileHeight=32.f)
Level document.
Definition LevelDocument.cpp:9
const std::string getLayerKind(int index) const
Returns the layer kind.
Definition LevelDocument.cpp:99
void setProperty(const std::string &key, const std::string &value)
Sets the property.
Definition LevelDocument.cpp:149
eve::OptionalRef< TileBuffer > getTileLayer(int index)
Returns the tile layer.
Definition LevelDocument.cpp:104
Definition Brush.cpp:10
LevelChange
Whether a requested level mutation changed authoritative document state.
Definition LevelDocument.h:17
@ Unchanged
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
A tile or object layer in a LevelDocument.
Definition LevelDocument.h:33
std::unique_ptr< TileBuffer > tiles
Definition LevelDocument.h:45
One freely extensible object placed in a top-down level.
Definition LevelDocument.h:20