コード例 #1
0
        public ArtificialIntelligence(UserInterface userInterface, VisualCortex visualCortex)
        {
            if (logicTimer != null)
            {
                logicTimer.Stop();
            }
            // 0 = 40fps when set to 1ms, 8fps screen, 15fps is 7.5fps
            // 1 = 65fps when set to 1ms, 8fps screen, 40fps is 8fps
            // 2 = 1000fps when set to 1ms, 6 fps screen, 60fps is 6.35 fps
            // 3 = 1000fps when set to 1ms, 7.5 fps screen, 60fps is 7.65 fps, 200fps is 8fps
            logicTimer = new ATimer(3, 1, new ATimer.ElapsedTimerDelegate(() => { logic(); }));



            this.userInterface = userInterface;
            this.visualCortex  = visualCortex;

            timerPerformanceStopwatch         = new High_Performance_Timer.Stopwatch();
            screenCapturePerformanceStopWatch = new High_Performance_Timer.Stopwatch();

            basicAI   = new BasicAI();
            autoQueue = new AutoQueueManager();

            logicTimer.Start();
        }
コード例 #2
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            Console.WriteLine("Application showing");
            Debug.WriteLine("Application showing debug");
            visualCortex = new VisualCortex();
            visualCortex.setShouldCaptureDisplayImage(true);
            MotorCortex.init();

            artificialIntelligence = new ArtificialIntelligence(this, visualCortex);

            //Set fps box to 120fps
            aiFpsBox.SelectedIndex        = 7;
            updateDisplayCheckBox.Checked = true;
        }