示例#1
0
 public override void Deserialize(IDataReader reader)
 {
     mapId = reader.ReadInt();
     if (mapId < 0)
     {
         throw new Exception("Forbidden value on mapId = " + mapId + ", it doesn't respect the following condition : mapId < 0");
     }
     fightStartPositions = new Types.FightStartingPositions();
     fightStartPositions.Deserialize(reader);
 }
        public override void Deserialize(IDataReader reader)
        {
            subAreaId = reader.ReadVarUhShort();
            mapId     = reader.ReadDouble();
            var limit = (ushort)reader.ReadUShort();

            houses = new Types.HouseInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                houses[i] = ProtocolTypeManager.GetInstance <Types.HouseInformations>(reader.ReadUShort());
                houses[i].Deserialize(reader);
            }
            limit  = (ushort)reader.ReadUShort();
            actors = new Types.GameRolePlayActorInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                actors[i] = ProtocolTypeManager.GetInstance <Types.GameRolePlayActorInformations>(reader.ReadUShort());
                actors[i].Deserialize(reader);
            }
            limit = (ushort)reader.ReadUShort();
            interactiveElements = new Types.InteractiveElement[limit];
            for (int i = 0; i < limit; i++)
            {
                interactiveElements[i] = ProtocolTypeManager.GetInstance <Types.InteractiveElement>(reader.ReadUShort());
                interactiveElements[i].Deserialize(reader);
            }
            limit          = (ushort)reader.ReadUShort();
            statedElements = new Types.StatedElement[limit];
            for (int i = 0; i < limit; i++)
            {
                statedElements[i] = new Types.StatedElement();
                statedElements[i].Deserialize(reader);
            }
            limit     = (ushort)reader.ReadUShort();
            obstacles = new Types.MapObstacle[limit];
            for (int i = 0; i < limit; i++)
            {
                obstacles[i] = new Types.MapObstacle();
                obstacles[i].Deserialize(reader);
            }
            limit  = (ushort)reader.ReadUShort();
            fights = new Types.FightCommonInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                fights[i] = new Types.FightCommonInformations();
                fights[i].Deserialize(reader);
            }
            hasAggressiveMonsters = reader.ReadBoolean();
            fightStartPositions   = new Types.FightStartingPositions();
            fightStartPositions.Deserialize(reader);
        }
 public override void Deserialize(IReader reader)
 {
     mapId = reader.ReadInt();
     fightStartPositions = new Types.FightStartingPositions();
     fightStartPositions.Deserialize(reader);
 }
        public override void Deserialize(IDataReader reader)
        {
            subAreaId = reader.ReadVarShort();
            if (subAreaId < 0)
            {
                throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
            }
            mapId = reader.ReadInt();
            if (mapId < 0)
            {
                throw new Exception("Forbidden value on mapId = " + mapId + ", it doesn't respect the following condition : mapId < 0");
            }
            var limit   = reader.ReadShort();
            var houses_ = new HouseInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                houses_[i] = Types.ProtocolTypeManager.GetInstance <HouseInformations>(reader.ReadShort());
                houses_[i].Deserialize(reader);
            }
            houses = houses_;
            limit  = reader.ReadShort();
            var actors_ = new GameRolePlayActorInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                actors_[i] = Types.ProtocolTypeManager.GetInstance <GameRolePlayActorInformations>(reader.ReadShort());
                actors_[i].Deserialize(reader);
            }
            actors = actors_;
            limit  = reader.ReadShort();
            var interactiveElements_ = new InteractiveElement[limit];

            for (int i = 0; i < limit; i++)
            {
                interactiveElements_[i] = Types.ProtocolTypeManager.GetInstance <InteractiveElement>(reader.ReadShort());
                interactiveElements_[i].Deserialize(reader);
            }
            interactiveElements = interactiveElements_;
            limit = reader.ReadShort();
            var statedElements_ = new Types.StatedElement[limit];

            for (int i = 0; i < limit; i++)
            {
                statedElements_[i] = new Types.StatedElement();
                statedElements_[i].Deserialize(reader);
            }
            statedElements = statedElements_;
            limit          = reader.ReadShort();
            var obstacles_ = new Types.MapObstacle[limit];

            for (int i = 0; i < limit; i++)
            {
                obstacles_[i] = new Types.MapObstacle();
                obstacles_[i].Deserialize(reader);
            }
            obstacles = obstacles_;
            limit     = reader.ReadShort();
            var fights_ = new Types.FightCommonInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                fights_[i] = new Types.FightCommonInformations();
                fights_[i].Deserialize(reader);
            }
            fights = fights_;
            hasAggressiveMonsters = reader.ReadBoolean();
            fightStartPositions   = new Types.FightStartingPositions();
            fightStartPositions.Deserialize(reader);
        }