41 lines
997 B
Zig
41 lines
997 B
Zig
|
|
const std = @import("std");
|
||
|
|
const App = @import("../../app.zig");
|
||
|
|
const system = @import("system.zig");
|
||
|
|
const stage = @import("stage.zig");
|
||
|
|
|
||
|
|
/// ----------------------------------------------------
|
||
|
|
/// ----------------------------------------------------
|
||
|
|
pub const plugin: App.plugin.Plugin = .{
|
||
|
|
.name = "Simple",
|
||
|
|
.description = "Simple plugin example",
|
||
|
|
.build = build,
|
||
|
|
};
|
||
|
|
|
||
|
|
/// ----------------------------------------------------
|
||
|
|
/// ----------------------------------------------------
|
||
|
|
fn build(
|
||
|
|
self: *App.plugin.Plugin,
|
||
|
|
ctx: App.plugin.Context,
|
||
|
|
) !void {
|
||
|
|
|
||
|
|
// --- DEBUG ---
|
||
|
|
std.debug.print(
|
||
|
|
"\x1b[33mPLUGIN\x1b[0m\n" ++
|
||
|
|
\\| Name: {s}
|
||
|
|
\\| Description: {s}
|
||
|
|
\\
|
||
|
|
,
|
||
|
|
.{
|
||
|
|
self.name,
|
||
|
|
self.description,
|
||
|
|
},
|
||
|
|
);
|
||
|
|
|
||
|
|
// --- ADD SYSTEMS ---
|
||
|
|
try ctx.app.schedules.addMany(stage.Init, &.{
|
||
|
|
system.test_resources,
|
||
|
|
system.test_events,
|
||
|
|
system.test_ecs,
|
||
|
|
});
|
||
|
|
}
|