载入中...
搜索中...
未找到
eve::card::Card类 参考
卡牌模块入口(eve.Card):定义注册、对象工厂与每帧 update/render。 更多...
#include <Card.h>
类 eve::card::Card 继承关系图:
Public 成员函数 | |
| Module_REG (Card) | |
| Card ()=default | |
| ~Card () override | |
| int | registerCardsFromJson (const std::string &json) |
| 从 JSON 注册卡牌类型;返回成功注册数量。 | |
| void | clearCardDefinitions () |
| 清空全部卡牌类型定义。 | |
| int | getCardDefinitionCount () |
| 已注册卡牌类型数量。 | |
| bool | hasCardDefinition (const std::string &id) |
| 卡牌类型查询。 | |
| std::string | getCardDefinitionName (const std::string &id) |
| std::string | getCardDefinitionKind (const std::string &id) |
| int | getCardDefinitionCost (const std::string &id) |
| int | getCardDefinitionAttack (const std::string &id) |
| int | getCardDefinitionHealth (const std::string &id) |
| float | getCardDefinitionTintR (const std::string &id) |
| float | getCardDefinitionTintG (const std::string &id) |
| float | getCardDefinitionTintB (const std::string &id) |
| LayoutConfig * | newConfig () |
| 工厂:对象由 ECS 表持有,脚本持有的是非拥有句柄。 | |
| CardData * | newCard (const std::string &defId) |
| Deck * | newDeck () |
| Zone * | newZone (const std::string &id, const std::string &label, float x, float y, float w, float h) |
| 创建一个落牌区。 | |
| Hand * | newHand (LayoutConfig *cfg) |
| 创建一个手牌布局。 | |
| void | setConfig (LayoutConfig *cfg) |
| 游戏状态:当前布局、手牌、落牌区、牌库。 | |
| LayoutConfig * | getConfig () const |
| int | handCount () const |
| Hand * | getHand (int index) const |
| Hand * | findHand (const std::string &owner) const |
| int | zoneCount () const |
| Zone * | getZone (int index) const |
| Deck * | getDeck () const |
| CardData * | drawCard (const std::string &handOwner) |
| 从牌库抽一张牌加入指定手牌;无牌时返回 nullptr。 | |
| void | update (float dt, float mx, float my, bool down) |
| 每帧更新布局与交互。 | |
| void | render (graphics::Graphics *gfx) |
| 绘制手牌/落牌区(与牌库)。 | |
| void | renderDeck (graphics::Graphics *gfx) |
| void | clearEvents () |
| 交互事件队列(抽牌/出牌/拖拽等)。 | |
| int | getEventCount () const |
| std::string | getEventType (int index) const |
| std::string | getEventHand (int index) const |
| std::string | getEventZone (int index) const |
| std::string | getEventCardId (int index) const |
| std::string | getEventReason (int index) const |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
构造及析构函数说明
◆ Card()
|
default |
◆ ~Card()
成员函数说明
◆ clearCardDefinitions()
◆ clearEvents()
◆ drawCard()
| CardData * eve::card::Card::drawCard | ( | const std::string & | handOwner | ) |
从牌库抽一张牌加入指定手牌;无牌时返回 nullptr。
引用了 c, eve::card::Deck, eve::card::LayoutConfig::deckX, eve::card::LayoutConfig::deckY, eve::card::Deck::draw(), findHand() , 以及 h.
◆ findHand()
| Hand * eve::card::Card::findHand | ( | const std::string & | owner | ) | const |
◆ getCardDefinitionAttack()
| int eve::card::Card::getCardDefinitionAttack | ( | const std::string & | id | ) |
◆ getCardDefinitionCost()
◆ getCardDefinitionCount()
◆ getCardDefinitionHealth()
| int eve::card::Card::getCardDefinitionHealth | ( | const std::string & | id | ) |
◆ getCardDefinitionKind()
| std::string eve::card::Card::getCardDefinitionKind | ( | const std::string & | id | ) |
◆ getCardDefinitionName()
| std::string eve::card::Card::getCardDefinitionName | ( | const std::string & | id | ) |
◆ getCardDefinitionTintB()
| float eve::card::Card::getCardDefinitionTintB | ( | const std::string & | id | ) |
◆ getCardDefinitionTintG()
| float eve::card::Card::getCardDefinitionTintG | ( | const std::string & | id | ) |
◆ getCardDefinitionTintR()
| float eve::card::Card::getCardDefinitionTintR | ( | const std::string & | id | ) |
◆ getConfig()
| LayoutConfig * eve::card::Card::getConfig | ( | ) | const |
◆ getDeck()
◆ getEventCardId()
◆ getEventCount()
◆ getEventHand()
◆ getEventReason()
◆ getEventType()
◆ getEventZone()
◆ getHand()
◆ getZone()
◆ handCount()
◆ hasCardDefinition()
◆ Module_REG()
| eve::card::Card::Module_REG | ( | Card | ) |
◆ newCard()
| CardData * eve::card::Card::newCard | ( | const std::string & | defId | ) |
引用了 c, eve::card::CardData::createCard() , 以及 d.
◆ newConfig()
| LayoutConfig * eve::card::Card::newConfig | ( | ) |
◆ newDeck()
| Deck * eve::card::Card::newDeck | ( | ) |
引用了 eve::card::Deck::createDeck() , 以及 d.
◆ newHand()
| Hand * eve::card::Card::newHand | ( | LayoutConfig * | cfg | ) |
◆ newZone()
| Zone * eve::card::Card::newZone | ( | const std::string & | id, |
| const std::string & | label, | ||
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h | ||
| ) |
◆ registerCardsFromJson()
| int eve::card::Card::registerCardsFromJson | ( | const std::string & | json | ) |
从 JSON 注册卡牌类型;返回成功注册数量。
引用了 n, eve::json::Document::parse(), eve::json::Document::root() , 以及 eve::json::Document::valid().
◆ render()
| void eve::card::Card::render | ( | graphics::Graphics * | gfx | ) |
◆ renderDeck()
| void eve::card::Card::renderDeck | ( | graphics::Graphics * | gfx | ) |
◆ setConfig()
| void eve::card::Card::setConfig | ( | LayoutConfig * | cfg | ) |
◆ update()
| void eve::card::Card::update | ( | float | dt, |
| float | mx, | ||
| float | my, | ||
| bool | down | ||
| ) |
◆ zoneCount()
该类的文档由以下文件生成:
Public 成员函数 继承自