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

Function AttachSaveFile

Source/Game/savefile_script.cpp:54–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void AttachSaveFile(ASContext* ctx, SaveFile* save_file) {
55 local_ctx = ctx;
56 ctx->RegisterObjectType("SavedLevel", 0, asOBJ_REF | asOBJ_NOCOUNT);
57 ctx->RegisterObjectMethod(
58 "SavedLevel",
59 "void SetValue(const string &in key, const string &in value)",
60 asMETHOD(SavedLevel, SetValue),
61 asCALL_THISCALL);
62 ctx->RegisterObjectMethod(
63 "SavedLevel",
64 "const string& GetValue(const string &in key)",
65 asMETHOD(SavedLevel, GetValue),
66 asCALL_THISCALL);
67
68 ctx->RegisterObjectMethod(
69 "SavedLevel",
70 "void SetArrayValue(const string &in key, const int32 index, const string &in value)",
71 asMETHOD(SavedLevel, SetArrayValue),
72 asCALL_THISCALL);
73 ctx->RegisterObjectMethod(
74 "SavedLevel",
75 "void DeleteArrayValue(const string &in key, const int32 index)",
76 asMETHOD(SavedLevel, DeleteArrayValue),
77 asCALL_THISCALL);
78 ctx->RegisterObjectMethod(
79 "SavedLevel",
80 "void AppendArrayValueIfUnique(const string &in key, const string &in val)",
81 asMETHOD(SavedLevel, AppendArrayValueIfUnique),
82 asCALL_THISCALL);
83 ctx->RegisterObjectMethod(
84 "SavedLevel",
85 "void AppendArrayValue(const string &in key, const string &in val)",
86 asMETHOD(SavedLevel, AppendArrayValue),
87 asCALL_THISCALL);
88 ctx->RegisterObjectMethod(
89 "SavedLevel",
90 "uint32 GetArraySize(const string &in key)",
91 asMETHOD(SavedLevel, GetArraySize),
92 asCALL_THISCALL);
93 ctx->RegisterObjectMethod(
94 "SavedLevel",
95 "string GetArrayValue(const string &in key, const int32 index)",
96 asMETHOD(SavedLevel, GetArrayValue),
97 asCALL_THISCALL);
98 ctx->RegisterObjectMethod(
99 "SavedLevel",
100 "array<string>@ GetArray(const string &in key)",
101 asFUNCTION(AS_GetArray),
102 asCALL_CDECL_OBJFIRST);
103
104 ctx->RegisterObjectMethod(
105 "SavedLevel",
106 "void SetInt32Value(const string &in key, const int32 value)",
107 asMETHOD(SavedLevel, SetInt32Value),
108 asCALL_THISCALL);
109 ctx->RegisterObjectMethod(
110 "SavedLevel",
111 "int32 GetInt32Value(const string &in key)",

Callers 4

InitializeMethod · 0.85
InitializeMethod · 0.85
InitializeMethod · 0.85
InitializeMethod · 0.85

Calls 4

RegisterObjectTypeMethod · 0.80
DocsCloseBraceMethod · 0.80
RegisterObjectMethodMethod · 0.45

Tested by

no test coverage detected