载入中...
搜索中...
未找到
ArchSpaceHd2dProjector.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
5#include "common/Result.h"
6#include "hd2d/Hd2d.h"
7
8#include <cstdint>
9#include <string>
10
11namespace eve::graphics {
12class Graphics;
13class Mesh;
14class Renderable3D;
15} // namespace eve::graphics
16
17namespace eve::archspace_hd2d {
18
31public:
32 Hd2dSpaceProjector() = default;
35 ~Hd2dSpaceProjector() override = default;
36
42 [[nodiscard]] const char* kind() const noexcept override { return "hd2d"; }
43
45 void setLevelId(std::string levelId);
47 void setCellSize(float cellSize);
51 void setSideDepth(float depth);
53 void setHeightScale(float scale);
54
59 void setLayer(map::TileLayer* layer);
60
61 [[nodiscard]] eve::Result<void> sync(const archspace::Document& document, std::uint64_t revision) override;
62 void clear() override;
63
69 [[nodiscard]] archspace_map::TileMapProjector& tiles() noexcept { return tiles_; }
70 [[nodiscard]] const archspace_map::TileMapProjector& tiles() const noexcept { return tiles_; }
71
78 [[nodiscard]] eve::Result<graphics::Mesh*> buildMesh(graphics::Graphics* gfx);
79
84 [[nodiscard]] eve::Result<graphics::Renderable3D*> buildRenderable(graphics::Graphics* gfx);
85
87 [[nodiscard]] int lastTileCount() const noexcept { return lastTileCount_; }
88
90 [[nodiscard]] std::uint64_t revision() const noexcept { return tiles_.revision(); }
91
92private:
94 hd2d::TileMap3D builder_{};
95 int lastTileCount_ = 0;
96};
97
98} // namespace eve::archspace_hd2d
std::uint64_t revision
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::string palette
std::array< float, 3 > scale
TileLayer * layer
Move-only, checked operation results for the common layer.
std::uint32_t depth
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Authoritative ArchSpace document (Pascal-like node graph).
Presentation adapter contract for ArchSpace documents.
Projects an ArchSpace level onto a TileLayer and HD-2D TileMap3D bake path.
const char * kind() const noexcept override
Stable projector kind. @ownership Non-owning pointer to a static string literal; do not free....
archspace_map::TileMapProjector & tiles() noexcept
Underlying tile projector (grid + TileLayer). @ownership Borrowed from this projector; do not free....
Hd2dSpaceProjector(const Hd2dSpaceProjector &)=delete
Hd2dSpaceProjector & operator=(const Hd2dSpaceProjector &)=delete
int lastTileCount() const noexcept
Tile count from the last successful buildMesh/buildRenderable; 0 otherwise.
std::uint64_t revision() const noexcept
Revision last successfully synced.
const archspace_map::TileMapProjector & tiles() const noexcept
Projects an ArchSpace level onto a map::TileLayer (orthogonal or isometric).
Extrudes a 2D tile layer into a 3D terrain mesh (HD-2D ground).
Definition Hd2d.h:56
ECS tile layer entity. Script mutates tile GIDs / tileset / draw; TileRenderSystem batch-draws atlas ...
Definition TileLayer.h:33
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
GID palette written into a TileLayer by TileMapProjector.