@pkmn/engine 0.1.0-dev.f918c3bd → 0.1.0-dev.fb6653d6

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.
Files changed (83) hide show
  1. package/LICENSE +1 -3
  2. package/README.md +51 -23
  3. package/build/pkg/addon/browser.d.ts +3 -0
  4. package/build/pkg/addon/browser.js +44 -0
  5. package/build/pkg/addon/browser.js.map +1 -0
  6. package/build/pkg/addon/node.d.ts +3 -0
  7. package/build/pkg/addon/node.js +97 -0
  8. package/build/pkg/addon/node.js.map +1 -0
  9. package/build/pkg/addon/wasm.d.ts +2 -0
  10. package/build/pkg/addon/wasm.js +53 -0
  11. package/build/pkg/addon/wasm.js.map +1 -0
  12. package/build/pkg/addon.d.ts +25 -3
  13. package/build/pkg/addon.js +39 -71
  14. package/build/pkg/addon.js.map +1 -1
  15. package/build/pkg/data/ids.json +12 -12
  16. package/build/pkg/data/layout.json +17 -4
  17. package/build/pkg/data/protocol.json +23 -9
  18. package/build/pkg/data.d.ts +27 -5
  19. package/build/pkg/data.js.map +1 -1
  20. package/build/pkg/gen1.d.ts +13 -17
  21. package/build/pkg/gen1.js +8 -12
  22. package/build/pkg/gen1.js.map +1 -1
  23. package/build/pkg/index.d.ts +40 -91
  24. package/build/pkg/index.js +6 -63
  25. package/build/pkg/index.js.map +1 -1
  26. package/build/pkg/protocol.d.ts +20 -1
  27. package/build/pkg/protocol.js +109 -107
  28. package/build/pkg/protocol.js.map +1 -1
  29. package/build/tools/debug.js +36 -69
  30. package/build/tools/debug.js.map +1 -1
  31. package/build/tools/display/debug.jsx +141 -0
  32. package/build/tools/display/debug.jsx.map +1 -0
  33. package/build/tools/display/index.js +142 -0
  34. package/build/tools/display/index.js.map +1 -0
  35. package/build/tools/display/ui.jsx +349 -0
  36. package/build/tools/display/ui.jsx.map +1 -0
  37. package/build/tools/display/util.js +18 -0
  38. package/build/tools/display/util.js.map +1 -0
  39. package/build.zig +303 -101
  40. package/package.json +61 -132
  41. package/src/bin/install-pkmn-engine +30 -20
  42. package/src/bin/pkmn-debug +1 -1
  43. package/src/lib/{binding → bindings}/node.zig +8 -21
  44. package/src/lib/bindings/wasm.zig +58 -0
  45. package/src/lib/common/array.zig +77 -0
  46. package/src/lib/common/data.zig +8 -8
  47. package/src/lib/common/debug.zig +39 -8
  48. package/src/lib/common/js.zig +4 -2
  49. package/src/lib/common/optional.zig +21 -10
  50. package/src/lib/common/options.zig +6 -0
  51. package/src/lib/common/protocol.zig +421 -393
  52. package/src/lib/common/rational.zig +131 -35
  53. package/src/lib/common/rng.zig +16 -9
  54. package/src/lib/common/util.zig +50 -1
  55. package/src/lib/gen1/calc.zig +687 -160
  56. package/src/lib/gen1/chance.zig +434 -307
  57. package/src/lib/gen1/data/moves.zig +26 -14
  58. package/src/lib/gen1/data/species.zig +4 -6
  59. package/src/lib/gen1/data/types.zig +7 -8
  60. package/src/lib/gen1/data.zig +44 -47
  61. package/src/lib/gen1/helpers.zig +91 -562
  62. package/src/lib/gen1/mechanics.zig +641 -557
  63. package/src/lib/gen2/calc.zig +153 -0
  64. package/src/lib/gen2/chance.zig +902 -0
  65. package/src/lib/gen2/data/items.zig +13 -21
  66. package/src/lib/gen2/data/moves.zig +67 -47
  67. package/src/lib/gen2/data/species.zig +2 -4
  68. package/src/lib/gen2/data/types.zig +134 -32
  69. package/src/lib/gen2/data.zig +56 -54
  70. package/src/lib/gen2/generated.zig +801 -0
  71. package/src/lib/gen2/helpers.zig +46 -25
  72. package/src/lib/gen2/mechanics.zig +2778 -362
  73. package/src/lib/node.zig +18 -0
  74. package/src/lib/pkmn.zig +37 -15
  75. package/src/lib/wasm.zig +17 -0
  76. package/src/tools/display/dom.ts +96 -0
  77. package/src/tools/display/ui.css +354 -0
  78. package/build/test/display.js +0 -400
  79. package/build/test/display.js.map +0 -1
  80. package/src/lib/binding/wasm.zig +0 -12
  81. package/src/lib/gen1/README.md +0 -894
  82. package/src/lib/gen2/README.md +0 -328
  83. package/src/test/display/pkmn.html.tmpl +0 -368
