载入中...
搜索中...
未找到
VehicleAttributes.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
11
12#include <string>
13#include <string_view>
14
15namespace eve::vehicle {
16
17class VehicleEntity;
18
27public:
28 static constexpr std::string_view healthAttribute = "health";
29 static constexpr std::string_view maxHealthAttribute = "max_health";
30 static constexpr std::string_view armorAttribute = "armor";
31
33 [[nodiscard]] static eve::Result<void> ensure(VehicleEntity& vehicle);
34
36 [[nodiscard]] static eve::Result<double> read(VehicleEntity& vehicle, std::string_view attribute);
37
39 [[nodiscard]] static eve::Result<void> setBase(VehicleEntity& vehicle, std::string_view attribute, double value);
40
42 [[nodiscard]] static eve::Result<eve::attributes::ModifierId> addModifier(
43 VehicleEntity& vehicle, std::string id, std::string_view attribute, std::string source,
45 eve::attributes::ModifierPriority priority = eve::attributes::priority::runtime);
46
48 [[nodiscard]] static eve::Result<void> project(VehicleEntity& vehicle);
49
52
54 [[nodiscard]] static eve::Result<void> restore(VehicleEntity& vehicle,
56 eve::Revision expectedRevision);
57};
58
59} // namespace eve::vehicle
ActionParameterOperation operation
double value
Owner-aware canonical attribute state shared by gameplay adapters.
int priority
#define EVENGINE_API_DOMAINS
Definition Export.h:110
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Adapts VehicleEntity health and armor to the common attribute core.
载具实体:数据全部在组件里,行为在 VehicleSystem。
AttributeOperation
Built-in calculation operation for an attribute modifier.
std::int32_t ModifierPriority
驾驶者接口与玩家控制状态。
Transaction-safe snapshot of selected attributes and their modifiers.