OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
ut::Vm Class Reference

#include <vm.h>

Classes

struct  Frame

Public Types

using Native = std::function<void(Obj* self, std::vector<Value*>& args, Value& ret)>

Public Member Functions

 Vm (PackageSet *packages)
void bind_natives (const Package &p)
Value call (const Function &f, Obj *self, std::vector< Value > &args)
const Function & function (const Package &p, int32_t ref)
Obj * object (const Package &p, int32_t ref)
Obj * spawn (Obj *cls)
Obj * defaults (Obj *cls)
Obj * super_of (Obj *cls)
bool goto_state (Obj *o, const std::string &state, const std::string &label="Begin")
void tick (Obj *o, float dt)
bool event (Obj *o, const std::string &name, std::vector< Value > &&args={}, Value *ret=nullptr)
bool event (Obj *o, const std::string &name, std::vector< Value > &args, Value *ret=nullptr)
Value * prop (Obj *o, const std::string &name)
std::vector< Value > * prop_array (Obj *o, const std::string &name)
void instantiate (Obj *o)
void add_native (const std::string &name, Native fn)
bool is_a (Obj *cls, const Obj *base)
Obj * class_of (Obj *o)
std::string name_of (const Obj *o) const

Public Attributes

std::vector< Value > iterator_items
std::vector< std::vector< Value > > iterator_extra
std::vector< std::string > log
std::vector< std::string > trace_calls

Member Typedef Documentation

◆ Native

using ut::Vm::Native = std::function<void(Obj* self, std::vector<Value*>& args, Value& ret)>

Constructor & Destructor Documentation

◆ Vm()

ut::Vm::Vm ( PackageSet * packages)
explicit

Member Function Documentation

◆ add_native()

void ut::Vm::add_native ( const std::string & name,
Native fn )

◆ bind_natives()

void ut::Vm::bind_natives ( const Package & p)

◆ call()

Value ut::Vm::call ( const Function & f,
Obj * self,
std::vector< Value > & args )

◆ class_of()

Obj * ut::Vm::class_of ( Obj * o)

◆ defaults()

Obj * ut::Vm::defaults ( Obj * cls)

◆ event() [1/2]

bool ut::Vm::event ( Obj * o,
const std::string & name,
std::vector< Value > && args = {},
Value * ret = nullptr )

◆ event() [2/2]

bool ut::Vm::event ( Obj * o,
const std::string & name,
std::vector< Value > & args,
Value * ret = nullptr )

◆ function()

const Function & ut::Vm::function ( const Package & p,
int32_t ref )

◆ goto_state()

bool ut::Vm::goto_state ( Obj * o,
const std::string & state,
const std::string & label = "Begin" )

◆ instantiate()

void ut::Vm::instantiate ( Obj * o)

◆ is_a()

bool ut::Vm::is_a ( Obj * cls,
const Obj * base )

◆ name_of()

std::string ut::Vm::name_of ( const Obj * o) const

◆ object()

Obj * ut::Vm::object ( const Package & p,
int32_t ref )

◆ prop()

Value * ut::Vm::prop ( Obj * o,
const std::string & name )

◆ prop_array()

std::vector< Value > * ut::Vm::prop_array ( Obj * o,
const std::string & name )

◆ spawn()

Obj * ut::Vm::spawn ( Obj * cls)

◆ super_of()

Obj * ut::Vm::super_of ( Obj * cls)

◆ tick()

void ut::Vm::tick ( Obj * o,
float dt )

Member Data Documentation

◆ iterator_extra

std::vector<std::vector<Value> > ut::Vm::iterator_extra

◆ iterator_items

std::vector<Value> ut::Vm::iterator_items

◆ log

std::vector<std::string> ut::Vm::log

◆ trace_calls

std::vector<std::string> ut::Vm::trace_calls

The documentation for this class was generated from the following files: