-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCommand.cs
More file actions
61 lines (53 loc) · 1.23 KB
/
Command.cs
File metadata and controls
61 lines (53 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.Packets;
namespace OpenMetaverse.TestClient
{
public enum CommandCategory : int
{
Parcel,
Appearance,
Movement,
Simulator,
Communication,
Inventory,
Objects,
Voice,
TestClient,
Friends,
Groups,
Other,
Unknown,
Search
}
public abstract class Command : IComparable
{
public string Name;
public string Description;
public CommandCategory Category;
public TestClient Client;
public abstract string Execute(string[] args, UUID fromAgentID);
/// <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()
{
}
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.");
}
}
}