@pkmn/engine 0.1.0-dev.d716e940 → 0.1.0-dev.fb5bf955

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.
@@ -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 MAX_CHOICES: usize = 9; // move 1..4, switch 2..6
22
+ pub const MAX_OPTIONS: usize = 9; // move 1..4, switch 2..6
23
23
  pub const MAX_LOGS: usize = 180; // TODO
24
24
 
25
- pub const CHOICES_SIZE = if (builtin.mode == .ReleaseSmall)
26
- MAX_CHOICES
25
+ pub const OPTIONS_SIZE = if (builtin.mode == .ReleaseSmall)
26
+ MAX_OPTIONS
27
27
  else
28
- std.math.ceilPowerOfTwo(usize, MAX_CHOICES) catch unreachable;
28
+ std.math.ceilPowerOfTwo(usize, MAX_OPTIONS) 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 MAX_CHOICES = gen1.MAX_CHOICES;
7
+ pub const MAX_OPTIONS = gen1.MAX_OPTIONS;
8
8
  /// The optimal size in bytes required to hold all choice options.
9
- /// At least as large as `MAX_CHOICES`.
10
- pub const CHOICES_SIZE = gen1.CHOICES_SIZE;
9
+ /// At least as large as `MAX_OPTIONS`.
10
+ pub const OPTIONS_SIZE = gen1.OPTIONS_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
@@ -25,12 +25,12 @@ pub const Result = @import("common/data.zig").Result;
25
25
  /// Pokémon Showdown's RNG (backed by a Generation V & VI RNG).
26
26
  pub const PSRNG = @import("common/rng.zig").PSRNG;
27
27
 
28
- /// Namespace for helpers related to protocol message logging.
28
+ /// Namespace for helpers related to protocol trace logging.
29
29
  pub const protocol = if (options.internal) struct {
30
30
  pub usingnamespace @import("common/protocol.zig");
31
31
  } else struct {
32
32
  /// Logs protocol information to its `Writer` during a battle update when
33
- /// `options.log` is enabled.
33
+ /// `options.trace` is enabled.
34
34
  pub const Log = @import("common/protocol.zig").Log;
35
35
  /// Stripped down version of `std.io.FixedBufferStream` optimized for
36
36
  /// efficiently writing the individual protocol bytes. Note that the
@@ -41,8 +41,8 @@ pub const protocol = if (options.internal) struct {
41
41
  /// intialized with a `LOGS_SIZE`-sized buffer.
42
42
  pub const FixedLog = @import("common/protocol.zig").FixedLog;
43
43
  /// Null object pattern implementation of `Log` backed by a
44
- /// `std.io.null_writer`. Ignores anything sent to it, though protocol
45
- /// logging should additionally be turned off entirely with `options.log`.
44
+ /// `std.io.null_writer`. Ignores anything sent to it, though trace logging
45
+ /// should addtionally be turned off entirely by using `options.trace`.
46
46
  pub const NULL = @import("common/protocol.zig").NULL;
47
47
  };
48
48