You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - wren_state.h
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2022/10/25 (y/m/d)
|
|
|
|
|
* Mod Date - 2022/10/25 (y/m/d)
|
|
|
|
|
* Description - Manages the wren vm, runs scripts. This is the main
|
|
|
|
|
* interface for wren.
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef LUNARIUM_WREN_STATE_H_
|
|
|
|
|
#define LUNARIUM_WREN_STATE_H_
|
|
|
|
|
|
|
|
|
|
#include <core/common_defs.h>
|
|
|
|
|
#include <utils/op_res.h>
|
|
|
|
|
|
|
|
|
|
#include <wren.hpp>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace lunarium
|
|
|
|
|
{
|
|
|
|
|
class WrenScript;
|
|
|
|
|
|
|
|
|
|
class WrenState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
~WrenState();
|
|
|
|
|
OpRes Initialize();
|
|
|
|
|
void Shutdown();
|
|
|
|
|
u32 GetLogCat() const;
|
|
|
|
|
|
|
|
|
|
void RunScript(WrenScript* script);
|
|
|
|
|
void RunSnippet(std::string name, std::string code);
|
|
|
|
|
|
|
|
|
|
// CALL BACKS
|
|
|
|
|
static void WriteFN(WrenVM* vm, const char* text);
|
|
|
|
|
static void ErrorFN(WrenVM* vm, WrenErrorType type, const char* module, int line, const char* message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static u32 mLogCat;
|
|
|
|
|
WrenVM* mpVM;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // LUNARIUM_WREN_STATE_H_
|