mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-10 06:01:05 -05:00
36 lines
778 B
C#
36 lines
778 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace DSPRE.ROMFiles
|
|
{
|
|
public class SafariZoneEncounter
|
|
{
|
|
public ushort pokemonID;
|
|
public byte level;
|
|
public SafariZoneEncounter() {
|
|
level = 1;
|
|
pokemonID = 0;
|
|
}
|
|
|
|
public SafariZoneEncounter(BinaryReader br) {
|
|
readEncounter(br);
|
|
}
|
|
|
|
public void readEncounter(BinaryReader br) {
|
|
this.pokemonID = br.ReadUInt16();
|
|
this.level = br.ReadByte();
|
|
}
|
|
|
|
public void writeEncounter(BinaryWriter bw) {
|
|
bw.Write((UInt16)pokemonID);
|
|
bw.Write((byte)level);
|
|
}
|
|
|
|
public override string ToString() {
|
|
string[] pokemonNames = RomInfo.GetPokemonNames();
|
|
string pokemon = pokemonNames[pokemonID];
|
|
return $"{pokemonID,4} {pokemon,10}: {level,3}";
|
|
}
|
|
}
|
|
}
|