Esempio n. 1
0
        public virtual void Deserialize(ICustomDataInput reader)
        {
            fightId   = reader.ReadInt();
            fightType = reader.ReadSByte();
            if (fightType < 0)
            {
                throw new Exception("Forbidden value on fightType = " + fightType + ", it doesn't respect the following condition : fightType < 0");
            }
            var limit = reader.ReadUShort();

            fightTeams = new FightTeamInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                fightTeams[i] = Types.ProtocolTypeManager.GetInstance <FightTeamInformations>(reader.ReadShort());
                fightTeams[i].Deserialize(reader);
            }
            limit = reader.ReadUShort();
            fightTeamsPositions = new ushort[limit];
            for (int i = 0; i < limit; i++)
            {
                fightTeamsPositions[i] = reader.ReadVarUhShort();
            }
            limit             = reader.ReadUShort();
            fightTeamsOptions = new FightOptionsInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                fightTeamsOptions[i] = new FightOptionsInformations();
                fightTeamsOptions[i].Deserialize(reader);
            }
        }
        public virtual void Deserialize(ICustomDataInput reader)
        {
            fightId   = reader.ReadInt();
            fightType = reader.ReadSByte();
            if (fightType < 0)
            {
                throw new Exception("Forbidden value on fightType = " + fightType + ", it doesn't respect the following condition : fightType < 0");
            }
            fightStart = reader.ReadInt();
            if (fightStart < 0)
            {
                throw new Exception("Forbidden value on fightStart = " + fightStart + ", it doesn't respect the following condition : fightStart < 0");
            }
            fightSpectatorLocked = reader.ReadBoolean();
            var limit = reader.ReadUShort();

            fightTeams = new FightTeamLightInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                fightTeams[i] = new FightTeamLightInformations();
                fightTeams[i].Deserialize(reader);
            }
            limit             = reader.ReadUShort();
            fightTeamsOptions = new FightOptionsInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                fightTeamsOptions[i] = new FightOptionsInformations();
                fightTeamsOptions[i].Deserialize(reader);
            }
        }