コード例 #1
0
ファイル: Commands.cs プロジェクト: sorsarre/Razor
        private static bool DressCommand(string command, Variable[] vars, bool quiet, bool force)
        {
            if (vars.Length == 0)
            {
                throw new RunTimeError("Usage: dress ('name of dress list')");
            }

            if (_lastDressList == null)
            {
                _lastDressList = DressList.Find(vars[0].AsString());

                if (_lastDressList != null)
                {
                    _lastDressList.Dress();
                }
                else if (!quiet)
                {
                    CommandHelper.SendWarning(command, $"'{vars[0].AsString()}' not found", quiet);
                    return(true);
                }
            }
            else if (ActionQueue.Empty)
            {
                _lastDressList = null;
                return(true);
            }

            return(false);
        }
コード例 #2
0
        public static bool DressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0)
            {
                throw new RunTimeError(null, "Usage: dress ('name of dress list')");
            }

            if (_lastDressList == null)
            {
                _lastDressList = DressList.Find(args[0].AsString());

                if (_lastDressList != null)
                {
                    _lastDressList.Dress();
                }
                else if (!quiet)
                {
                    throw new RunTimeError(null, $"'{args[0].AsString()}' not found");
                }
            }
            else if (ActionQueue.Empty)
            {
                _lastDressList = null;
                return(true);
            }

            return(false);
        }
コード例 #3
0
        public static bool DressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0)
            {
                throw new RunTimeError(null, "Usage: dress ('name of dress list')");
            }

            DressList d = DressList.Find(args[0].AsString());

            if (d != null)
            {
                d.Dress();
            }
            else if (!quiet)
            {
                throw new RunTimeError(null, $"'{args[0].AsString()}' not found");
            }

            return(true);
        }