Ejemplo n.º 1
0
    void Start()
    {
        startUp = GameObject.Find("Main Camera").GetComponent("OnStartUp") as OnStartUp;

        inputPath = startUp.inputPath;

        ReadFile rf = new ReadFile();

        rf.read(inputPath);

        maxAgents = rf.maxAgents;

        agentFrames = rf.agentFrames;
        agentCoords = rf.agentCoords;
        deltas      = rf.deltas;
        distances   = rf.distances;

        agentNum = 0;

        /* Create all of the agents from the specified file. */
        for (int count = 0; count < agentFrames.Count; count += 2)
        {
            a = ScriptableObject.CreateInstance <agent>();

            a.setStart(agentFrames[count]);
            a.setDur(agentFrames[count + 1]);
            a.setCoords(agentCoords);
            a.setDeltas(deltas);
            a.setDistance(distances);
            a.id = agentNum;

            agentList.Add(a);

            int range = agentFrames[count + 1] + 1;
            if (range < agentCoords.Count)
            {
                agentCoords.RemoveRange(0, range);
                deltas.RemoveRange(0, range);
                distances.RemoveRange(0, range);
            }
            agentNum++;
        }

        //agentNum = 0;
        //while (agentNum < maxAgents)
        //{

        //    if (0 == agentList[agentNum].getStart())
        //    {
        //        agentList[agentNum].create();
        //    }
        //    agentNum++;
        //}
    }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            OnStartUp.Init();
            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseIISIntegration()
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }
Ejemplo n.º 3
0
        public MainWindowViewModel()
        {
            OnStartUp onStartUp = new OnStartUp();

            onStartUp.RunOnStartUp();
            GetAssemblyVersion();
            ShowBoxCommand      = new RelayCommand(ShowBox);
            ShowSettingsCommand = new RelayCommand(ShowSettings);
            ShowBigBoxCommand   = new RelayCommand(ShowBigBox);
            ShowCustomCommand   = new RelayCommand(ShowCustom);
            ShowCertificationNominateCommand = new RelayCommand(ShowCertificationNominate);
            ShowCertificationLvlCommand      = new RelayCommand(ShowCertificationLvl);
        }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                ConsoleWrapper.WriteLine(args[0]);
            }

            string appGuid = System.Runtime.InteropServices.Marshal
                             .GetTypeLibGuidForAssembly(System.Reflection.Assembly.GetExecutingAssembly()).ToString();
            var nonExisted = false;

            var mtx = new System.Threading.Mutex(true, appGuid, out nonExisted);

            if (!nonExisted)
            {
                ConsoleWrapper.ShowError("Application already runs!");
                System.Threading.Thread.Sleep(3000);
                return;
            }

            OnStartUp.Load();
            UserInterface.Run(args);
        }
Ejemplo n.º 5
0
 private void MainLoop()
 {
     try
     {
         Interlocked.CompareExchange(ref state, RUNNING, STARTUP_PENDING);
         OnStartUp?.Invoke();
         while (true)
         {
             if (Queue.TryDequeue(out var text))
             {
                 Console.WriteLine("{0}", text);
                 OnPutLine?.Invoke(text);
             }
             else if (state == RUNNING)
             {
                 Enqueued.WaitOne();
             }
             else
             {
                 break;
             }
         }
         Interlocked.Exchange(ref state, SHUTDOWN);
         OnShutDown?.Invoke();
     }
     catch (Exception e)
     {
         Interlocked.Exchange(ref state, ERROR);
         Console.Error.WriteLine("ERROR: {0}", e.Message);
         while ((e = e.InnerException) != null)
         {
             Console.Error.WriteLine("    {0}", e.Message);
         }
         OnError?.Invoke(e);
     }
 }
Ejemplo n.º 6
0
 public void CQStartup(object obj, CQStartupEventArgs e)
 {
     //Main.Initialize();
     OnStartUp?.Invoke(obj, e);
 }
Ejemplo n.º 7
0
 void start()
 {
     startUp = GameObject.Find("Main Camera").GetComponent("OnStartUp") as OnStartUp;
     Time.captureFramerate = startUp.frameRate;
 }