Intermediate 2D generation result. cells store semantic ids (see Semantic.h), not tile GIDs — convert via Palette when applying to a TileLayer.
更多...
#include <Grid2D.h>
Public 成员函数 | |
| void | resize (int width, int height) |
| int | getWidth () const |
| int | getHeight () const |
| void | setCell (int x, int y, int semantic) |
| int | getCell (int x, int y) const |
| void | fill (int semantic) |
| void | setDetail (int x, int y, int value) |
Per-cell detail layer (0..255), parallel to cells. Semantics stay in cells (palette/GID compatible); detail carries algorithm-specific extras such as wall-autotile direction masks, floor-pattern variants and decor tile indices. Semantics that have no detail use 0. | |
| int | getDetail (int x, int y) const |
| void | setMeta (const std::string &key, const std::string &value) |
| std::string | getMeta (const std::string &key, const std::string &defaultValue) const |
| void | clearObjects () |
| void | addObjectAt (const std::string &name, const std::string &type, float x, float y) |
| Script-friendly: name/type + tile coords. | |
| void | addObject (const std::string &name, const std::string &type, float x, float y, float width, float height, int gid) |
| int | getObjectCount () const |
| std::string | getObjectName (int i) const |
| std::string | getObjectType (int i) const |
| float | getObjectX (int i) const |
| float | getObjectY (int i) const |
| float | getObjectWidth (int i) const |
| float | getObjectHeight (int i) const |
| int | getObjectGid (int i) const |
| const std::vector< uint32_t > & | cells () const |
| std::vector< uint32_t > & | cells () |
| const std::vector< uint8_t > & | detail () const |
| std::vector< uint8_t > & | detail () |
| const std::vector< map::MapObject > & | objects () const |
详细描述
Intermediate 2D generation result. cells store semantic ids (see Semantic.h), not tile GIDs — convert via Palette when applying to a TileLayer.
成员函数说明
◆ addObject()
| void eve::procgen::Grid2D::addObject | ( | const std::string & | name, |
| const std::string & | type, | ||
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| int | gid | ||
| ) |
在文件 Grid2D.cpp 第 60 行定义.
引用了 eve::map::MapObject::gid, height, eve::map::MapObject::height, eve::map::MapObject::name, name, eve::map::MapObject::type, type, eve::map::MapObject::width, width, x, eve::map::MapObject::x, y , 以及 eve::map::MapObject::y.
被这些函数引用 addObjectAt().
◆ addObjectAt()
| void eve::procgen::Grid2D::addObjectAt | ( | const std::string & | name, |
| const std::string & | type, | ||
| float | x, | ||
| float | y | ||
| ) |
Script-friendly: name/type + tile coords.
在文件 Grid2D.cpp 第 56 行定义.
引用了 addObject(), name, type, x , 以及 y.
◆ cells() [1/2]
◆ cells() [2/2]
|
inline |
被这些函数引用 eve::procgen::gridToJson().
◆ clearObjects()
| void eve::procgen::Grid2D::clearObjects | ( | ) |
在文件 Grid2D.cpp 第 54 行定义.
◆ detail() [1/2]
◆ detail() [2/2]
◆ fill()
| void eve::procgen::Grid2D::fill | ( | int | semantic | ) |
在文件 Grid2D.cpp 第 33 行定义.
引用了 semantic.
◆ getCell()
| int eve::procgen::Grid2D::getCell | ( | int | x, |
| int | y | ||
| ) | const |
在文件 Grid2D.cpp 第 28 行定义.
引用了 eve::procgen::Semantic::Empty, x , 以及 y.
被这些函数引用 eve::procgen::PaletteTable::applyToLayer() , 以及 eve::procgen::dtlutil::placeSpawnAndStairs().
◆ getDetail()
| int eve::procgen::Grid2D::getDetail | ( | int | x, |
| int | y | ||
| ) | const |
在文件 Grid2D.cpp 第 42 行定义.
◆ getHeight()
| int eve::procgen::Grid2D::getHeight | ( | ) | const |
◆ getMeta()
| std::string eve::procgen::Grid2D::getMeta | ( | const std::string & | key, |
| const std::string & | defaultValue | ||
| ) | const |
在文件 Grid2D.cpp 第 49 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectCount()
| int eve::procgen::Grid2D::getObjectCount | ( | ) | const |
在文件 Grid2D.cpp 第 73 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectGid()
| int eve::procgen::Grid2D::getObjectGid | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 99 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectHeight()
| float eve::procgen::Grid2D::getObjectHeight | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 95 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectName()
| std::string eve::procgen::Grid2D::getObjectName | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 75 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectType()
| std::string eve::procgen::Grid2D::getObjectType | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 79 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectWidth()
| float eve::procgen::Grid2D::getObjectWidth | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 91 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectX()
| float eve::procgen::Grid2D::getObjectX | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 83 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getObjectY()
| float eve::procgen::Grid2D::getObjectY | ( | int | i | ) | const |
在文件 Grid2D.cpp 第 87 行定义.
被这些函数引用 eve::procgen::gridToJson().
◆ getWidth()
| int eve::procgen::Grid2D::getWidth | ( | ) | const |
◆ objects()
|
inline |
◆ resize()
| void eve::procgen::Grid2D::resize | ( | int | width, |
| int | height | ||
| ) |
在文件 Grid2D.cpp 第 13 行定义.
引用了 eve::procgen::Semantic::Empty, height , 以及 width.
被这些函数引用 eve::procgen::dtlutil::copyMatrixToGrid() , 以及 eve::procgen::Heightmap::toGrid().
◆ setCell()
| void eve::procgen::Grid2D::setCell | ( | int | x, |
| int | y, | ||
| int | semantic | ||
| ) |
在文件 Grid2D.cpp 第 23 行定义.
被这些函数引用 eve::procgen::dtlutil::copyMatrixToGrid() , 以及 eve::procgen::Heightmap::toGrid().
◆ setDetail()
| void eve::procgen::Grid2D::setDetail | ( | int | x, |
| int | y, | ||
| int | value | ||
| ) |
Per-cell detail layer (0..255), parallel to cells. Semantics stay in cells (palette/GID compatible); detail carries algorithm-specific extras such as wall-autotile direction masks, floor-pattern variants and decor tile indices. Semantics that have no detail use 0.
在文件 Grid2D.cpp 第 37 行定义.
◆ setMeta()
| void eve::procgen::Grid2D::setMeta | ( | const std::string & | key, |
| const std::string & | value | ||
| ) |
在文件 Grid2D.cpp 第 47 行定义.
引用了 value.
该类的文档由以下文件生成:
- src/modules/procgen/Grid2D.h
- src/modules/procgen/Grid2D.cpp