@pkmn/engine 0.1.0-dev.979a393a → 0.1.0-dev.a5a9f4b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/build/pkg/addon.d.ts +7 -0
- package/build/pkg/addon.js +111 -0
- package/build/pkg/addon.js.map +1 -0
- package/build/pkg/gen1.js +1 -1
- package/build/test/display.js +2 -1
- package/build/test/display.js.map +1 -1
- package/build.zig +10 -15
- package/package.json +11 -8
- package/src/bin/install-pkmn-engine +1 -1
- package/src/bin/pkmn-debug +29 -6
- package/src/lib/binding/node.zig +4 -4
- package/src/lib/binding/wasm.zig +2 -2
- package/src/lib/gen1/README.md +12 -5
- package/src/lib/gen1/data.zig +5 -5
- package/src/lib/gen1/mechanics.zig +231 -235
- package/src/lib/gen2/data.zig +4 -4
- package/src/lib/pkmn.zig +3 -3
package/src/lib/gen2/data.zig
CHANGED
|
@@ -19,13 +19,13 @@ const assert = std.debug.assert;
|
|
|
19
19
|
const expectEqual = std.testing.expectEqual;
|
|
20
20
|
const expect = std.testing.expect;
|
|
21
21
|
|
|
22
|
-
pub const
|
|
22
|
+
pub const MAX_CHOICES: usize = 9; // move 1..4, switch 2..6
|
|
23
23
|
pub const MAX_LOGS: usize = 180; // TODO
|
|
24
24
|
|
|
25
|
-
pub const
|
|
26
|
-
|
|
25
|
+
pub const CHOICES_SIZE = if (builtin.mode == .ReleaseSmall)
|
|
26
|
+
MAX_CHOICES
|
|
27
27
|
else
|
|
28
|
-
std.math.ceilPowerOfTwo(usize,
|
|
28
|
+
std.math.ceilPowerOfTwo(usize, MAX_CHOICES) catch unreachable;
|
|
29
29
|
pub const LOGS_SIZE = if (builtin.mode == .ReleaseSmall)
|
|
30
30
|
MAX_LOGS
|
|
31
31
|
else
|
package/src/lib/pkmn.zig
CHANGED
|
@@ -4,10 +4,10 @@ pub const options = @import("common/options.zig");
|
|
|
4
4
|
pub const Options = options.Options;
|
|
5
5
|
|
|
6
6
|
/// The minimum size in bytes required to hold all choice options.
|
|
7
|
-
pub const
|
|
7
|
+
pub const MAX_CHOICES = gen1.MAX_CHOICES;
|
|
8
8
|
/// The optimal size in bytes required to hold all choice options.
|
|
9
|
-
/// At least as large as `
|
|
10
|
-
pub const
|
|
9
|
+
/// At least as large as `MAX_CHOICES`.
|
|
10
|
+
pub const CHOICES_SIZE = gen1.CHOICES_SIZE;
|
|
11
11
|
/// The maximum number of bytes possibly logged by a single update.
|
|
12
12
|
pub const MAX_LOGS = gen1.MAX_LOGS;
|
|
13
13
|
/// The optimal size in bytes required to hold the largest amount of log data
|