- spawning and setting up child processes is now handled by
ProcessManager#constructor rather than needing to be done manually for
each module that uses ProcessManager
- direct references to ProcessManager in ProcessWrapper were removed to
prevent dead ProcessWrapper instances from being leaked when hotpatching
- process-manager.js and verifier.js now use Typescript
This is a surprisingly minor refactor considering how many files it
touches, but most of this is only renames.
In terms of file renames:
- `tools.js` is now `sim/dex.js`
- `battle-engine.js` is now `sim/index.js` and its three classes are
in `sim/battle.js`, `sim/side.js`, and `sim/pokemon.js`
- `prng.js` is now `sim/prng.js`
In terms of variable renames:
- `Tools` is now `Dex`
- `BattleEngine` is now `Sim`
- `BattleEngine.Battle` is now `Sim.Battle`
- `BattleEngine.BattleSide` is now `Sim.Side`
- `BattleEngine.BattlePokemon` is now `Sim.Pokemon`
Currently TypeScript is validating tools.js and is not particularly
strict about anything and we use 'any' a lot and it's not part of
'npm test' yet, but everything has to start somewhere!
tools.js has also been refactored majorly to use accessors rather
than loader functions. This basically means you don't need to do
Tools.includeData() or anything like that anymore. The new system is
also easier to make TypeScript-compatible.
See #3278
Across PS, in most places we use <br /> - however, in some other places we used <br> and in some <br/>. This standardizes that to simply be <br />, since that's what we use in the majority of places.
It now accepts a generation parameter, as well as "pentagon", as
options before the pokemon species.
In addition to making it easier to remember the syntax and supporting
pentagon checks, this also allows /learnall to be used in past gens.
e.g.
`/learn pentagon, mence, dd`
will show:
> In Gen 7, Salamence can learn Dragon Dance only when obtained from:
> gen 7 egg: axew, dragonair, dragonite, dratini, ...
`/learn gen3, mence, dd`
will show:
> In Gen 3, Salamence can learn Dragon Dance only when obtained from:
> gen 3 egg: altaria, charmander, dragonair, dragonite, ...
> gen 3 event: 1 salamence