@pkmn/engine 0.1.0-dev.545e0ef3 → 0.1.0-dev.5ea92492
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 +28 -0
- 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/data.d.ts +1 -2
- package/build/pkg/data.js +3 -5
- package/build/pkg/data.js.map +1 -1
- package/build/test/display.js +382 -0
- package/build/test/display.js.map +1 -0
- package/build/tools/debug.js +133 -0
- package/build/tools/debug.js.map +1 -0
- package/build.zig +9 -12
- package/package.json +33 -23
- package/src/bin/install-pkmn-engine +57 -30
- package/src/bin/pkmn-debug +62 -0
- package/src/lib/gen1/README.md +18 -5
- package/src/lib/gen1/data.zig +2 -1
- package/src/lib/gen1/mechanics.zig +2340 -2254
- package/src/test/display/pkmn.html.tmpl +368 -0
package/src/lib/gen1/data.zig
CHANGED
|
@@ -78,7 +78,8 @@ pub fn Battle(comptime RNG: anytype) type {
|
|
|
78
78
|
/// Returns the result of applying Player 1's choice `c1` and Player 2's choice `c2` to the
|
|
79
79
|
/// battle, optionally writing protocol logs to `log` if `options.trace` is enabled.
|
|
80
80
|
pub fn update(self: *Self, c1: Choice, c2: Choice, log: anytype) !Result {
|
|
81
|
-
|
|
81
|
+
const m = mechanics.Mechanics(*Self, @TypeOf(log)){ .battle = self, .log = log };
|
|
82
|
+
return m.update(c1, c2);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
/// Fills in at most `out.len` possible choices for the `player` given the previous `result`
|