Ejemplo n.º 1
0
        public CompetitionKind loadCompetitionKind(int selectIndex, MemoryStream memory1, BinaryReader reader)
        {
            CompetitionKind comp = new CompetitionKind();

            UInt32 Pos_ini = (uint)(selectIndex * block);

            reader.BaseStream.Position = Pos_ini;
            byte Order = reader.ReadByte();

            byte Byte_imp = reader.ReadByte();
            byte UNK1     = (byte)(Byte_imp >> 6);

            byte UNK2 = (byte)(Byte_imp << 2);

            UNK2 = (byte)(UNK2 >> 5);

            byte UNK3 = (byte)(Byte_imp << 5);

            UNK3 = (byte)(UNK3 >> 5);

            comp.setOrder(Order);
            comp.setUnk1(UNK1);
            comp.setUnk2(UNK2);
            comp.setUnk3(UNK3);

            return(comp);
        }
Ejemplo n.º 2
0
        public void applyCompetitionKind(int selectedIndex, MemoryStream unzlib, CompetitionKind comp, ref BinaryWriter writer)
        {
            UInt32 Pos_ini = (uint)(selectedIndex * block);

            writer.BaseStream.Position = Pos_ini;
            byte Order    = comp.getOrder();
            byte Byte_imp = 0;
            byte UNK1     = comp.getUnk1();
            byte UNK2     = comp.getUnk2();
            byte UNK3     = comp.getUnk3();
            byte Aux_byte = (byte)(UNK1 << 6);

            Byte_imp = (byte)(Aux_byte | Byte_imp);
            Aux_byte = (byte)(UNK2 << 3);
            Byte_imp = (byte)(Aux_byte | Byte_imp);
            Aux_byte = UNK3;
            Byte_imp = (byte)(Aux_byte | Byte_imp);

            writer.Write(Order);
            writer.Write(Byte_imp);
        }