void SMJS_Entity::OnWrapperAttached(SMJS_Plugin *plugin, v8::Persistent<v8::Value> wrapper){ auto obj = wrapper->ToObject(); obj->SetAccessor(v8::String::New("index"), GetEntityIndex); obj->Set(v8::String::New("netprops"), netprops.GetWrapper(plugin)); obj->Set(v8::String::New("keyvalues"), keyvalues.GetWrapper(plugin)); obj->Set(v8::String::New("datamaps"), datamaps.GetWrapper(plugin)); }
void MConsole::OnWrapperAttached(SMJS_Plugin *plugin, v8::Persistent<v8::Value> wrapper){ auto obj = wrapper->ToObject(); }
void MEntities::OnWrapperAttached(SMJS_Plugin *plugin, v8::Persistent<v8::Value> wrapper){ auto obj = wrapper->ToObject(); plugin->GetContext()->Global()->Set(v8::String::NewSymbol("Entity"), SMJS_Entity::GetTemplateForPlugin(plugin)->GetFunction()); }