MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetBattleCommand

Method GetBattleCommand

src/game_actor.cpp:930–942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928}
929
930const lcf::rpg::BattleCommand* Game_Actor::GetBattleCommand(int idx) const {
931 Span<const int32_t> commands;
932 if (data.changed_battle_commands) {
933 commands = data.battle_commands;
934 } else if (dbActor) {
935 commands = dbActor->battle_commands;
936 }
937 int cmd_id = 0;
938 if (idx >= 0 && idx < static_cast<int>(commands.size())) {
939 cmd_id = commands[idx];
940 }
941 return lcf::ReaderUtil::GetElement(lcf::Data::battlecommands.commands, cmd_id);
942}
943
944const std::vector<const lcf::rpg::BattleCommand*> Game_Actor::GetBattleCommands() const {
945 std::vector<const lcf::rpg::BattleCommand*> commands;

Callers 2

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected