Exemple #1
0
        public LeverPuzzleController()
            : base(0x1822)
        {
            this.Movable = false;
            this.Hue     = 0x4c;
            installed    = true;
            int i = 0;

            this.m_Levers = new List <Item>();   /* codes are 0x1 shifted left x # of bits, easily handled here */
            for (; i < 4; i++)
            {
                this.m_Levers.Add(AddLeverPuzzlePart(TA[i], new LeverPuzzleLever((ushort)(1 << i), this)));
            }

            this.m_Tiles = new List <LeverPuzzleRegion>();
            for (; i < 9; i++)
            {
                this.m_Tiles.Add(new LeverPuzzleRegion(this, TA[i]));
            }

            this.m_Teles = new List <Item>();
            for (; i < 15; i++)
            {
                this.m_Teles.Add(AddLeverPuzzlePart(TA[i], new LampRoomTeleporter(TA[++i])));
            }

            this.m_Statues = new List <Item>();
            for (; i < 19; i++)
            {
                this.m_Statues.Add(AddLeverPuzzlePart(TA[i], new LeverPuzzleStatue(TA[++i], this)));
            }

            if (!installed)
            {
                this.Delete();
            }
            else
            {
                this.Enabled = true;
            }

            this.m_Box      = (LampRoomBox)AddLeverPuzzlePart(TA[i], new LampRoomBox(this));
            this.m_LampRoom = new LampRoomRegion(this);
            this.GenKey();
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            _ = reader.ReadInt();

            m_Levers  = reader.ReadStrongItemList();
            m_Statues = reader.ReadStrongItemList();
            m_Teles   = reader.ReadStrongItemList();

            m_Box = reader.ReadItem() as LampRoomBox;

            m_Tiles = new List <LeverPuzzleRegion>();
            for (int i = 4; i < 9; i++)
            {
                m_Tiles.Add(new LeverPuzzleRegion(this, TA[i]));
            }

            m_LampRoom = new LampRoomRegion(this);
            Enabled    = true;
            TheirKey   = 0;
            MyKey      = 0;
            GenKey();
        }
		public LeverPuzzleController() : base( 0x1822 )
		{
			Movable=false;
			Hue=0x4c;
			installed=true;
			int i=0;

			m_Levers = new List<Item>();	/* codes are 0x1 shifted left x # of bits, easily handled here */
			for (; i<4; i++)
				m_Levers.Add( AddLeverPuzzlePart( TA[i], new LeverPuzzleLever( (ushort)(1<<i), this )));

			m_Tiles = new List<LeverPuzzleRegion>();
			for (; i<9; i++)
				m_Tiles.Add( new LeverPuzzleRegion( this, TA[i] ));

			m_Teles = new List<Item>();
			for (; i<15; i++)
                m_Teles.Add(AddLeverPuzzlePart(TA[i], new LampRoomTeleporter(TA[++i])));

			m_Statues = new List<Item>();
			for (; i<19; i++)
				m_Statues.Add( AddLeverPuzzlePart( TA[i], new LeverPuzzleStatue( TA[++i], this )));

			if(!installed)
				Delete();
			else
				Enabled=true;

			m_Box = (LampRoomBox)AddLeverPuzzlePart( TA[i], new LampRoomBox( this ));
			m_LampRoom = new LampRoomRegion( this );
			GenKey();
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Levers = reader.ReadStrongItemList();
			m_Statues = reader.ReadStrongItemList();
			m_Teles = reader.ReadStrongItemList();

			m_Box = reader.ReadItem() as LampRoomBox;

			m_Tiles = new List<LeverPuzzleRegion>();
			for (int i = 4; i<9; i++)
				m_Tiles.Add( new LeverPuzzleRegion( this, TA[i] ));

			m_LampRoom = new LampRoomRegion( this );
			m_Enabled = true;
			m_TheirKey = 0;
			m_MyKey = 0;
			GenKey();
		}