예제 #1
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (message.Length == 0)
            {
                p.Message("Your current transform is: " + p.Transform.Name); return;
            }
            string[]         args      = message.SplitSpaces(2);
            TransformFactory transform = TransformFactory.Find(args[0]);

            if (IsListCommand(args[0]))
            {
                List(p);
            }
            else if (transform == null)
            {
                p.Message("No transform found with name \"{0}\".", args[0]);
                List(p);
            }
            else
            {
                p.Message("Set your transform to: " + transform.Name);
                Transform instance = transform.Construct(p, args.Length == 1 ? "" : args[1]);
                if (instance == null)
                {
                    return;
                }
                p.Transform = instance;
            }
        }
예제 #2
0
        public override void Use(Player p, string message)
        {
            if (message.Length == 0)
            {
                Player.Message(p, "Your current transform is: " + p.Transform.Name); return;
            }
            string[]         args      = message.SplitSpaces(2);
            TransformFactory transform = TransformFactory.Find(args[0]);

            if (args[0].CaselessEq("list"))
            {
                Player.Message(p, "%HAvailable transforms: %S" + TransformFactory.Available);
            }
            else if (transform == null)
            {
                Player.Message(p, "No transform found with name \"{0}\".", args[0]);
                Player.Message(p, "Available transforms: " + TransformFactory.Available);
            }
            else
            {
                Player.Message(p, "Set your transform to: " + transform.Name);
                Transform instance = transform.Construct(p, args.Length == 1 ? "" : args[1]);
                if (instance == null)
                {
                    return;
                }
                p.Transform = instance;
            }
        }