载入中...
搜索中...
未找到
eve::procgen::Grid2D类 参考

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.

在文件 Grid2D.h16 行定义.

成员函数说明

◆ addObject()

void eve::procgen::Grid2D::addObject ( const std::string &  name,
const std::string &  type,
float  x,
float  y,
float  width,
float  height,
int  gid 
)

◆ 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.cpp56 行定义.

引用了 addObject(), name, type, x , 以及 y.

被这些函数引用 eve::procgen::dtlutil::placeSpawnAndStairs().

◆ cells() [1/2]

std::vector< uint32_t > & eve::procgen::Grid2D::cells ( )
inline

在文件 Grid2D.h53 行定义.

◆ cells() [2/2]

const std::vector< uint32_t > & eve::procgen::Grid2D::cells ( ) const
inline

在文件 Grid2D.h52 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ clearObjects()

void eve::procgen::Grid2D::clearObjects ( )

在文件 Grid2D.cpp54 行定义.

被这些函数引用 eve::procgen::dtlutil::placeSpawnAndStairs().

◆ detail() [1/2]

std::vector< uint8_t > & eve::procgen::Grid2D::detail ( )
inline

在文件 Grid2D.h55 行定义.

◆ detail() [2/2]

const std::vector< uint8_t > & eve::procgen::Grid2D::detail ( ) const
inline

在文件 Grid2D.h54 行定义.

◆ fill()

void eve::procgen::Grid2D::fill ( int  semantic)

在文件 Grid2D.cpp33 行定义.

引用了 semantic.

◆ getCell()

int eve::procgen::Grid2D::getCell ( int  x,
int  y 
) const

在文件 Grid2D.cpp28 行定义.

引用了 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.cpp42 行定义.

引用了 x , 以及 y.

◆ getHeight()

int eve::procgen::Grid2D::getHeight ( ) const

◆ getMeta()

std::string eve::procgen::Grid2D::getMeta ( const std::string &  key,
const std::string &  defaultValue 
) const

在文件 Grid2D.cpp49 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectCount()

int eve::procgen::Grid2D::getObjectCount ( ) const

在文件 Grid2D.cpp73 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectGid()

int eve::procgen::Grid2D::getObjectGid ( int  i) const

在文件 Grid2D.cpp99 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectHeight()

float eve::procgen::Grid2D::getObjectHeight ( int  i) const

在文件 Grid2D.cpp95 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectName()

std::string eve::procgen::Grid2D::getObjectName ( int  i) const

在文件 Grid2D.cpp75 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectType()

std::string eve::procgen::Grid2D::getObjectType ( int  i) const

在文件 Grid2D.cpp79 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectWidth()

float eve::procgen::Grid2D::getObjectWidth ( int  i) const

在文件 Grid2D.cpp91 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectX()

float eve::procgen::Grid2D::getObjectX ( int  i) const

在文件 Grid2D.cpp83 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getObjectY()

float eve::procgen::Grid2D::getObjectY ( int  i) const

在文件 Grid2D.cpp87 行定义.

被这些函数引用 eve::procgen::gridToJson().

◆ getWidth()

int eve::procgen::Grid2D::getWidth ( ) const

◆ objects()

const std::vector< map::MapObject > & eve::procgen::Grid2D::objects ( ) const
inline

在文件 Grid2D.h56 行定义.

◆ resize()

void eve::procgen::Grid2D::resize ( int  width,
int  height 
)

在文件 Grid2D.cpp13 行定义.

引用了 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.cpp23 行定义.

引用了 semantic, x , 以及 y.

被这些函数引用 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.cpp37 行定义.

引用了 value, x , 以及 y.

◆ setMeta()

void eve::procgen::Grid2D::setMeta ( const std::string &  key,
const std::string &  value 
)

在文件 Grid2D.cpp47 行定义.

引用了 value.


该类的文档由以下文件生成: