Server.Items.InteriorDecorator.CheckUse C# (CSharp) Méthode

CheckUse() public static méthode

public static CheckUse ( Server.Mobile from ) : bool
from Server.Mobile
Résultat bool
		public static bool CheckUse( Mobile from )
		{
			if ( !InHouse( from ) )
				from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
			else
				return true;

			return false;
		}

Usage Example

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item && InteriorDecorator.CheckUse(m_Decorator, from))
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);
                    Item      item  = (Item)targeted;

                    bool isDecorableComponent = false;

                    if (item is AddonComponent)
                    {
                        if (((AddonComponent)item).Addon.Components.Count == 1 && Core.SE)
                        {
                            isDecorableComponent = true;
                        }
                    }

                    if (house == null || !house.IsKeyOwner(from))
                    {
                        from.SendAsciiMessage("You must be in your house to do this.");                           // You must be in your house to do this.
                    }
                    else if (item.Parent != null || !house.IsInside(item))
                    {
                        from.SendAsciiMessage("That is not in your house.");                           // That is not in your house.
                    }
                    else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Up)
                    {
                        from.SendLocalizedMessage("You cannot raise it up any higher.");   // You cannot raise it up any higher.
                    }
                    else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Down)
                    {
                        from.SendLocalizedMessage("You cannot lower it down any further.");   // You cannot lower it down any further.
                    }
                    else if (item is VendorRentalContract)
                    {
                        from.SendLocalizedMessage("You cannot use the house decorator on that object.");   // You cannot use the house decorator on that object.
                    }
                    else if (item.TotalWeight + item.PileWeight > 100)
                    {
                        from.SendLocalizedMessage("That is too heavy.");   // That is too heavy.
                    }
                    else
                    {
                        switch (m_Decorator.Command)
                        {
                        case DecorateCommand.Up: Up(item, from); break;

                        case DecorateCommand.Down: Down(item, from); break;

                        case DecorateCommand.Turn: Turn(item, from); break;
                        }
                    }
                }

                from.Target = new InternalTarget(m_Decorator);
            }
All Usage Examples Of Server.Items.InteriorDecorator::CheckUse