Files
donnyandClaude Fable 5.1 26f9baf9b4 core: import the rules core (ygopro-core 973672dc + fork patches)
The vendored ocgcore from the Unity repo (Tools/YGOLegacy/ocgcore at dev
HEAD). Upstream is nanahira/ygopro-core at 973672dc9ce7cb49f47173277ab1ad0e318b7593;
the seven files that differ from it carry the fork's core patches, already
applied: 0001 face-down Token setcode, 0004 effect damage step outside a
chain, 0008 Sandbox god mode, 0015 tag first seat holds the hand, 0022
attack preview, 0024 attack preview legality. Generated build/ output is
left out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:16 -07:00

36 lines
883 B
C++

#ifndef LUA_COVERAGE_H_
#define LUA_COVERAGE_H_
#include <cstdint>
#include <string>
#include <unordered_map>
#include <lua.h>
#include "common.h"
struct lua_coverage_file {
std::string name;
std::unordered_map<int32_t, uint32_t> line_hits;
};
class lua_coverage_state {
public:
bool enabled{};
std::unordered_map<std::string, lua_coverage_file> files;
static std::string normalize_name(const char* source);
static void line_hook(lua_State* L, lua_Debug* ar);
void enable(lua_State* L);
void install_hook(lua_State* L) const;
void record(const char* source, int32_t line);
void clear(const char* name);
void clear_all();
int32_t get_dump_size(const char* name) const;
int32_t dump(const char* name, byte* out_buf, int32_t out_len) const;
int32_t get_all_dump_size() const;
int32_t dump_all(byte* out_buf, int32_t out_len) const;
};
#endif /* LUA_COVERAGE_H_ */