Example #1
0
 void SingleUpdateLoop()
 {
     if (om.universe.IsDisposed())
     {
         om.Dispose();
         return;
     }
     for (int i = 0; i < ticksPerFrame; i++)
     {
         if (om.universe.GetTicksCount() % 5 == 1)
         {
             om.universe.GetMostFitCell();
         }
         om.universe.DoUniverseTick();
     }
     om.WriteInfo();
     if (UniverseConsts.DrawMoveDirections)
     {
         DescAndMoveDir[][] damd = om.universe.GetAllDescriptorsAndMoveDisp();
         om.DrawPicturePro(damd);
     }
     else
     {
         int[][] desc = om.universe.GetAllDescriptors();
         om.DrawPictureDef(desc);
     }
 }
            void UniverseUpdateLoop()
            {
                try
                {
                    while (universeUpdThread != null)
                    {
                        if (om.universe.IsDisposed())
                        {
                            om.Dispose();
                            return;
                        }

                        om.universe.DoUniverseTick();

                        blockedScreenUpdThread = false;
                        while (blockedUniverseUpdThread)
                        {
                            System.Threading.Thread.Sleep(5);
                        }
                        System.Threading.Thread.Sleep(om.ticksPause);
                    }
                }
                catch { }
            }