{"id":15510438,"url":"https://github.com/ananace/ashes","last_synced_at":"2025-10-10T20:41:27.924Z","repository":{"id":143078601,"uuid":"74292013","full_name":"ananace/ASHes","owner":"ananace","description":"Angelscript Helpers","archived":false,"fork":false,"pushed_at":"2016-12-04T20:31:07.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T05:12:12.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ananace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-20T17:48:56.000Z","updated_at":"2017-03-17T05:08:26.000Z","dependencies_parsed_at":"2023-04-18T08:47:44.356Z","dependency_job_id":null,"html_url":"https://github.com/ananace/ASHes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ananace/ASHes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FASHes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FASHes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FASHes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FASHes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ananace","download_url":"https://codeload.github.com/ananace/ASHes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FASHes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005273,"owners_count":26083863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:48:46.567Z","updated_at":"2025-10-10T20:41:27.909Z","avatar_url":"https://github.com/ananace.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"ASHes\n=====\n\nAngelScript Helper library.\n\nThis library contains objects and methods to simplify the registering and usage of an Angelscript application interface.\n\n\nUsage\n-----\n\n```c++\n\n#include \u003cashes/ashes.hpp\u003e\n\nclass DataType\n{\npublic:\n\tstruct POD\n\t{\n\t\tint data;\n\t};\n\n\tenum Value\n\t{\n\t\tOne = 1,\n\t\tTwo,\n\t\tThree,\n\t\tFive = 5\n\t};\n\n\tDataType() = default;\n\tDataType(int data);\n\tDataType(const DataType\u0026) = default;\n\t~DataTYpe() = default;\n\n\tDataType\u0026 operator=(const DataType\u0026) = default;\n\n\tvoid init();\n\n\tvoid setData(int data);\n\tint getData() const;\n\n\tValue getValue() const;\n\n\tPOD toPod() const;\n};\n\nvoid constructData(void* mem)\n{\n\tnew(mem) DataType();\n}\nvoid constructDataVal(void* mem, int data)\n{\n\tnew(mem) DataType(data);\n}\nvoid constructDataCopy(void* mem, const DataType\u0026 copy)\n{\n\tnew(mem) DataType(copy);\n}\nvoid destructData(DataType* mem)\n{\n\tmem-\u003e~DataType();\n}\n\nvoid registerAS(asIScriptEngine* eng)\n{\n\tint r = eng-\u003eRegisterObjectType(\"DataType\", sizeof(DataType), asOBJ_VALUE | asTypeGetInfo\u003cDataType\u003e()); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectType(\"DataType::POD\", sizeof(DataType::POD), asOBJ_VALUE | asOBJ_POD); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterEnum(\"DataType::Value\"); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterEnumValue(\"DataType::Value\", \"One\", DataType::One); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterEnumValue(\"DataType::Value\", \"Two\", DataType::Two); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterEnumValue(\"DataType::Value\", \"Three\", DataType::Three); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterEnumValue(\"DataType::Value\", \"Five\", DataType::Five); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectProperty(\"DataType::POD\", \"int data\", asOFFSET(DataType::POD, data)); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectBehaviour(\"DataType\", asBEHAVE_CONSTRUCT, \"void f()\", asFUNCTION(constructData), asCALL_CDECL_OBJFIRST); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectBehaviour(\"DataType\", asBEHAVE_CONSTRUCT, \"void f(int)\", asFUNCTION(constructDataVal), asCALL_CDECL_OBJFIRST); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectBehaviour(\"DataType\", asBEHAVE_CONSTRUCT, \"void f(DataType\u0026in)\", asFUNCTION(constructDataCopy), asCALL_CDECL_OBJFIRST); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectBehaviour(\"DataType\", asBEHAVE_DESTRUCT, \"void f()\", asFUNCTION(destructData), asCALL_CDECL_OBJFIRST); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"DataType\u0026 opAssign(DataType\u0026in)\", asMETHOD(DataType, operator=), asCALL_THISCALL); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"void init()\", asMETHOD(DataType, init), asCALL_THISCALL); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"void set_Data(int)\", asMETHOD(DataType, setData), asCALL_THISCALL); assert(r \u003e= 0);\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"int get_Data() const\", asMETHOD(DataType, getData), asCALL_THISCALL); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"DataType::Value get_Value() const\", asMETHOD(DataType, getValue), asCALL_THISCALL); assert(r \u003e= 0);\n\n\tr = eng-\u003eRegisterObjectMethod(\"DataType\", \"DataType::POD get_POD() const\", asMETHOD(DataType, toPod), asCALL_THISCALL); assert(r \u003e= 0);\n\n\n\t// Function call\n\tauto* ctx = eng-\u003eRequestContext(); assert(ctx);\n\n\tauto* type = eng-\u003eGetTypeInfoByName(\"DataType\"); assert(type);\n\tauto* obj = eng-\u003eCreateScriptObject(type); assert(obj);\n\tauto* func = obj-\u003eGetMethodByName(\"get_POD\"); assert(func);\n\n\tr = ctx-\u003ePrepare(func); assert(r \u003e= 0);\n\tr = ctx-\u003eSetObject(obj); assert(r \u003e= 0);\n\n\tr = ctx-\u003eExecute(); assert(r \u003e= 0);\n\n\tDataType::POD value = *reinterpret_cast\u003cDataType::POD*\u003e(ctx-\u003eGetAddressOfReturnValue());\n\n\teng-\u003eReturnContext(ctx);\n}\n\nvoid registerASH(ash::Engine\u0026 eng)\n{\n\tauto dt = eng.registerValueType\u003cDataType\u003e(\"DataType\");\n\tauto pod = eng.registerValueType\u003cDataType::POD\u003e(\"DataType::POD\", asOBJ_POD);\n\tauto value = eng.registerEnum\u003cDataType::Value\u003e(\"DataType::Value\");\n\n\tvalue[\"One\"] = DataType::One;\n\tvalue[\"Two\"] = DataType::Two;\n\tvalue[\"Three\"] = DataType::Three;\n\tvalue[\"Five\"] = DataType::Five;\n\n\tpod.registerProperty\u003cDataType::POD::data\u003e(\"data\");\n\n\tdt.registerCDAK();\n\tdt.registerConstructor\u003cint\u003e();\n\t\n\tdt.registerMethod\u003cDataType::init\u003e(\"init\");\n\tdt.registerMethod\u003cDataType::setData\u003e(\"set_Data\");\n\tdt.registerMethod\u003cDataType::getData\u003e(\"get_Data\");\n\tdt.registerMethod\u003cDataType::getValue\u003e(\"get_Value\");\n\tdt.registerMethod\u003cDataType::toPod\u003e(\"get_POD\");\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fashes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananace%2Fashes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fashes/lists"}