载入中...
搜索中...
未找到
ArchSpaceTileMapProjector.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
5#include "common/Result.h"
6
7#include <cstdint>
8#include <string>
9
10namespace eve::map {
11class TileLayer;
12}
13
14namespace eve::archspace_map {
15
18 int floorGid = 1;
19 int wallGid = 2;
20 int portalGid = 3;
21 int solidGid = 4;
22};
23
35public:
36 TileMapProjector() = default;
39 ~TileMapProjector() override;
40
46 [[nodiscard]] const char* kind() const noexcept override;
47
49 void setLevelId(std::string levelId);
51 void setCellSize(float cellSize);
53 [[nodiscard]] eve::Result<void> setOrientation(std::string orientation);
55 void setPalette(ArchSpaceTilePalette palette);
56
62 void setLayer(map::TileLayer* layer);
63
64 [[nodiscard]] eve::Result<void> sync(const archspace::Document& document, std::uint64_t revision) override;
65 void clear() override;
66
72 [[nodiscard]] map::TileLayer* layer() const noexcept { return layer_; }
73
75 [[nodiscard]] const archspace::GridProjection& grid() const noexcept { return grid_; }
76
78 [[nodiscard]] std::uint64_t revision() const noexcept { return revision_; }
79
81 [[nodiscard]] const std::string& orientation() const noexcept { return orientation_; }
82
83private:
84 [[nodiscard]] eve::Result<void> ensureLayer(int width, int height, float tileSize);
85
86 std::string levelId_;
87 float cellSize_ = 1.f;
88 std::string orientation_ = "orthogonal";
89 ArchSpaceTilePalette palette_{};
90 map::TileLayer* layer_ = nullptr;
91 bool ownsLayer_ = false;
93 std::uint64_t revision_ = 0;
94};
95
96} // namespace eve::archspace_map
std::uint64_t revision
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::string palette
std::uint32_t height
std::uint32_t width
TileLayer * layer
Move-only, checked operation results for the common layer.
std::string kind
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Presentation adapter contract for ArchSpace documents.
Projects an ArchSpace level onto a map::TileLayer (orthogonal or isometric).
TileMapProjector & operator=(const TileMapProjector &)=delete
TileMapProjector(const TileMapProjector &)=delete
std::uint64_t revision() const noexcept
Revision last successfully synced.
const std::string & orientation() const noexcept
Current orientation wire name.
const archspace::GridProjection & grid() const noexcept
Last baked grid; empty before the first successful sync.
ECS tile layer entity. Script mutates tile GIDs / tileset / draw; TileRenderSystem batch-draws atlas ...
Definition TileLayer.h:33
放置世界:格子占用(多通道)+ 地形语义 + 已放置建筑实例。 行为由 PlacementSystem 提供;本类暴露便于脚本绑定的薄封装方法。 坐标换算统一走 eve::grid(支持 rectang...
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
Renderer-neutral occupancy grid rebuilt from an ArchSpace level.
GID palette written into a TileLayer by TileMapProjector.