Beispiel #1
0
 private Evo[] getEvo(ReadAndWrite rw, int num)
 {
     //Console.WriteLine(Operation.Hex(rw.getStructOffset(typeof(Evo), evo_table, num * EVO_PER_POKE)));
     rw.Seek(rw.getStructOffset(typeof(Evo), evo_table, num * EVO_PER_POKE));
     for (int x = 0; x < EVO_PER_POKE; x++)
     {
         byte[] data = rw.Br.ReadBytes(8);
         evo[x] = (Evo)StructsUtil.ByteToStruct(data, typeof(Evo));
     }
     return(evo);
 }
Beispiel #2
0
 public void Save(ReadAndWrite rw, int num)
 {
     rw.Seek(rw.getStructOffset(typeof(Evo), evo_table, num * EVO_PER_POKE));
     for (int i = 0; i < EVO_PER_POKE; i++)
     {
         Evo e = evo[i];
         DataGridViewCellCollection cell = grid.Rows[i].Cells;
         e.method    = (byte)(int)cell[0].Value;
         e.padd0     = Operation.ParseByte((string)cell[1].Value);
         e.parameter = (ushort)Operation.ParseShort((string)cell[3].Value);
         e.padd1     = Operation.ParseShort((string)cell[4].Value);
         rw.Bw.Write(StructsUtil.StructToByte(e));
     }
 }