@@ -1,25 +1,23 @@
1
- //! Code generated by `tools/generate` - manual edits will be overwritten
2
-
3
- const std = @import("std");
1
+ //! Code generated by `tools/generate` - manual edits will be overwritten.
4
2
 
5
3
  const data = @import("../../gen2/data.zig");
4
+ const std = @import("std");
6
5
 
7
6
  const assert = std.debug.assert;
8
-
9
7
  const Type = data.Type;
10
8
 
11
9
  /// Representation of a held item in Generation II Pokémon.
12
10
  pub const Item = enum(u8) {
13
11
  None,
12
+ SoftSand, // Ground
13
+ HardStone, // Rock
14
+ MetalCoat, // Steel
14
15
  PinkBow, // Normal
15
16
  BlackBelt, // Fighting
16
17
  SharpBeak, // Flying
17
18
  PoisonBarb, // Poison
18
- SoftSand, // Ground
19
- HardStone, // Rock
20
19
  SilverPowder, // Bug
21
20
  SpellTag, // Ghost
22
- MetalCoat, // Steel
23
21
  PolkadotBow, // ??? (Normal)
24
22
  Charcoal, // Fire
25
23
  MysticWater, // Water
@@ -36,21 +34,21 @@ pub const Item = enum(u8) {
36
34
  Stick,
37
35
  ThickClub,
38
36
  FocusBand, // FocusBand
39
- BerryJuice, // Berry
40
37
  ScopeLens, // CriticalUp
41
38
  Leftovers, // Leftovers
42
39
  BerserkGene,
43
40
  LightBall,
41
+ Berry, // Berry
42
+ BerryJuice, // Berry
43
+ GoldBerry, // Berry
44
+ MintBerry, // HealSleep
44
45
  PSNCureBerry, // HealPoison
45
46
  PRZCureBerry, // HealParalyze
46
- BurntBerry, // HealFreeze
47
47
  IceBerry, // HealBurn
48
- BitterBerry, // HealConfusion
49
- MintBerry, // HealSleep
48
+ BurntBerry, // HealFreeze
50
49
  MiracleBerry, // HealStatus
50
+ BitterBerry, // HealConfusion
51
51
  MysteryBerry, // RestorePP
52
- Berry, // Berry
53
- GoldBerry, // Berry
54
52
  MasterBall,
55
53
  UltraBall,
56
54
  GreatBall,
@@ -216,20 +214,14 @@ pub const Item = enum(u8) {
216
214
  pub const size = 196;
217
215
 
218
216
  /// Returns a `Type` boosted by this item or `null` if the item is not a type-boosting item.
219
- pub inline fn boost(item: Item) ?Type {
217
+ pub fn boost(item: Item) ?Type {
220
218
  assert(item != .None);
221
219
  if (item == .PolkadotBow) return .Normal;
222
220
  return if (@intFromEnum(item) <= 18) @enumFromInt(@intFromEnum(item) - 1) else null;
223
221
  }
224
222
 
225
- /// Whether or not this item is a Berry.
226
- pub inline fn berry(item: Item) bool {
227
- assert(item != .None);
228
- return @intFromEnum(item) > 30 and @intFromEnum(item) <= 40;
229
- }
230
-
231
223
  /// Whether or not this item is Mail.
232
- pub inline fn mail(item: Item) bool {
224
+ pub fn isMail(item: Item) bool {
233
225
  assert(item != .None);
234
226
  return @intFromEnum(item) > 60 and @intFromEnum(item) <= 70;
235
227
  }
@@ -1,12 +1,10 @@
1
- //! Code generated by `tools/generate` - manual edits will be overwritten
1
+ //! Code generated by `tools/generate` - manual edits will be overwritten.
2
2
 
3
- const std = @import("std");
4
-
5
- const rng = @import("../../common/rng.zig");
6
3
  const gen2 = @import("../../gen2/data.zig");
4
+ const rng = @import("../../common/rng.zig");
5
+ const std = @import("std");
7
6
 
8
7
  const assert = std.debug.assert;
9
-
10
8
  const percent = rng.Gen12.percent;
11
9
  const Type = gen2.Type;
12
10
 
@@ -281,21 +279,23 @@ pub const Move = enum(u8) {
281
279
  chance: u8 = 0,
282
280
  /// The priority of the move.
283
281
  priority: i8 = 0,
284
- /// Miscellaneous flags.
285
- flags: Flags = .{},
282
+ /// Miscellaneous extra data/flags.
283
+ extra: Extra = .{},
286
284
 
287
- /// Miscellaneous move related flags.
288
- const Flags = packed struct(u8) {
285
+ /// Miscellaneous extra move related data/flags.
286
+ const Extra = packed struct(u8) {
289
287
  /// Whether this move can be called via Metronome.
290
288
  metronome: bool = true,
289
+ /// Whether this move can be called via Sleep Talk.
290
+ sleep_talk: bool = true,
291
291
  /// Whether this move is considered to be "continuous".
292
292
  continuous: bool = false,
293
293
  /// Whether this move can hit a flying target.
294
294
  flying: bool = false,
295
295
  /// Whether this move can hit an underground target.
296
296
  underground: bool = false,
297
-
298
- _: u4 = 0,
297
+ /// Protocol reason offset associated with this move.
298
+ protocol: u3 = 0,
299
299
  };
300
300
 
301
301
  comptime {
@@ -410,7 +410,7 @@ pub const Move = enum(u8) {
410
410
  .type = .Normal,
411
411
  .accuracy = percent(75),
412
412
  .target = .Foes,
413
- .flags = .{ .continuous = true },
413
+ .extra = .{ .sleep_talk = false, .continuous = true },
414
414
  },
415
415
  // SwordsDance
416
416
  .{
@@ -435,7 +435,7 @@ pub const Move = enum(u8) {
435
435
  .type = .Flying,
436
436
  .accuracy = percent(100),
437
437
  .target = .Any,
438
- .flags = .{ .flying = true },
438
+ .extra = .{ .flying = true },
439
439
  },
440
440
  // WingAttack
441
441
  .{
@@ -453,16 +453,16 @@ pub const Move = enum(u8) {
453
453
  .accuracy = percent(100),
454
454
  .target = .Other,
455
455
  .priority = -1,
456
- .flags = .{ .flying = true },
456
+ .extra = .{ .flying = true },
457
457
  },
458
458
  // Fly
459
459
  .{
460
- .effect = .Fly,
460
+ .effect = .FlyDig,
461
461
  .bp = 70,
462
462
  .type = .Flying,
463
463
  .accuracy = percent(95),
464
464
  .target = .Any,
465
- .flags = .{ .continuous = true },
465
+ .extra = .{ .sleep_talk = false, .continuous = true },
466
466
  },
467
467
  // Bind
468
468
  .{
@@ -471,6 +471,7 @@ pub const Move = enum(u8) {
471
471
  .type = .Normal,
472
472
  .accuracy = percent(75),
473
473
  .target = .Other,
474
+ .extra = .{ .protocol = 1 },
474
475
  },
475
476
  // Slam
476
477
  .{
@@ -595,6 +596,7 @@ pub const Move = enum(u8) {
595
596
  .type = .Normal,
596
597
  .accuracy = percent(85),
597
598
  .target = .Other,
599
+ .extra = .{ .protocol = 2 },
598
600
  },
599
601
  // TakeDown
600
602
  .{
@@ -611,7 +613,7 @@ pub const Move = enum(u8) {
611
613
  .type = .Normal,
612
614
  .accuracy = percent(100),
613
615
  .target = .RandomFoe,
614
- .flags = .{ .continuous = true },
616
+ .extra = .{ .continuous = true },
615
617
  },
616
618
  // DoubleEdge
617
619
  .{
@@ -874,7 +876,7 @@ pub const Move = enum(u8) {
874
876
  .accuracy = percent(100),
875
877
  .target = .Depends,
876
878
  .priority = -1,
877
- .flags = .{ .metronome = false },
879
+ .extra = .{ .metronome = false },
878
880
  },
879
881
  // SeismicToss
880
882
  .{
@@ -934,12 +936,12 @@ pub const Move = enum(u8) {
934
936
  },
935
937
  // SolarBeam
936
938
  .{
937
- .effect = .Solarbeam,
939
+ .effect = .SolarBeam,
938
940
  .bp = 120,
939
941
  .type = .Grass,
940
942
  .accuracy = percent(100),
941
943
  .target = .Other,
942
- .flags = .{ .continuous = true },
944
+ .extra = .{ .sleep_talk = false, .continuous = true },
943
945
  },
944
946
  // PoisonPowder
945
947
  .{
@@ -972,7 +974,7 @@ pub const Move = enum(u8) {
972
974
  .type = .Grass,
973
975
  .accuracy = percent(100),
974
976
  .target = .RandomFoe,
975
- .flags = .{ .continuous = true },
977
+ .extra = .{ .continuous = true },
976
978
  },
977
979
  // StringShot
978
980
  .{
@@ -997,6 +999,7 @@ pub const Move = enum(u8) {
997
999
  .type = .Fire,
998
1000
  .accuracy = percent(70),
999
1001
  .target = .Other,
1002
+ .extra = .{ .protocol = 3 },
1000
1003
  },
1001
1004
  // ThunderShock
1002
1005
  .{
@@ -1032,7 +1035,7 @@ pub const Move = enum(u8) {
1032
1035
  .accuracy = percent(70),
1033
1036
  .target = .Other,
1034
1037
  .chance = percent(30),
1035
- .flags = .{ .flying = true },
1038
+ .extra = .{ .flying = true },
1036
1039
  },
1037
1040
  // RockThrow
1038
1041
  .{
@@ -1049,7 +1052,7 @@ pub const Move = enum(u8) {
1049
1052
  .type = .Ground,
1050
1053
  .accuracy = percent(100),
1051
1054
  .target = .AllOthers,
1052
- .flags = .{ .underground = true },
1055
+ .extra = .{ .underground = true },
1053
1056
  },
1054
1057
  // Fissure
1055
1058
  .{
@@ -1058,15 +1061,16 @@ pub const Move = enum(u8) {
1058
1061
  .type = .Ground,
1059
1062
  .accuracy = percent(30),
1060
1063
  .target = .Other,
1061
- .flags = .{ .underground = true },
1064
+ .extra = .{ .underground = true },
1062
1065
  },
1063
1066
  // Dig
1064
1067
  .{
1065
- .effect = .Fly,
1068
+ .effect = .FlyDig,
1066
1069
  .bp = 60,
1067
1070
  .type = .Ground,
1068
1071
  .accuracy = percent(100),
1069
1072
  .target = .Other,
1073
+ .extra = .{ .sleep_talk = false },
1070
1074
  },
1071
1075
  // Toxic
1072
1076
  .{
@@ -1158,7 +1162,7 @@ pub const Move = enum(u8) {
1158
1162
  .type = .Normal,
1159
1163
  .accuracy = percent(100),
1160
1164
  .target = .Other,
1161
- .flags = .{ .metronome = false },
1165
+ .extra = .{ .metronome = false },
1162
1166
  },
1163
1167
  // Screech
1164
1168
  .{
@@ -1279,7 +1283,7 @@ pub const Move = enum(u8) {
1279
1283
  .type = .Normal,
1280
1284
  .accuracy = percent(100),
1281
1285
  .target = .Self,
1282
- .flags = .{ .continuous = true },
1286
+ .extra = .{ .sleep_talk = false, .continuous = true },
1283
1287
  },
1284
1288
  // Metronome
1285
1289
  .{
@@ -1288,7 +1292,7 @@ pub const Move = enum(u8) {
1288
1292
  .type = .Normal,
1289
1293
  .accuracy = percent(100),
1290
1294
  .target = .Self,
1291
- .flags = .{ .metronome = false },
1295
+ .extra = .{ .metronome = false },
1292
1296
  },
1293
1297
  // MirrorMove
1294
1298
  .{
@@ -1374,6 +1378,7 @@ pub const Move = enum(u8) {
1374
1378
  .type = .Water,
1375
1379
  .accuracy = percent(75),
1376
1380
  .target = .Other,
1381
+ .extra = .{ .protocol = 4 },
1377
1382
  },
1378
1383
  // Swift
1379
1384
  .{
@@ -1390,7 +1395,7 @@ pub const Move = enum(u8) {
1390
1395
  .type = .Normal,
1391
1396
  .accuracy = percent(100),
1392
1397
  .target = .Other,
1393
- .flags = .{ .continuous = true },
1398
+ .extra = .{ .sleep_talk = false, .continuous = true },
1394
1399
  },
1395
1400
  // SpikeCannon
1396
1401
  .{
@@ -1496,7 +1501,7 @@ pub const Move = enum(u8) {
1496
1501
  .type = .Flying,
1497
1502
  .accuracy = percent(90),
1498
1503
  .target = .Any,
1499
- .flags = .{ .continuous = true },
1504
+ .extra = .{ .sleep_talk = false, .continuous = true },
1500
1505
  },
1501
1506
  // Transform
1502
1507
  .{
@@ -1678,7 +1683,7 @@ pub const Move = enum(u8) {
1678
1683
  .type = .Normal,
1679
1684
  .accuracy = percent(100),
1680
1685
  .target = .RandomFoe,
1681
- .flags = .{ .metronome = false },
1686
+ .extra = .{ .metronome = false },
1682
1687
  },
1683
1688
  // Sketch
1684
1689
  .{
@@ -1687,7 +1692,7 @@ pub const Move = enum(u8) {
1687
1692
  .type = .Normal,
1688
1693
  .accuracy = percent(100),
1689
1694
  .target = .Other,
1690
- .flags = .{ .metronome = false },
1695
+ .extra = .{ .metronome = false },
1691
1696
  },
1692
1697
  // TripleKick
1693
1698
  .{
@@ -1705,7 +1710,7 @@ pub const Move = enum(u8) {
1705
1710
  .accuracy = percent(100),
1706
1711
  .target = .Other,
1707
1712
  .chance = percent(100),
1708
- .flags = .{ .metronome = false },
1713
+ .extra = .{ .metronome = false },
1709
1714
  },
1710
1715
  // SpiderWeb
1711
1716
  .{
@@ -1822,7 +1827,7 @@ pub const Move = enum(u8) {
1822
1827
  .accuracy = percent(100),
1823
1828
  .target = .Self,
1824
1829
  .priority = 2,
1825
- .flags = .{ .metronome = false },
1830
+ .extra = .{ .metronome = false },
1826
1831
  },
1827
1832
  // MachPunch
1828
1833
  .{
@@ -1924,7 +1929,7 @@ pub const Move = enum(u8) {
1924
1929
  .type = .Ghost,
1925
1930
  .accuracy = percent(100),
1926
1931
  .target = .Self,
1927
- .flags = .{ .metronome = false },
1932
+ .extra = .{ .metronome = false },
1928
1933
  },
1929
1934
  // PerishSong
1930
1935
  .{
@@ -1951,7 +1956,7 @@ pub const Move = enum(u8) {
1951
1956
  .accuracy = percent(100),
1952
1957
  .target = .Self,
1953
1958
  .priority = 2,
1954
- .flags = .{ .metronome = false },
1959
+ .extra = .{ .metronome = false },
1955
1960
  },
1956
1961
  // BoneRush
1957
1962
  .{
@@ -1976,7 +1981,7 @@ pub const Move = enum(u8) {
1976
1981
  .type = .Dragon,
1977
1982
  .accuracy = percent(100),
1978
1983
  .target = .RandomFoe,
1979
- .flags = .{ .continuous = true },
1984
+ .extra = .{ .continuous = true },
1980
1985
  },
1981
1986
  // Sandstorm
1982
1987
  .{
@@ -2002,7 +2007,7 @@ pub const Move = enum(u8) {
2002
2007
  .accuracy = percent(100),
2003
2008
  .target = .Self,
2004
2009
  .priority = 2,
2005
- .flags = .{ .metronome = false },
2010
+ .extra = .{ .metronome = false },
2006
2011
  },
2007
2012
  // Charm
2008
2013
  .{
@@ -2019,7 +2024,7 @@ pub const Move = enum(u8) {
2019
2024
  .type = .Rock,
2020
2025
  .accuracy = percent(90),
2021
2026
  .target = .Other,
2022
- .flags = .{ .continuous = true },
2027
+ .extra = .{ .continuous = true },
2023
2028
  },
2024
2029
  // FalseSwipe
2025
2030
  .{
@@ -2094,7 +2099,7 @@ pub const Move = enum(u8) {
2094
2099
  .type = .Normal,
2095
2100
  .accuracy = percent(100),
2096
2101
  .target = .Self,
2097
- .flags = .{ .metronome = false },
2102
+ .extra = .{ .metronome = false },
2098
2103
  },
2099
2104
  // HealBell
2100
2105
  .{
@@ -2160,7 +2165,7 @@ pub const Move = enum(u8) {
2160
2165
  .type = .Ground,
2161
2166
  .accuracy = percent(100),
2162
2167
  .target = .AllOthers,
2163
- .flags = .{ .underground = true },
2168
+ .extra = .{ .underground = true },
2164
2169
  },
2165
2170
  // DynamicPunch
2166
2171
  .{
@@ -2303,7 +2308,7 @@ pub const Move = enum(u8) {
2303
2308
  .accuracy = percent(100),
2304
2309
  .target = .Foes,
2305
2310
  .chance = percent(20),
2306
- .flags = .{ .flying = true },
2311
+ .extra = .{ .flying = true },
2307
2312
  },
2308
2313
  // RainDance
2309
2314
  .{
@@ -2338,7 +2343,7 @@ pub const Move = enum(u8) {
2338
2343
  .accuracy = percent(100),
2339
2344
  .target = .Depends,
2340
2345
  .priority = -1,
2341
- .flags = .{ .metronome = false },
2346
+ .extra = .{ .metronome = false },
2342
2347
  },
2343
2348
  // PsychUp
2344
2349
  .{
@@ -2399,6 +2404,7 @@ pub const Move = enum(u8) {
2399
2404
  .type = .Water,
2400
2405
  .accuracy = percent(70),
2401
2406
  .target = .Other,
2407
+ .extra = .{ .protocol = 5 },
2402
2408
  },
2403
2409
  // BeatUp
2404
2410
  .{
@@ -2458,7 +2464,7 @@ pub const Move = enum(u8) {
2458
2464
  FixedDamage,
2459
2465
  FlameWheel,
2460
2466
  FlinchChance,
2461
- Fly,
2467
+ FlyDig,
2462
2468
  FocusEnergy,
2463
2469
  ForceSwitch,
2464
2470
  Foresight,
@@ -2521,7 +2527,7 @@ pub const Move = enum(u8) {
2521
2527
  Sleep,
2522
2528
  SleepTalk,
2523
2529
  Snore,
2524
- Solarbeam,
2530
+ SolarBeam,
2525
2531
  SpAtkUp1,
2526
2532
  SpDefDownChance,
2527
2533
  SpDefUp2,
@@ -2554,7 +2560,7 @@ pub const Move = enum(u8) {
2554
2560
  }
2555
2561
 
2556
2562
  /// Whether this effect has a high critical rate.
2557
- pub inline fn isHighCritical(effect: Effect) bool {
2563
+ pub fn isHighCritical(effect: Effect) bool {
2558
2564
  return effect == .HighCritical or effect == .RazorWind;
2559
2565
  }
2560
2566
  };
@@ -2842,8 +2848,22 @@ pub const Move = enum(u8) {
2842
2848
  /// The number of Pokémon moves in this generation.
2843
2849
  pub const size = 251;
2844
2850
 
2851
+ /// Pokémon moves that can be called by Metronome in this generation.
2852
+ pub const METRONOME = init: {
2853
+ var num = 0;
2854
+ var moves: [239]Move = undefined;
2855
+ for (1..Move.size + 1) |i| {
2856
+ if (Move.get(@enumFromInt(i)).extra.metronome) {
2857
+ moves[num] = @enumFromInt(i);
2858
+ num += 1;
2859
+ }
2860
+ }
2861
+ assert(num == moves.len);
2862
+ break :init moves;
2863
+ };
2864
+
2845
2865
  /// Returns the `Data` corresponding to the move.
2846
- pub inline fn get(id: Move) Data {
2866
+ pub fn get(id: Move) Data {
2847
2867
  assert(id != .None);
2848
2868
  return DATA[@intFromEnum(id) - 1];
2849
2869
  }
@@ -1,11 +1,9 @@
1
- //! Code generated by `tools/generate` - manual edits will be overwritten
2
-
3
- const std = @import("std");
1
+ //! Code generated by `tools/generate` - manual edits will be overwritten.
4
2
 
5
3
  const gen2 = @import("../../gen2/data.zig");
4
+ const std = @import("std");
6
5
 
7
6
  const assert = std.debug.assert;
8
-
9
7
  const Stats = gen2.Stats;
10
8
  const Types = gen2.Types;
11
9