mitiru::game

Namespace catalog extracted from docs/API_CATALOG.md (50 types, 286 items).

Namespace catalog extracted from docs/API_CATALOG.md (50 types, 286 items).

NameKindItems
CollisionResponseenum3
TileTypeenum4
Vec2fstruct5
AABBstruct10
Tilemapstruct7
TilemapCollisionResultstruct4
TilemapColliderclass1
PlatformerInputstruct3
PlatformerConfigstruct10
PlatformerStatestruct8
PlatformerPhysicsclass1
HitResultstruct6
Hitboxstruct6
HitboxSystemclass7
Elementenum8
TargetTypeenum3
EquipSlotenum3
BattleActionTypeenum5
BattlePhaseenum6
StatusEffectenum8
Statstruct5
CharacterStatsstruct11
Skillstruct7
StatBonusesstruct6
Equipmentstruct5
Inventorystruct6
BattleActionstruct4
DamageResultstruct4
DamageCalculatorclass1
TurnEntrystruct3
TurnOrderCalculatorclass1
BattleStatestruct11
TerrainTypeenum6
HexCubestruct5
HexOffsetstruct4
HexCoordUtilstruct3
HexCellstruct5
HexGridclass11
TurnManagerclass7
PathfinderHexclass2
GameModeenum2
GameplayTypeenum5
VNCommandTypeenum11
SharedStatestruct11
VNChoicestruct3
VNCommandstruct5
VNScriptstruct4
GameplayTriggerstruct4
VNTriggerstruct3
HybridGameManagerclass23
enum CollisionResponse 3
Slide
Stop
Bounce
enum TileType : std::uint8_t 4
Empty = 0
Solid
OneWay
Slope
struct Vec2f 5
float x = 0.0f
float y = 0.0f
Vec2f operator+(const Vec2f& o) const noexcept
Vec2f operator-(const Vec2f& o) const noexcept
Vec2f operator*(float s) const noexcept
struct AABB 10
float x = 0.0f
float y = 0.0f
float width = 0.0f
float height = 0.0f
[[nodiscard]] float left() const noexcept
[[nodiscard]] float right() const noexcept
[[nodiscard]] float top() const noexcept
[[nodiscard]] float bottom() const noexcept
[[nodiscard]] Vec2f center() const noexcept
[[nodiscard]] bool overlaps(const AABB& other) const noexcept
struct Tilemap 7
int width = 0
int height = 0
float tileSize = 16.0f
std::vector<TileType> tiles
[[nodiscard]] TileType getTile(int col, int row) const noexcept
[[nodiscard]] int worldToCol(float wx) const noexcept
[[nodiscard]] int worldToRow(float wy) const noexcept
struct TilemapCollisionResult 4
Vec2f resolvedPosition
Vec2f resolvedVelocity
bool collidedX = false
bool collidedY = false
class TilemapCollider 1
[[nodiscard]] static TilemapCollisionResult resolve( const AABB& aabb, const Vec2f& velocity, const Tilemap& tilemap, float dt, CollisionResponse response = CollisionResponse::Slide, float bounceFactor = 0.5f) noexcept
struct PlatformerInput 3
float moveX = 0.0f
bool jump = false
bool jumpHeld = false
struct PlatformerConfig 10
float gravity = 980.0f
float jumpForce = 400.0f
float maxFallSpeed = 600.0f
float coyoteTime = 0.1f
float jumpBufferTime = 0.12f
float wallSlideSpeed = 80.0f
float airControl = 0.6f
float moveSpeed = 200.0f
float wallJumpForceX = 300.0f
float wallJumpForceY = 380.0f
struct PlatformerState 8
bool grounded = false
bool onWall = false
int wallDirection = 0
bool jumping = false
Vec2f velocity
Vec2f position
float coyoteTimer = 0.0f
float jumpBufferTimer = 0.0f
class PlatformerPhysics 1
[[nodiscard]] static PlatformerState update( float dt, const PlatformerInput& input, const Tilemap& tilemap, const Vec2f& aabbSize, const PlatformerState& state, const PlatformerConfig& config = {}) noexcept
struct HitResult 6
std::uint32_t attackerOwnerId = 0
std::uint32_t defenderOwnerId = 0
std::uint32_t attackerHitboxIdx = 0
std::uint32_t defenderHitboxIdx = 0
float damage = 0.0f
Vec2f knockback
struct Hitbox 6
std::uint32_t ownerId = 0
AABB rect
std::uint32_t layer = 0
bool active = true
float damage = 0.0f
Vec2f knockback
class HitboxSystem 7
std::uint32_t registerHitbox(const Hitbox& hitbox)
[[nodiscard]] Hitbox* getHitbox(std::uint32_t index) noexcept
[[nodiscard]] std::vector<HitResult> checkOverlaps() const
void setHitCallback(std::function<void(const HitResult&)> callback)
void processOverlaps()
void clear()
[[nodiscard]] std::size_t count() const noexcept
enum Element : std::uint8_t 8
None = 0
Fire
Ice
Thunder
Wind
Earth
Light
Dark
enum TargetType : std::uint8_t 3
Single
All
Self
enum EquipSlot : std::uint8_t 3
Weapon
Armor
Accessory
enum BattleActionType : std::uint8_t 5
Attack
Skill
Item
Defend
Flee
enum BattlePhase : std::uint8_t 6
Start
PlayerTurn
EnemyTurn
Animation
Victory
Defeat
enum StatusEffect : std::uint8_t 8
None = 0
Poison
Paralysis
Sleep
AtkUp
DefUp
AtkDown
DefDown
struct Stat 5
float base = 0.0f
float modifier = 0.0f
float max = 999.0f
float current = 0.0f
[[nodiscard]] float effective() const noexcept
struct CharacterStats 11
Stat hp
Stat mp
Stat atk
Stat def
Stat spd
Stat luk
int level = 1
int exp = 0
std::string name
Element weakness = Element::None
std::vector<StatusEffect> statusEffects
struct Skill 7
std::uint32_t id = 0
std::string name
float mpCost = 0.0f
float basePower = 1.0f
Element element = Element::None
TargetType targetType = TargetType::Single
std::vector<StatusEffect> effects
struct StatBonuses 6
float hp = 0.0f
float mp = 0.0f
float atk = 0.0f
float def = 0.0f
float spd = 0.0f
float luk = 0.0f
struct Equipment 5
std::uint32_t id = 0
std::string name
EquipSlot slot = EquipSlot::Weapon
StatBonuses bonuses
Element element = Element::None
struct Inventory 6
std::map<std::uint32_t, int> items
int maxSlots = 99
[[nodiscard]] bool addItem(std::uint32_t itemId, int count = 1)
[[nodiscard]] bool removeItem(std::uint32_t itemId, int count = 1)
[[nodiscard]] bool hasItem(std::uint32_t itemId, int count = 1) const
[[nodiscard]] int getCount(std::uint32_t itemId) const
struct BattleAction 4
BattleActionType type = BattleActionType::Attack
int targetIndex = 0
std::uint32_t skillId = 0
std::uint32_t itemId = 0
struct DamageResult 4
float damage = 0.0f
bool critical = false
float elementMultiplier = 1.0f
bool missed = false
class DamageCalculator 1
[[nodiscard]] static DamageResult calculate( const CharacterStats& attacker, const CharacterStats& defender, const Skill& skill, std::uint32_t seed = 0)
struct TurnEntry 3
int index = 0
bool isEnemy = false
float speed = 0.0f
class TurnOrderCalculator 1
[[nodiscard]] static std::vector<TurnEntry> calculateOrder( const std::vector<CharacterStats>& party, const std::vector<CharacterStats>& enemies)
struct BattleState 11
BattlePhase phase = BattlePhase::Start
std::vector<TurnEntry> turnOrder
int currentActorIndex = 0
int turnCount = 0
std::vector<CharacterStats> party
std::vector<CharacterStats> enemies
[[nodiscard]] const TurnEntry* currentActor() const noexcept
void advanceTurn()
void beginBattle()
[[nodiscard]] bool isPartyDefeated() const noexcept
[[nodiscard]] bool isEnemiesDefeated() const noexcept
enum TerrainType : std::uint8_t 6
Plain = 0
Forest
Mountain
Water
Road
[[nodiscard]] inline float terrainMoveCost(TerrainType terrain) noexcept
struct HexCube 5
int q = 0
int r = 0
int s = 0
bool operator==(const HexCube& o) const noexcept
bool operator!=(const HexCube& o) const noexcept
struct HexOffset 4
int col = 0
int row = 0
bool operator==(const HexOffset& o) const noexcept
bool operator!=(const HexOffset& o) const noexcept
struct HexCoordUtil 3
[[nodiscard]] static HexCube offsetToCube(const HexOffset& offset) noexcept
[[nodiscard]] static HexOffset cubeToOffset(const HexCube& cube) noexcept
[[nodiscard]] static int cubeDistance(const HexCube& a, const HexCube& b) noexcept
struct HexCell 5
int q = 0
int r = 0
TerrainType terrain = TerrainType::Plain
std::uint32_t occupant = 0
float moveCost = 1.0f
class HexGrid 11
HexGrid(int width, int height)
HexGrid() = default
[[nodiscard]] int width() const noexcept
[[nodiscard]] int height() const noexcept
[[nodiscard]] HexCell* getCell(int col, int row) noexcept
[[nodiscard]] const HexCell* getCell(int col, int row) const noexcept
[[nodiscard]] bool isValid(int col, int row) const noexcept
[[nodiscard]] int hexDistance(const HexOffset& a, const HexOffset& b) const noexcept
[[nodiscard]] std::vector<HexCell*> hexNeighbors(int col, int row) noexcept
[[nodiscard]] std::vector<const HexCell*> hexLine(const HexOffset& from, const HexOffset& to) const
[[nodiscard]] std::vector<const HexCell*> hexRing(const HexOffset& center, int radius) const
class TurnManager 7
void setPlayers(std::vector<std::uint32_t> playerIds)
[[nodiscard]] std::uint32_t currentPlayer() const noexcept
[[nodiscard]] int currentTurn() const noexcept
void nextTurn()
[[nodiscard]] bool isGameOver() const noexcept
void setGameOver() noexcept
[[nodiscard]] const std::vector<std::uint32_t>& playerOrder() const noexcept
class PathfinderHex 2
[[nodiscard]] static std::vector<const HexCell*> findPath( const HexGrid& grid, const HexOffset& from, const HexOffset& to, float maxMovePoints)
[[nodiscard]] static std::vector<const HexCell*> getReachableCells( const HexGrid& grid, const HexOffset& from, float movePoints)
enum GameMode : std::uint8_t 2
VN
Gameplay
enum GameplayType : std::uint8_t 5
Battle
Minigame
Puzzle
Explore
Custom
enum VNCommandType : std::uint8_t 11
Dialogue
Choice
SetFlag
Jump
Gameplay
Wait
Background
Character
BGM
SE
using FlagValue = std::variant<bool, int, float, std::string>;
struct SharedState 11
std::map<std::string, FlagValue> flags
std::map<std::uint32_t, int> inventory
std::map<std::string, float> stats
void setFlag(const std::string& key, FlagValue value)
template <typename T> [[nodiscard]] T getFlag(const std::string& key, const T& defaultValue = {}) const
[[nodiscard]] bool hasFlag(const std::string& key) const
void addItem(std::uint32_t itemId, int count = 1)
[[nodiscard]] bool removeItem(std::uint32_t itemId, int count = 1)
[[nodiscard]] bool hasItem(std::uint32_t itemId, int count = 1) const
void setStat(const std::string& key, float value)
[[nodiscard]] float getStat(const std::string& key, float defaultValue = 0.0f) const
struct VNChoice 3
std::string text
std::string jumpLabel
std::function<bool()> condition
struct VNCommand 5
VNCommandType type = VNCommandType::Dialogue
std::string speaker
std::string text
std::vector<VNChoice> choices
std::map<std::string, std::string> params
struct VNScript 4
std::vector<VNCommand> commands
std::map<std::string, std::size_t> labels
void addCommand(VNCommand cmd)
void setLabel(const std::string& name)
struct GameplayTrigger 4
std::string gameplayId
std::map<std::string, std::string> params
GameplayType type = GameplayType::Battle
std::function<bool(const SharedState&)> condition
struct VNTrigger 3
std::string eventId
std::string scriptLabel
std::function<bool(const SharedState&)> condition
class HybridGameManager 23
HybridGameManager() = default
void enterVNMode()
void enterGameplayMode(GameplayType type = GameplayType::Battle)
void returnToPreviousMode()
[[nodiscard]] bool isInVNMode() const noexcept
[[nodiscard]] bool isInGameplayMode() const noexcept
[[nodiscard]] GameMode currentMode() const noexcept
[[nodiscard]] GameplayType currentGameplayType() const noexcept
[[nodiscard]] SharedState& sharedState() noexcept
[[nodiscard]] const SharedState& sharedState() const noexcept
void setFlag(const std::string& key, FlagValue value)
template <typename T> [[nodiscard]] T getFlag(const std::string& key, const T& defaultValue = {}) const
void setScript(VNScript script)
[[nodiscard]] const VNCommand* currentCommand() const noexcept
bool advanceScript()
void selectChoice(int choiceIndex)
void returnToScript()
void addGameplayTrigger(GameplayTrigger trigger)
void addVNTrigger(VNTrigger trigger)
[[nodiscard]] const GameplayTrigger* evaluateGameplayTriggers() const
[[nodiscard]] const VNTrigger* evaluateVNTriggers() const
bool processAutoTriggers()
void setOnModeChange(std::function<void(GameMode)> callback)

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.