예제 #1
0
        //Find the previous table in the Table List - advance slots
        public PinballTable PrevTable(PinballTable table, int advance)
        {
            //Console.WriteLine($"Prev Table: {table.Description} -> {advance}");
            if (advance > 0)
            {
                return(PrevTable(PrevTable(table), advance - 1));
            }

            return(table);
        }
예제 #2
0
        public static Process StartTable(PinballSystem system, PinballTable table)
        {
            var proc = new Process();

            proc.StartInfo.FileName       = GetSystemPath(system);
            proc.StartInfo.Arguments      = GetSystemParameters(system, table);
            proc.StartInfo.WindowStyle    = ProcessWindowStyle.Minimized;
            proc.StartInfo.CreateNoWindow = true;
            proc.Start();
            return(proc);
        }
예제 #3
0
        public static string GetSystemParameters(PinballSystem system, PinballTable table)
        {
            //Replace [TABLENAME]
            var regex = new Regex(@"\[TABLENAME\]");
            var param = regex.Replace(system.Parameters, table.Name);

            //Replace [SYSTEMPATH]
            regex = new Regex(@"\[SYSTEMPATH\]");
            param = regex.Replace(param, system.WorkingPath);

            return(param);
        }
예제 #4
0
 //Find the previous table in the Table List
 public PinballTable PrevTable(PinballTable table)
 {
     if (table != null)
     {
         var pinballtable = TableList.ElementAt(TableList.IndexOf(table) > 0 ? TableList.IndexOf(table) - 1 : TableList.Count() - 1);
         if (pinballtable.Enabled)
         {
             return(pinballtable);
         }
         else
         {
             //Ignore Disabled Tables
             return(PrevTable(pinballtable));
         }
     }
     else
     {
         return(null);
     }
 }
예제 #5
0
 //Find the next table in the Table List
 public PinballTable NextTable(PinballTable table)
 {
     if (table != null)
     {
         var pinballtable = TableList.ElementAt(TableList.IndexOf(table) < TableList.Count() - 1 ? TableList.IndexOf(table) + 1 : 0);
         if (pinballtable.Enabled)
         {
             return(pinballtable);
         }
         else
         {
             //Ignore Disabled Tables
             return(NextTable(pinballtable));
         }
     }
     else
     {
         return(null);
     }
 }
예제 #6
0
 //Find system that table goes with
 public PinballSystem FindSystem(PinballTable table)
 {
     return(SystemList.Single(x => x.Name == table.System));
 }