public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
            {
                OnItemId  = reader.ReadInt();
                OffItemId = reader.ReadInt();
                goto case 2;
            }

            case 2:
            {
                m_Disabled = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_LinkedItem = reader.ReadItem();
                goto case 0;
            }

            case 0:
            {
                m_LeverState = reader.ReadInt();
                m_LeverSound = reader.ReadInt();
                int ltype = reader.ReadInt();
                switch (ltype)
                {
                case (int)leverType.Two_State: m_LeverType = leverType.Two_State; break;

                case (int)leverType.Three_State: m_LeverType = leverType.Three_State; break;
                }
                m_TargetItem0     = reader.ReadItem();
                m_TargetProperty0 = reader.ReadString();
                m_TargetItem1     = reader.ReadItem();
                m_TargetProperty1 = reader.ReadString();
                m_TargetItem2     = reader.ReadItem();
                m_TargetProperty2 = reader.ReadString();
            }
            break;
            }
        }
Exemple #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                this.m_Disabled = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                this.m_LinkedItem = reader.ReadItem();
                goto case 0;
            }

            case 0:
            {
                this.m_LeverSound = reader.ReadInt();
                int ltype = reader.ReadInt();
                switch (ltype)
                {
                case (int)leverType.Two_State:
                    this.m_LeverType = leverType.Two_State;
                    break;

                case (int)leverType.Three_State:
                    this.m_LeverType = leverType.Three_State;
                    break;
                }
                this.m_TargetItem0     = reader.ReadItem();
                this.m_TargetProperty0 = reader.ReadString();
                this.m_TargetItem1     = reader.ReadItem();
                this.m_TargetProperty1 = reader.ReadString();
                this.m_TargetItem2     = reader.ReadItem();
                this.m_TargetProperty2 = reader.ReadString();
            }
            break;
            }
            // refresh the lever static to reflect the state
            this.SetLeverStatic();
        }
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();
			switch (version)
			{
                case 3:
			        {
			            OnItemId = reader.ReadInt();
			            OffItemId = reader.ReadInt();
			            goto case 2;
			        }
				case 2:
					{
						m_Disabled = reader.ReadBool();
						goto case 1;
					}
				case 1:
					{
						m_LinkedItem = reader.ReadItem();
						goto case 0;
					}
				case 0:
					{
						m_LeverState = reader.ReadInt();
						m_LeverSound = reader.ReadInt();
						int ltype = reader.ReadInt();
						switch (ltype)
						{
							case (int)leverType.Two_State: m_LeverType = leverType.Two_State; break;
							case (int)leverType.Three_State: m_LeverType = leverType.Three_State; break;

						}
						m_TargetItem0 = reader.ReadItem();
						m_TargetProperty0 = reader.ReadString();
						m_TargetItem1 = reader.ReadItem();
						m_TargetProperty1 = reader.ReadString();
						m_TargetItem2 = reader.ReadItem();
						m_TargetProperty2 = reader.ReadString();
					}
					break;
			}
		}
Exemple #4
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			switch ( version )
			{
				case 2:
					{
						m_Disabled = reader.ReadBool();
						goto case 1;
					}
				case 1:
					{
						m_LinkedItem = reader.ReadItem();
						goto case 0;
					}
				case 0:
				{
					this.m_LeverSound = reader.ReadInt();
					int ltype = reader.ReadInt();
					switch( ltype )
					{
						case (int)leverType.Two_State:		this.m_LeverType = leverType.Two_State;	break;
						case (int)leverType.Three_State:	this.m_LeverType = leverType.Three_State;	break;
                      
					}
					this.m_TargetItem0 = reader.ReadItem();
					this.m_TargetProperty0 = reader.ReadString();
					this.m_TargetItem1 = reader.ReadItem();
					this.m_TargetProperty1 = reader.ReadString();
					this.m_TargetItem2 = reader.ReadItem();
					this.m_TargetProperty2 = reader.ReadString();
				}
					break;
			}
			// refresh the lever static to reflect the state
			SetLeverStatic();
		}