/***************************************************************************
* ContextMenuEntry.cs
* -------------------
* begin : May 1, 2002
* copyright : (C) The RunUO Software Team
* email : info@runuo.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
using System;
using Server;
using Server.Network;
namespace Server.ContextMenus
{
///
/// Represents a single entry of a context menu.
///
///
public class ContextMenuEntry
{
private int m_Number;
private int m_Color;
private bool m_Enabled;
private int m_Range;
private CMEFlags m_Flags;
private ContextMenu m_Owner;
///
/// Gets or sets additional flags used in client communication.
///
public CMEFlags Flags
{
get{ return m_Flags; }
set{ m_Flags = value; }
}
///
/// Gets or sets the that owns this entry.
///
public ContextMenu Owner
{
get{ return m_Owner; }
set{ m_Owner = value; }
}
///
/// Gets or sets the localization number containing the name of this entry.
///
public int Number
{
get{ return m_Number; }
set{ m_Number = value; }
}
///
/// Gets or sets the maximum range at which this entry may be used, in tiles. A value of -1 signifies no maximum range.
///
public int Range
{
get{ return m_Range; }
set{ m_Range = value; }
}
///
/// Gets or sets the color for this entry. Format is A1-R5-G5-B5.
///
public int Color
{
get{ return m_Color; }
set{ m_Color = value; }
}
///
/// Gets or sets whether this entry is enabled. When false, the entry will appear in a gray hue and will never be invoked.
///
public bool Enabled
{
get{ return m_Enabled; }
set{ m_Enabled = value; }
}
///
/// Gets a value indicating if non local use of this entry is permitted.
///
public virtual bool NonLocalUse
{
get{ return false; }
}
///
/// Instantiates a new ContextMenuEntry with a given localization number (). No maximum range is used.
///
///
/// The localization number containing the name of this entry.
///
///
public ContextMenuEntry( int number ) : this( number, -1 )
{
}
///
/// Instantiates a new ContextMenuEntry with a given localization number () and maximum range ().
///
///
/// The localization number containing the name of this entry.
///
///
///
/// The maximum range at which this entry can be used.
///
///
public ContextMenuEntry( int number, int range )
{
m_Number = number;
m_Range = range;
m_Enabled = true;
m_Color = 0xFFFF;
}
///
/// Overridable. Virtual event invoked when the entry is clicked.
///
public virtual void OnClick()
{
}
}
}