Exemplo n.º 1
0
 public void PrepareToRun(ConditionVariables v, ConditionPersistentData fh, Dictionary <string, ExtendedControls.ConfigurableForm> d, bool chae = true)
 {
     currentvars             = v;
     conditionpersistentdata = fh;
     closehandlesatend       = chae;
     functions = new ConditionFunctions(currentvars, conditionpersistentdata);           // point the functions at our variables and our files..
     dialogs   = d;
 }
Exemplo n.º 2
0
 public ConditionEDDFunctions(ConditionFunctions c, ConditionVariables v, ConditionPersistentData h, int recd) : base(c, v, h, recd)
 {
     if (functions == null)        // one time init, done like this cause can't do it in {}
     {
         functions = new Dictionary <string, FuncEntry>();
         functions.Add("systempath", new FuncEntry(SystemPath, 1, 1, NoMacros, NoStrings)); // literal
         functions.Add("version", new FuncEntry(Version, 1, 1, NoMacros, NoStrings));       // don't check first para
         functions.Add("star", new FuncEntry(Star, 2, 2, FirstMacro, AllStrings));          // var/string, literal/var/string
         functions.Add("ship", new FuncEntry(Ship, 1, 1, AllMacros, AllStrings));           //ship translator
     }
 }
Exemplo n.º 3
0
 public ConditionEDDFunctions(ConditionFunctions c, ConditionVariables v, ConditionPersistentData h, int recd) : base(c, v, h, recd)
 {
     if (functions == null)        // one time init, done like this cause can't do it in {}
     {
         functions = new Dictionary <string, FuncEntry>();
         functions.Add("systempath", new FuncEntry(SystemPath, FuncEntry.PT.LmeSE));   // literal
         functions.Add("version", new FuncEntry(Version, FuncEntry.PT.ImeSE));
         functions.Add("star", new FuncEntry(Star, FuncEntry.PT.MESE, FuncEntry.PT.LmeSE));
         functions.Add("ship", new FuncEntry(Ship, FuncEntry.PT.MESE));
         functions.Add("events", new FuncEntry(Events, FuncEntry.PT.MESE, FuncEntry.PT.MESE));
     }
 }
Exemplo n.º 4
0
        // now = true, run it immediately, else run at end of queue.  Optionally pass in handles and dialogs in case its a sub prog

        public void Run(bool now, ActionFile fileset, ActionProgram r, ConditionVariables inputparas,
                        ConditionPersistentData fh = null, Dictionary <string, ExtendedControls.ConfigurableForm> d = null, bool closeatend = true)
        {
            if (now)
            {
                if (progcurrent != null)                    // if running, push the current one back onto the queue to be picked up
                {
                    progqueue.Insert(0, progcurrent);
                }

                progcurrent = new ActionProgramRun(fileset, r, inputparas, this, actioncontroller);   // now we run this.. no need to push to stack

                progcurrent.PrepareToRun(new ConditionVariables(progcurrent.inputvariables, actioncontroller.Globals, fileset.filevariables),
                                         fh == null ? new ConditionPersistentData() : fh, d == null ? new Dictionary <string, ExtendedControls.ConfigurableForm>() : d, closeatend);              // if no filehandles, make them and close at end
            }
            else
            {
                progqueue.Add(new ActionProgramRun(fileset, r, inputparas, this, actioncontroller));
            }
        }
Exemplo n.º 5
0
 static public ConditionFunctionHandlers DefaultGetCFH(ConditionFunctions c, ConditionVariables vars, ConditionPersistentData handles, int recdepth)
 {
     return(new ConditionEDDFunctions(c, vars, handles, recdepth));
 }