示例#1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();


            switch (version)
            {
            //Pix: NOTE: this is non-standard because the saving order was done
            // incorrectly and put on production.  If further changes are made, they
            // should be done the standard way (with 'goto case 1;' for case 2)
            case 1:
            {
                m_Door  = reader.ReadItem() as BaseHouseDoorComponent;
                m_House = reader.ReadItem() as BaseHouse;
                break;
            }

            case 0:
            {
                m_Door  = reader.ReadItem() as BaseHouseDoorComponent;
                m_House = BaseHouse.FindHouseAt(this);
                break;
            }
            }

            /* OLD - bad!
             *                      switch (version)
             *                      {
             *                              case 1:
             *                                      {
             *                                              m_House = reader.ReadItem() as BaseHouse;
             *                                              goto case 0;
             *                                      }
             *                              case 0:
             *                                      {
             *                                              m_Door = reader.ReadItem() as BaseHouseDoorComponent;
             *                                              break;
             *                                      }
             *                      }
             *
             *                      if (version < 1)
             *                              m_House = BaseHouse.FindHouseAt(this);
             */
        }
示例#2
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize (reader);

			int version = reader.ReadInt();

	
			switch (version)
			{
				//Pix: NOTE: this is non-standard because the saving order was done
				// incorrectly and put on production.  If further changes are made, they 
				// should be done the standard way (with 'goto case 1;' for case 2)
				case 1:
				{
					m_Door = reader.ReadItem() as BaseHouseDoorComponent;
					m_House = reader.ReadItem() as BaseHouse;
					break;
				}
				case 0:
				{
					m_Door = reader.ReadItem() as BaseHouseDoorComponent;
	                m_House = BaseHouse.FindHouseAt(this);
					break;
				}
 
			}

/* OLD - bad!
			switch (version)
			{
				case 1:
					{
						m_House = reader.ReadItem() as BaseHouse;
						goto case 0;
					}
				case 0:
					{
						m_Door = reader.ReadItem() as BaseHouseDoorComponent;
						break;
					}
			}

			if (version < 1)
				m_House = BaseHouse.FindHouseAt(this);
*/
 
		}