Files
libremetaverse/libsecondlife/examples/TestClient/Commands/TreeCommand.cs
Latif Khalifa fb3c459016 * Added Helpers.StateToAttachmentPoint() that converts a prim.Data.State to the AttachmentPoint enum
* Created an Appearance folder for TestClient commands, put the new AttachmentsCommand in it which shows all of the current agent attachments
* Moved the ObjectManager enums out to the libsecondlife namespace
* Change LLObject.ObjectData.State from a uint to a byte (as it should be)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1505 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-30 00:25:08 +00:00

51 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class TreeCommand: Command
{
public TreeCommand(TestClient testClient)
{
Name = "tree";
Description = "Rez a tree.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length == 1)
{
try
{
string treeName = args[0].Trim(new char[] { ' ' });
Tree tree = (Tree)Enum.Parse(typeof(Tree), treeName);
LLVector3 treePosition = Client.Self.SimPosition;
treePosition.Z += 3.0f;
Client.Objects.AddTree(Client.Network.CurrentSim, new LLVector3(0.5f, 0.5f, 0.5f),
LLQuaternion.Identity, treePosition, tree, Client.GroupID, false);
return "Attempted to rez a " + treeName + " tree";
}
catch (Exception)
{
return "Type !tree for usage";
}
}
string usage = "Usage: !tree [";
foreach (string value in Enum.GetNames(typeof(Tree)))
{
usage += value + ",";
}
usage = usage.TrimEnd(new char[] { ',' });
usage += "]";
return usage;
}
}
}