corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using OpenMetaverse;
5 using OpenMetaverse.Packets;
6  
7 namespace OpenMetaverse.TestClient
8 {
9 public enum CommandCategory : int
10 {
11 Parcel,
12 Appearance,
13 Movement,
14 Simulator,
15 Communication,
16 Inventory,
17 Objects,
18 Voice,
19 TestClient,
20 Friends,
21 Groups,
22 Other,
23 Unknown,
24 Search
25 }
26  
27 public abstract class Command : IComparable
28 {
29 public string Name;
30 public string Description;
31 public CommandCategory Category;
32  
33 public TestClient Client;
34  
35 public abstract string Execute(string[] args, UUID fromAgentID);
36  
37 /// <summary>
38 /// When set to true, think will be called.
39 /// </summary>
40 public bool Active;
41  
42 /// <summary>
43 /// Called twice per second, when Command.Active is set to true.
44 /// </summary>
45 public virtual void Think()
46 {
47 }
48  
49 public int CompareTo(object obj)
50 {
51 if (obj is Command)
52 {
53 Command c2 = (Command)obj;
54 return Category.CompareTo(c2.Category);
55 }
56 else
57 throw new ArgumentException("Object is not of type Command.");
58 }
59  
60 }
61 }