当前位置: 首页>>代码示例>>C#>>正文


C# Multis.HouseFoundation类代码示例

本文整理汇总了C#中Server.Multis.HouseFoundation的典型用法代码示例。如果您正苦于以下问题:C# HouseFoundation类的具体用法?C# HouseFoundation怎么用?C# HouseFoundation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HouseFoundation类属于Server.Multis命名空间,在下文中一共展示了HouseFoundation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtractCustomMulti

        private void ExtractCustomMulti(HouseFoundation house)
        {
            _extractedMultiIds.Add(house.Serial.Value);

            for(int x=0; x < house.Components.Width; ++x)
            {
                for(int y=0; y < house.Components.Height; ++y)
                {
                    Tile[] tiles = house.Components.Tiles[x][y];

                    for ( int i = 0; i < tiles.Length; ++i )
                    {
                        DesignItem designItem = new DesignItem();
                        designItem.ItemID = (short)(tiles[i].ID ^ 0x4000);

                        designItem.X = x + house.Sign.Location.X;
                        designItem.Y = (y + house.Sign.Location.Y) - (house.Components.Height - 1);
                        designItem.Z = house.Location.Z + tiles[i].Z;

                        _items.Add(designItem);
                    }

                }
            }

            DesignItem sign = new DesignItem();
            sign.ItemID = (short)(house.Sign.ItemID);

            sign.X = house.Sign.Location.X;
            sign.Y = house.Sign.Location.Y;
            sign.Z = house.Sign.Location.Z;

            _items.Add(sign);
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:34,代码来源:ExtractItemsRequest.cs

示例2: BeginHouseCustomization

        public BeginHouseCustomization( HouseFoundation house )
            : base(0xBF)
        {
            EnsureCapacity( 17 );

            m_Stream.Write( (short) 0x20 );
            m_Stream.Write( (int) house.Serial );
            m_Stream.Write( (byte) 0x04 );
            m_Stream.Write( (ushort) 0x0000 );
            m_Stream.Write( (ushort) 0xFFFF );
            m_Stream.Write( (ushort) 0xFFFF );
            m_Stream.Write( (byte) 0xFF );
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:13,代码来源:HouseFoundation.cs

示例3: ConfirmCommitGump

        public ConfirmCommitGump( Mobile from, HouseFoundation foundation, int bankBalance, int oldPrice, int newPrice )
            : base(50, 50)
        {
            m_Foundation = foundation;

            AddPage( 0 );

            AddBackground( 0, 0, 320, 320, 5054 );

            AddImageTiled( 10, 10, 300, 20, 2624 );
            AddImageTiled( 10, 40, 300, 240, 2624 );
            AddImageTiled( 10, 290, 300, 20, 2624 );

            AddAlphaRegion( 10, 10, 300, 300 );

            AddHtmlLocalized( 10, 10, 300, 20, 1062060, 32736, false, false ); // <CENTER>COMMIT DESIGN</CENTER>

            AddHtmlLocalized( 10, 40, 300, 140, (newPrice - oldPrice) <= bankBalance ? 1061898 : 1061903, 1023, false, true );

            AddHtmlLocalized( 10, 190, 150, 20, 1061902, 32736, false, false ); // Bank Balance:
            AddLabel( 170, 190, 55, bankBalance.ToString() );

            AddHtmlLocalized( 10, 215, 150, 20, 1061899, 1023, false, false ); // Old Value:
            AddLabel( 170, 215, 90, oldPrice.ToString() );

            AddHtmlLocalized( 10, 235, 150, 20, 1061900, 1023, false, false ); // Cost To Commit:
            AddLabel( 170, 235, 90, newPrice.ToString() );

            if ( newPrice - oldPrice < 0 )
            {
                AddHtmlLocalized( 10, 260, 150, 20, 1062059, 992, false, false ); // Your Refund:
                AddLabel( 170, 260, 70, (oldPrice - newPrice).ToString() );
            }
            else
            {
                AddHtmlLocalized( 10, 260, 150, 20, 1061901, 31744, false, false ); // Your Cost:
                AddLabel( 170, 260, 40, (newPrice - oldPrice).ToString() );
            }

            AddButton( 10, 290, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 45, 290, 55, 20, 1011036, 32767, false, false ); // OKAY

            AddButton( 170, 290, 4005, 4007, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 195, 290, 55, 20, 1011012, 32767, false, false ); // CANCEL
        }
开发者ID:Godkong,项目名称:Origins,代码行数:45,代码来源:HouseFoundation.cs

示例4: ProcessInsert

        public static DesignInsertResult ProcessInsert(Item item, bool staticsOnly, out HouseFoundation house)
        {
            house = null;

            if (item == null || item is BaseMulti || item is HouseSign || (staticsOnly && !(item is Static)))
                return DesignInsertResult.InvalidItem;

            house = BaseHouse.FindHouseAt(item) as HouseFoundation;

            if (house == null)
                return DesignInsertResult.NotInHouse;

            int x = item.X - house.X;
            int y = item.Y - house.Y;
            int z = item.Z - house.Z;

            if (!TryInsertIntoState(house.CurrentState, item.ItemID, x, y, z))
                return DesignInsertResult.OutsideHouseBounds;

            TryInsertIntoState(house.DesignState, item.ItemID, x, y, z);
            item.Delete();

            return DesignInsertResult.Valid;
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:24,代码来源:DesignInsert.cs

示例5: DesignState

        public DesignState( HouseFoundation foundation, GenericReader reader )
        {
            m_Foundation = foundation;

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Components = new MultiComponentList( reader );

                    int length = reader.ReadInt();

                    m_Fixtures = new MultiTileEntry[length];

                    for ( int i = 0; i < length; ++i )
                    {
                        m_Fixtures[i].m_ItemID = reader.ReadShort();
                        m_Fixtures[i].m_OffsetX = reader.ReadShort();
                        m_Fixtures[i].m_OffsetY = reader.ReadShort();
                        m_Fixtures[i].m_OffsetZ = reader.ReadShort();
                        m_Fixtures[i].m_Flags = reader.ReadInt();
                    }

                    m_Revision = reader.ReadInt();

                    break;
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:31,代码来源:HouseFoundation.cs

示例6: OnTarget

            protected override void OnTarget( Mobile from, object obj )
            {
                Item item = obj as Item;

                if ( item == null )
                {
                    from.Target = new DesignInsertTarget( m_Foundation );
                    from.SendMessage( "That is not an item. Try again." );
                }
                else
                {
                    HouseFoundation house = BaseHouse.FindHouseAt( item ) as HouseFoundation;

                    if ( house == null )
                    {
                        from.Target = new DesignInsertTarget( m_Foundation );
                        from.SendMessage( "That item is not inside a customizable house. Try again." );
                    }
                    else if ( m_Foundation != null && house != m_Foundation )
                    {
                        from.Target = new DesignInsertTarget( m_Foundation );
                        from.SendMessage( "That item is not inside the current house; all targeted items must reside in the same house. You may cancel this target and repeat the command." );
                    }
                    else
                    {
                        DesignState state = house.CurrentState;
                        MultiComponentList mcl = state.Components;

                        int x = item.X - house.X;
                        int y = item.Y - house.Y;
                        int z = item.Z - house.Z;

                        if ( x >= mcl.Min.X && y >= mcl.Min.Y && x <= mcl.Max.X && y <= mcl.Max.Y )
                        {
                            mcl.Add( item.ItemID, x, y, z );
                            item.Delete();

                            state.OnRevised();

                            state = house.DesignState;
                            mcl = state.Components;

                            if ( x >= mcl.Min.X && y >= mcl.Min.Y && x <= mcl.Max.X && y <= mcl.Max.Y )
                            {
                                mcl.Add( item.ItemID, x, y, z );
                                state.OnRevised();
                            }

                            from.Target = new DesignInsertTarget( house );

                            if ( m_Foundation == null )
                                from.SendMessage( "The item has been inserted into the house design. Press ESC when you are finished." );
                            else
                                from.SendMessage( "The item has been inserted into the house design." );

                            m_Foundation = house;
                        }
                        else
                        {
                            from.Target = new DesignInsertTarget( m_Foundation );
                            from.SendMessage( "That item is not inside a customizable house. Try again." );
                        }
                    }
                }
            }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:65,代码来源:HouseFoundation.cs

示例7: DesignInsertTarget

 public DesignInsertTarget( HouseFoundation foundation )
     : base(-1, false, TargetFlags.None)
 {
     m_Foundation = foundation;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:5,代码来源:HouseFoundation.cs

示例8: SendQueueEntry

            public SendQueueEntry( NetState ns, HouseFoundation foundation, DesignState state )
            {
                m_NetState = ns;
                m_Serial = foundation.Serial;
                m_Revision = state.Revision;
                m_Root = state;

                MultiComponentList mcl = state.Components;

                m_xMin = mcl.Min.X;
                m_yMin = mcl.Min.Y;
                m_xMax = mcl.Max.X;
                m_yMax = mcl.Max.Y;

                m_Tiles = mcl.List;
            }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:16,代码来源:HouseFoundation.cs

示例9: GetZLevel

		public static int GetZLevel( int z, HouseFoundation house )
		{
			int level = (z - 7)/20 +1;

			if( level < 1 || level > house.MaxLevels )
				level = 1;

			return level;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:9,代码来源:HouseFoundation.cs

示例10: GetLevelZ

		public static int GetLevelZ( int level, HouseFoundation house )
		{
			if( level < 1 || level > house.MaxLevels )
				level = 1;

			return (level-1)*20 + 7;

			/*
			switch( level )
			{
				default:
				case 1: return 07;
				case 2: return 27;
				case 3: return 47;
				case 4: return 67;
			}
			 * */
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:18,代码来源:HouseFoundation.cs

示例11: ConfirmCommitGump

		public ConfirmCommitGump( Mobile from, HouseFoundation foundation, int bankBalance, int oldPrice, int newPrice )
			: base( 50, 50 )
		{
			m_Foundation = foundation;

			int cost = newPrice - oldPrice;
			bool canAfford = cost <= bankBalance;

			AddPage( 0 );

			AddBackground( 0, 0, 320, 320, 5054 );

			AddImageTiled( 10, 10, 300, 20, 2624 );
			AddImageTiled( 10, 40, 300, 240, 2624 );
			AddImageTiled( 10, 290, 300, 20, 2624 );

			AddAlphaRegion( 10, 10, 300, 300 );

			AddHtmlLocalized( 10, 10, 300, 20, 1062060, 32736, false, false ); // <CENTER>COMMIT DESIGN</CENTER>

			AddHtmlLocalized( 10, 190, 150, 20, 1061902, 32736, false, false ); // Bank Balance:
			AddLabel( 170, 190, 55, bankBalance.ToString() );

			AddHtmlLocalized( 10, 215, 150, 20, 1061899, 1023, false, false ); // Old Value:
			AddLabel( 170, 215, 90, oldPrice.ToString() );

			AddHtmlLocalized( 10, 235, 150, 20, 1061900, 1023, false, false ); // Cost To Commit:
			AddLabel( 170, 235, 90, newPrice.ToString() );

			AddButton( 170, 290, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 195, 290, 55, 20, 1011012, 32767, false, false ); // CANCEL

			if ( canAfford )
			{
				AddHtmlLocalized( 10, 40, 300, 140, 1061898, 0x3FF, false, true );

				AddButton( 10, 290, 4005, 4007, 1, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 45, 290, 55, 20, 1011036, 32767, false, false ); // OKAY
			}
			else
			{
				AddHtmlLocalized( 10, 40, 300, 140, 1061903, 0x7C00, false, true );
			}

			if ( cost >= 0 )
			{
				AddHtmlLocalized( 10, 260, 150, 20, 1061901, 0x7C00, false, false ); // Your Cost:
				AddLabel( 170, 260, 40, cost.ToString() );
			}
			else
			{
				AddHtmlLocalized( 10, 260, 150, 20, 1062059, 0x3E0, false, false ); // Your Refund:
				AddLabel( 170, 260, 70, ( -cost ).ToString() );
			}
		}
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:55,代码来源:HouseFoundation.cs

示例12: GetLevelZ

		public static int GetLevelZ( int level, HouseFoundation house )
		{
			if ( level < 1 || level > house.MaxLevels )
				level = 1;

			return ( level - 1 ) * 20 + 7;
		}
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:7,代码来源:HouseFoundation.cs

示例13: EndHouseCustomization

        public EndHouseCustomization(HouseFoundation house)
            : base(0xBF)
        {
            this.EnsureCapacity(17);

            this.m_Stream.Write((short)0x20);
            this.m_Stream.Write((int)house.Serial);
            this.m_Stream.Write((byte)0x05);
            this.m_Stream.Write((ushort)0x0000);
            this.m_Stream.Write((ushort)0xFFFF);
            this.m_Stream.Write((ushort)0xFFFF);
            this.m_Stream.Write((byte)0xFF);
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:13,代码来源:HouseFoundation.cs

示例14: SendDetails

 public static void SendDetails( NetState ns, HouseFoundation house, DesignState state )
 {
     m_SendQueue.Enqueue( new SendQueueEntry( ns, house, state ) );
     m_Sync.Set();
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:5,代码来源:HouseFoundation.cs

示例15: DesignContext

 public DesignContext( HouseFoundation foundation )
 {
     m_Foundation = foundation;
     m_Level = 1;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:5,代码来源:HouseFoundation.cs


注:本文中的Server.Multis.HouseFoundation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。