mirror of https://git.sr.ht/~kikoodx/kble
WIP level struct
This commit is contained in:
parent
2180d91dc2
commit
9795160001
|
@ -0,0 +1,23 @@
|
|||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
const Level = struct {
|
||||
width: u16,
|
||||
height: u16,
|
||||
buffer: [65536]u16,
|
||||
|
||||
pub fn init(width: u16, height: u16) Level {
|
||||
return Level {
|
||||
.width = width,
|
||||
.height = height,
|
||||
.buffer = undefined,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
test "create level buffer" {
|
||||
// Create level.
|
||||
const level: Level = Level.init(64, 32);
|
||||
expect(level.width == 64);
|
||||
expect(level.height == 32);
|
||||
}
|
Loading…
Reference in New Issue