Beispiel #1
0
        public override void Serialize(IDataWriter writer)
        {
            base.Serialize(writer);
            writer.WriteShort(((short)(m_doorsOnMap.Count)));
            int doorsOnMapIndex;

            for (doorsOnMapIndex = 0; (doorsOnMapIndex < m_doorsOnMap.Count); doorsOnMapIndex = (doorsOnMapIndex + 1))
            {
                writer.WriteInt(m_doorsOnMap[doorsOnMapIndex]);
            }
            writer.WriteShort(((short)(m_houseInstances.Count)));
            int houseInstancesIndex;

            for (houseInstancesIndex = 0; (houseInstancesIndex < m_houseInstances.Count); houseInstancesIndex = (houseInstancesIndex + 1))
            {
                HouseInstanceInformations objectToSend = m_houseInstances[houseInstancesIndex];
                objectToSend.Serialize(writer);
            }
        }
Beispiel #2
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            int doorsOnMapCount = reader.ReadUShort();
            int doorsOnMapIndex;

            m_doorsOnMap = new System.Collections.Generic.List <int>();
            for (doorsOnMapIndex = 0; (doorsOnMapIndex < doorsOnMapCount); doorsOnMapIndex = (doorsOnMapIndex + 1))
            {
                m_doorsOnMap.Add(reader.ReadInt());
            }
            int houseInstancesCount = reader.ReadUShort();
            int houseInstancesIndex;

            m_houseInstances = new System.Collections.Generic.List <HouseInstanceInformations>();
            for (houseInstancesIndex = 0; (houseInstancesIndex < houseInstancesCount); houseInstancesIndex = (houseInstancesIndex + 1))
            {
                HouseInstanceInformations objectToAdd = new HouseInstanceInformations();
                objectToAdd.Deserialize(reader);
                m_houseInstances.Add(objectToAdd);
            }
        }