MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / RegisterObjectMethod

Method RegisterObjectMethod

Source/Scripting/angelscript/ascontext.cpp:579–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579void ASContext::RegisterObjectMethod(const char *obj, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv, const char *comment) {
580 int r = engine->RegisterObjectMethod(obj, declaration, funcPointer, callConv);
581 if (r < 0) {
582 const char *error;
583 switch (r) {
584 case asWRONG_CONFIG_GROUP:
585 error = "asWRONG_CONFIG_GROUP";
586 break;
587 case asNOT_SUPPORTED:
588 error = "asNOT_SUPPORTED";
589 break;
590 case asINVALID_TYPE:
591 error = "asINVALID_TYPE";
592 break;
593 case asINVALID_DECLARATION:
594 error = "asINVALID_DECLARATION";
595 break;
596 case asNAME_TAKEN:
597 error = "asNAME_TAKEN";
598 break;
599 case asWRONG_CALLING_CONV:
600 error = "asWRONG_CALLING_CONV";
601 break;
602 }
603 FatalError("Error", "Error registering method of \"%s\" \"%s\" %s", obj, declaration, error);
604 }
605 const int BUF_SIZE = 512;
606 char doc_buf[BUF_SIZE];
607 if (comment) {
608 FormatString(doc_buf, BUF_SIZE, " %s; // %s\n", declaration, comment);
609 } else {
610 FormatString(doc_buf, BUF_SIZE, " %s;\n", declaration);
611 }
612 documentation += doc_buf;
613}
614
615void ASContext::RegisterObjectProperty(const char *obj, const char *declaration, int byteOffset, const char *comment) {
616 int r = engine->RegisterObjectProperty(obj, declaration, byteOffset);

Callers 15

AttachToContextMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
RegisterToScriptMethod · 0.45
DefineHotspotTypePublicFunction · 0.45
AttachToScriptMethod · 0.45
AttachAttackScriptGetterFunction · 0.45

Calls 2

FormatStringFunction · 0.85
FatalErrorFunction · 0.50

Tested by

no test coverage detected