载入中...
搜索中...
未找到
BuildingSnapshot.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include <cstdint>
5#include <map>
6#include <string>
7#include <vector>
9#include "common/Result.h"
10#include "common/Value.h"
11
12namespace eve::building {
13struct PlacedBuilding;
14struct EdgeCurveGroup;
17 std::string id;
18 std::string type;
19 std::vector<std::string> tags;
20};
21
24 int instanceId = 0;
25 std::string buildingId;
27 std::string placementKind = "cell";
29 int edgeX = 0;
30 int edgeY = 0;
32 std::string edgeAxis = "horizontal";
34 int cornerX = 0;
35 int cornerY = 0;
37 double freeRadius = 0.0;
39 double freeHalfWidth = 0.0;
41 double freeHalfHeight = 0.0;
43 std::vector<double> freeFootprintVertices;
44 int cellX = 0;
45 int cellY = 0;
47 int level = 0;
48 double worldX = 0.0;
49 double worldY = 0.0;
50 double elevation = 0.0;
52 std::string surfaceId;
54 std::uint64_t surfaceRevision = 0;
56 double surfaceNormalX = 0.0;
57 double surfaceNormalY = 1.0;
58 double surfaceNormalZ = 0.0;
60 double surfaceTangentX = 1.0;
61 double surfaceTangentY = 0.0;
62 double surfaceTangentZ = 0.0;
68 double surfaceHeightDelta = 0.0;
69 double rotationDegrees = 0.0;
70 std::string channel;
71 std::map<std::string, std::string> properties;
72 std::vector<std::string> tags;
73 std::vector<BuildingGarrisonMemberRecord> garrison;
74 std::uint64_t garrisonRevision = 0;
75};
76
77
78namespace codec {
82 std::vector<BuildingInstanceSnapshot> instances;
83};
84
87 const std::vector<BuildingInstanceSnapshot>& instances);
90
101} // namespace codec
102} // namespace eve::building
#define EVENGINE_API_WORLD
Definition Export.h:109
Snapshot snapshot
Object::Ptr value
Move-only, checked operation results for the common layer.
AbilityActivationGroup group
bool placed
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
EVENGINE_API_FOUNDATION public API.
Definition Json.h:39
Result< EdgeCurvePayload > parseEdgeCurve(const Value &value)
Decode one complete curve with structured failure and independent ownership.
Result< std::vector< BuildingInstanceSnapshot > > parseInstances(const Value &value)
Decode a nonempty instance batch with unique identities; pure owning result.
Result< BuildingInstanceSnapshot > parseInstance(const Value &value)
Decode legacy/current instance fields without mutating a world; owning result.
Value edgeCurveValue(const building::EdgeCurveGroup &group, const std::vector< BuildingInstanceSnapshot > &instances)
Encode one complete curve group in linear time; no world mutation.
Value instanceValue(const BuildingInstanceSnapshot &instance)
Encode a complete owning instance; pure, caller-thread, linear in instance metadata.
建筑放置模块入口:定义 / 放置世界 / 鬼影 / 变更事件的脚本绑定点。 设计文档:docs/dev/建筑放置系统设计.md
Definition Building.cpp:10
Persistent garrison member copied through building editor undo.
Complete runtime-neutral placed-building snapshot.
std::string placementKind
Placement coordinate domain: cell, edge, corner, or free.
int surfaceSampleCount
Number of footprint surface samples represented by this snapshot.
double surfaceNormalX
Captured unit surface normal.
std::uint64_t surfaceRevision
Surface provider revision captured at placement time.
std::string surfaceId
Stable surface provider identity captured at placement time.
int edgeX
Canonical edge origin when placementKind is edge.
std::map< std::string, std::string > properties
double freeHalfHeight
Committed free-domain OBB half height; zero denotes circular collision.
std::string edgeAxis
Canonical edge axis: horizontal or vertical.
double surfaceMaxSlopeDegrees
Maximum sampled footprint slope in degrees.
int level
Authoritative discrete floor coordinate.
std::vector< double > freeFootprintVertices
Committed convex local polygon as world-plane x/y pairs.
double freeRadius
Committed free-domain collision radius in world-plane units.
double surfaceTangentX
Captured unit surface tangent.
double surfaceHeightDelta
Sampled footprint height range.
double freeHalfWidth
Committed free-domain OBB half width; zero denotes circular collision.
int cornerX
Grid vertex address when placementKind is corner.
std::vector< BuildingGarrisonMemberRecord > garrison
World-owned authoritative description and membership of one committed edge curve.
已放置的建筑实例。
Owning curve group and all exact members, shared by runtime and editor persistence.
std::vector< BuildingInstanceSnapshot > instances