const sdl = @import("./sdl.zig").c;
const std = @import("std");
const sf = @import("./slime_factory.zig");

pub const GameState = struct {
    r: u8 = 0xff,
    g: u8 = 0xff,
    b: u8 = 0xff,
    SCREEN_WIDTH: u32 = 640,
    SCREEN_HEIGHT: u32 = 480,
    slime_factory: sf.SlimeFactory = undefined,
    renderer: *sdl.struct_SDL_Renderer = undefined,

    pub fn init(allocator: std.mem.Allocator, renderer: *sdl.struct_SDL_Renderer) !GameState {
        var slime_factory = try sf.SlimeFactory.init(allocator, renderer);
        try slime_factory.add(.{});
        return .{ .slime_factory = slime_factory, .renderer = renderer };
    }

    pub fn deinit(self: *GameState) void {
        self.slime_factory.deinit();
    }

    pub fn update_tick(self: *GameState) void {
        self.slime_factory.render(self);
    }
};
