2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
|
|
|
|
using OpenMetaverse.Packets;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2008-07-25 08:55:36 +00:00
|
|
|
public enum CommandCategory : int
|
|
|
|
|
{
|
|
|
|
|
Parcel,
|
|
|
|
|
Appearance,
|
|
|
|
|
Movement,
|
|
|
|
|
Simulator,
|
|
|
|
|
Communication,
|
|
|
|
|
Inventory,
|
|
|
|
|
Objects,
|
|
|
|
|
Voice,
|
|
|
|
|
TestClient,
|
|
|
|
|
Friends,
|
|
|
|
|
Groups,
|
|
|
|
|
Other,
|
2009-10-10 06:38:07 +00:00
|
|
|
Unknown,
|
|
|
|
|
Search
|
2008-07-25 08:55:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract class Command : IComparable
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
public string Name;
|
|
|
|
|
public string Description;
|
2008-07-25 08:55:36 +00:00
|
|
|
public CommandCategory Category;
|
|
|
|
|
|
2007-04-28 20:54:02 +00:00
|
|
|
public TestClient Client;
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public abstract string Execute(string[] args, UUID fromAgentID);
|
2007-04-28 20:54:02 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// When set to true, think will be called.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Active;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called twice per second, when Command.Active is set to true.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual void Think()
|
|
|
|
|
{
|
|
|
|
|
}
|
2008-07-25 08:55:36 +00:00
|
|
|
|
|
|
|
|
public int CompareTo(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is Command)
|
|
|
|
|
{
|
|
|
|
|
Command c2 = (Command)obj;
|
|
|
|
|
return Category.CompareTo(c2.Category);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
throw new ArgumentException("Object is not of type Command.");
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|