WIP level struct

This commit is contained in:
KikooDX 2021-01-25 19:07:48 +01:00
parent 2180d91dc2
commit 9795160001
1 changed files with 23 additions and 0 deletions

23
src/level.zig Normal file
View File

@ -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);
}