| 107 | } |
| 108 | |
| 109 | void CharacterScriptGetter::AttachToScript(ASContext *as_context, const std::string &as_name) { |
| 110 | as_context->RegisterObjectType("CharacterScriptGetter", 0, asOBJ_REF | asOBJ_NOHANDLE, "Can load a character xml and provide access to its data"); |
| 111 | as_context->RegisterObjectMethod("CharacterScriptGetter", "bool Load(const string &in)", asMETHOD(CharacterScriptGetter, Load), asCALL_THISCALL, "Load a character xml file (e.g. \"Data/Characters/guard.xml\")"); |
| 112 | as_context->RegisterObjectMethod("CharacterScriptGetter", "string GetObjPath()", asMETHOD(CharacterScriptGetter, GetObjPath), asCALL_THISCALL); |
| 113 | as_context->RegisterObjectMethod("CharacterScriptGetter", "string GetSkeletonPath()", asMETHOD(CharacterScriptGetter, GetSkeletonPath), asCALL_THISCALL); |
| 114 | as_context->RegisterObjectMethod("CharacterScriptGetter", "string GetAnimPath(const string &in anim_label)", asMETHOD(CharacterScriptGetter, GetAnimPath), asCALL_THISCALL); |
| 115 | as_context->RegisterObjectMethod("CharacterScriptGetter", "const string& GetTag(const string &in key)", asMETHOD(CharacterScriptGetter, GetTag), asCALL_THISCALL); |
| 116 | as_context->RegisterObjectMethod("CharacterScriptGetter", "string GetAttackPath(const string &in attack_label)", asMETHOD(CharacterScriptGetter, GetAttackPath), asCALL_THISCALL); |
| 117 | as_context->RegisterObjectMethod("CharacterScriptGetter", "void GetTeamString(string &out team_string)", asMETHOD(CharacterScriptGetter, GetTeamString), asCALL_THISCALL); |
| 118 | as_context->RegisterObjectMethod("CharacterScriptGetter", "float GetHearing()", asMETHOD(CharacterScriptGetter, GetHearing), asCALL_THISCALL); |
| 119 | as_context->RegisterObjectMethod("CharacterScriptGetter", "const string& GetChannel(int which_channel)", asMETHOD(CharacterScriptGetter, GetChannel), asCALL_THISCALL, "Get type of given color channel (e.g. \"fur\", \"cloth\")"); |
| 120 | as_context->RegisterObjectMethod("CharacterScriptGetter", "bool GetMorphMetaPoints(const string &in label, vec3 &out start, vec3 &out end)", asMETHOD(CharacterScriptGetter, GetMorphMetaPoints), asCALL_THISCALL); |
| 121 | as_context->DocsCloseBrace(); |
| 122 | as_context->RegisterGlobalProperty(("CharacterScriptGetter " + as_name).c_str(), this); |
| 123 | } |
| 124 | |
| 125 | const std::string &CharacterScriptGetter::GetChannel(int which) { |
| 126 | return character_ref->GetChannel(which); |
nothing calls this directly
no test coverage detected