NYXA/src/example/simple/plugin.zig

43 lines
1.1 KiB
Zig
Raw Normal View History

2026-07-09 22:30:04 +01:00
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",
.dependencies = &.{},
2026-07-09 22:30:04 +01:00
.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,
});
try ctx.app.schedules.addBefore(stage.Init, stage.Init, system.draw);
2026-07-09 22:30:04 +01:00
}