Example #1
0
        public void TrainerData_DeserializeWithIVLabel_IVChanges()
        {
            var parent = SetupTrainerTable(0x100, 1);

            parent.WriteValue(4, Model, ViewPort.CurrentChange, 0, "pokemonCount");
            parent.WritePointer(0x80, Model, ViewPort.CurrentChange, 0, "pokemon");
            var teamRun = new TrainerPokemonTeamRun(Model, 0x80, false, new SortedSpan <int>(0x100 + 36));

            Model.ObserveRunWritten(ViewPort.CurrentChange, teamRun);

            var newRun = teamRun.DeserializeRun("1 bulbasaur (IVs=12) ", ViewPort.CurrentChange, false, false);

            Assert.InRange(newRun.ReadValue(Model, 0, "ivSpread"), 12 * 8, 12 * 8 + 7);
        }
 public static TrainerPokemonTeamRun DeserializeRun(this TrainerPokemonTeamRun streamRun, string content, ModelDelta token, bool setDefaultMoves, bool setDefaultItems) => streamRun.DeserializeRun(content, token, setDefaultMoves, setDefaultItems, out var _);