22#include <unordered_map>
29class IResourceAccount;
75 void setLogicalRect(
float x,
float y,
float width,
float height);
77 void setPlane(
float ox,
float oy,
float oz,
float ux,
float uy,
float uz,
78 float vx,
float vy,
float vz);
80 bool mapRay(
float ox,
float oy,
float oz,
float dx,
float dy,
float dz);
82 bool mapLayout(
float x,
float y);
95 [[nodiscard]]
eve::Result<void> mapCardPose(
float x,
float y,
float layoutAngleDeg,
float flipProgress,
96 float liftPeak,
int flipAxis);
129 glm::vec3 origin_{0.f};
130 glm::vec3 axisU_{1.f, 0.f, 0.f};
131 glm::vec3 axisV_{0.f, 0.f, 1.f};
132 glm::vec3 resultWorld_{0.f};
133 glm::vec3 resultBasisU_{1.f, 0.f, 0.f};
134 glm::vec3 resultBasisV_{0.f, 0.f, 1.f};
135 glm::vec3 resultBasisN_{0.f, 1.f, 0.f};
136 float logicalX_ = 0.f;
137 float logicalY_ = 0.f;
138 float logicalWidth_ = 1.f;
139 float logicalHeight_ = 1.f;
140 float resultLogicalX_ = 0.f;
141 float resultLogicalY_ = 0.f;
142 bool resultShowingFront_ =
true;
169 int registerCardsFromJson(const
std::
string &json);
171 void clearCardDefinitions();
173 int getCardDefinitionCount();
178 std::
string getCardDefinitionId(
int index) const;
180 bool hasCardDefinition(const
std::
string &
id);
193 bool setCardDefinition(const
std::
string &
id, const
std::
string &
name, const
std::
string &
kind,
194 int cost,
int attack,
int health,
float tintR,
float tintG,
float tintB);
199 bool removeCardDefinition(const
std::
string &
id);
207 std::
string getCardDefinitionName(const
std::
string &
id);
209 std::
string getCardDefinitionKind(const
std::
string &
id);
211 int getCardDefinitionCost(const
std::
string &
id);
213 int getCardDefinitionAttack(const
std::
string &
id);
215 int getCardDefinitionHealth(const
std::
string &
id);
217 float getCardDefinitionTintR(const
std::
string &
id);
219 float getCardDefinitionTintG(const
std::
string &
id);
221 float getCardDefinitionTintB(const
std::
string &
id);
230 Zone *newZone(const
std::
string &
id, const
std::
string &
label,
float x,
float y,
float w,
float h);
241 int handCount() const;
247 int zoneCount() const;
251 Deck *getDeck() const;
330 std::string transactionId = {});
333 int capturePresentation();
335 int getPresentationCount()
const;
337 CardPresentationSnapshot *getPresentation(
int index);
340 void update(
float dt,
float mx,
float my,
bool down);
342 void render(graphics::Graphics *gfx);
344 void renderDeck(graphics::Graphics *gfx);
373 void clearGameplayControls();
375 [[nodiscard]]
int gameplayControlCount()
const;
377 [[nodiscard]] std::vector<std::string> gameplayInstances()
const;
381 std::unique_ptr<CardControl> gameplay_;
384 void beginTargeting(
const std::string &
sourceId,
float x,
float y);
386 void updateTargeting(
float x,
float y,
const std::string &
targetId,
bool valid);
388 void cancelTargeting();
392 bool isTargeting()
const {
return targetingActive_; }
394 bool isTargetValid()
const {
return targetingValid_; }
396 std::string getTargetSource()
const {
return targetingSource_; }
398 std::string getTargetId()
const {
return targetingId_; }
402 int getEventCount()
const;
403 std::string getEventType(
int index)
const;
404 std::string getEventHand(
int index)
const;
405 std::string getEventZone(
int index)
const;
406 std::string getEventCardId(
int index)
const;
407 std::string getEventReason(
int index)
const;
410 const CardDefinition *findDef(
const std::string &
id)
const;
412 std::unordered_map<std::string, CardDefinition> defs_;
413 mutable std::vector<std::string> definitionView_;
414 mutable bool definitionViewDirty_ =
true;
415 std::vector<std::unique_ptr<LayoutConfig>> configs_;
416 std::vector<std::unique_ptr<CardPlaneMapper>> planeMappers_;
417 std::vector<CardEvent> events_;
418 std::vector<ecs::EntityHandle> cards_;
419 std::vector<ecs::EntityHandle> decks_;
420 std::vector<ecs::EntityHandle> zones_;
421 std::vector<ecs::EntityHandle> hands_;
422 std::vector<CardPresentationSnapshot> presentation_;
424 LayoutConfig *activeConfig_ =
nullptr;
425 Deck *activeDeck_ =
nullptr;
426 int nextInstance_ = 1;
427 bool builtInVisuals_ =
true;
428 bool targetingActive_ =
false;
429 bool targetingValid_ =
false;
430 float targetingStartX_ = 0.f;
431 float targetingStartY_ = 0.f;
432 float targetingX_ = 0.f;
433 float targetingY_ = 0.f;
434 std::string targetingSource_;
435 std::string targetingId_;
Card Play adapter for the renderer-independent decision protocol.
eve::resource::CostSpec cost
eve::resource::IResourceAccount * account
EnvironmentTest definition
#define EVENGINE_API_WORLD
std::shared_ptr< OceanGpuSpectrum > owner
Move-only, checked operation results for the common layer.
EVENGINE_API_FOUNDATION public API.
Move-only operation result carrying either a value or Status.
Strong, domain-neutral reference to a runtime subject.
单张卡牌:ECS 实体,数据拆成 Identity / Stats / Visual / Layout / State。
Maps a logical card canvas to a 3D parallelogram without depending on graphics.
float getBasisUX() const
Local card right axis after layout rotation and flip (world space).
float getBasisUY() const
Basis U Y.
float getBasisNZ() const
Basis N Z.
float getWorldZ() const
Return the most recently mapped world Z coordinate.
float getBasisNX() const
Card facing normal after flip (world space).
float getBasisVZ() const
Basis V Z.
float getLogicalY() const
Return the most recently mapped logical Y coordinate.
float getWorldY() const
Return the most recently mapped world Y coordinate.
float getBasisVX() const
Local card up axis after layout rotation and flip (world space).
bool isShowingFront() const
Whether the most recent mapCardPose should bind the front face.
float getBasisNY() const
Basis N Y.
float getBasisUZ() const
Basis U Z.
float getBasisVY() const
Basis V Y.
float getLogicalX() const
Return the most recently mapped logical X coordinate.
float getWorldX() const
Return the most recently mapped world X coordinate.
卡牌模块入口(eve.Card):定义注册、对象工厂与每帧 update/render。
Card()
Declared out of line so the incomplete CardControl member needs no deleter here.
void setBuiltInVisuals(bool enabled)
Enable or disable the built-in card visuals while retaining layout and interaction.
Card & operator=(const Card &)=delete
bool getBuiltInVisuals() const
Return whether Card::render draws the built-in card faces.
Card(Card &&) noexcept
Card.
Card(const Card &)=delete
手牌:扇形布局 + 悬浮 + 拖拽 + 落区判定 + 渲染。
落牌区(手牌区 / 出牌区 / 弃牌区),用于拖放命中判定。
Provider-neutral resource account contract.
Single-use composition of domain participants and one payer's costs. Owns staged participants,...
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Build metadata (engine git commit, build time, third-party version).
One deterministic fixed-step emitted by SimulationClock.
Strong card definition projected into the common effect definition.
Optional cross-domain operations that belong to one card play.
Read-only extension points used while evaluating a card play.
Immutable presentation data captured from one card for external 2D/3D adapters.
bool faceUp
Effective face target after hand faceDown/peek resolution.
float flipLift
Lift above the resting plane/layout at the current flip pose.
float flip
Animated face-down progress in [0, 1] (0 = up, 1 = down).
float flipAngle
Flip rotation about the configured hinge, in degrees (0..180).
int flipAxis
Hinge used to produce this pose: 0 = vertical, 1 = horizontal.
bool showingFront
Which face texture to bind right now (swaps at the edge-on pinch).
float flipAxisScale
Absolute cosine foreshortening for the hinge axis (0 at edge-on).
UiCard 风格的布局配置(脚本可实时修改,对应 UiCard 的 Configs 面板)。