34 lines
1009 B
C
34 lines
1009 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "scriptmodule.h"
|
|
#include "script/module/modulesystem.h"
|
|
#include "script/module/moduleinput.h"
|
|
#include "script/module/moduleplatform.h"
|
|
#include "script/module/modulescene.h"
|
|
#include "script/module/modulemap.h"
|
|
|
|
const scriptmodule_t SCRIPT_MODULE_LIST[] = {
|
|
{ .name = "system", .callback = moduleSystem },
|
|
{ .name = "input", .callback = moduleInput },
|
|
{ .name = "platform", .callback = modulePlatform },
|
|
{ .name = "scene", .callback = moduleScene },
|
|
{ .name = "map", .callback = moduleMapSystem },
|
|
};
|
|
|
|
#define SCRIPT_MODULE_COUNT ( \
|
|
sizeof(SCRIPT_MODULE_LIST) / sizeof(scriptmodule_t) \
|
|
)
|
|
|
|
const scriptmodule_t * scriptModuleGetByName(const char_t *name) {
|
|
for(uint_fast8_t i = 0; i < SCRIPT_MODULE_COUNT; i++) {
|
|
if(stringCompare(SCRIPT_MODULE_LIST[i].name, name) != 0) continue;
|
|
return &SCRIPT_MODULE_LIST[i];
|
|
}
|
|
|
|
return NULL;
|
|
} |