Exemple #1
0
        private void Invoke(ICall call)
        {
            if (_rip.GetCommand(call.Command) is not ICommand c)
            {
                Sender.Tell(BuildError(RIPErrors.CommandNotFound, call.Command));
                return;
            }

            if (c.Actions.FirstOrDefault(e => e.Name.EqualIgnoreCase(call.Action)) is not IAction a)
            {
                Sender.Tell(BuildError(RIPErrors.ActionNotFound, call.Action));
                return;
            }

            var response = Execute(call, c, a);

            if (a.ReturnType.Equals(GetVoidName()))
            {
                Sender.Tell(Response.Success(), Self);
            }
            else
            {
                Sender.Tell(Response.Success(response), Self);
            }
        }
Exemple #2
0
        public string Detail(string name)
        {
            if (_rip.GetCommand(name) is not ICommand c)
            {
                return("Can't find command for name: " + name);
            }

            return(BuildCommandDetail(c));
        }