예제 #1
0
        private static CommandResponse ParseTrigger(string command, string[] args, bool execute, int i, int j)
        {
            TICWorld        world = ModContent.GetInstance <TICWorld>();
            CommandResponse resp  = new CommandResponse(false, $"Unknown Command '{command}'");

            List <Trigger> triggerCommands = mod.commands.OfType <Trigger>().ToList();

            foreach (Trigger trigger in triggerCommands)
            {
                if (trigger.IsAlias(command))
                {
                    resp.valid = trigger.ParseArguments(args, out resp.response);

                    if (resp.valid)
                    {
                        resp.response = "";

                        if (execute)
                        {
                            trigger.Execute(i, j, world);
                        }
                    }

                    return(resp);
                }
            }

            return(resp);
        }
예제 #2
0
        private static CommandResponse TriggerTime(string[] args, CommandResponse resp, bool execute, int i, int j)
        {
            TICWorld world = ModContent.GetInstance <TICWorld>();

            TICWorld.Data data = null;
            if (execute)
            {
                data = world.data[(i, j)];