private MenuItem GetRaceMenuItem()
        {
            var raceMenuItem = new MenuItem("RaceMenu");
            var raceTexture  = new Texture(new Image("Resources/SelfDrivingRace.png"));

            raceTexture.GenerateMipmap();
            raceTexture.Smooth  = true;
            raceMenuItem.Canvas = new RectangleShape(new Vector2f(300, 300))
            {
                Texture = raceTexture,
            };
            raceMenuItem.OnClick = () =>
            {
                if (raceScreen == null)
                {
                    raceScreen = appService.Kernel.Get <RaceScreen>();
                    appManager.AddChildScreen(raceScreen);
                }
                else
                {
                    appManager.SetActiveScreen(raceScreen);
                }
            };

            return(raceMenuItem);
        }
        private void OnTrackSelected(Track track)
        {
            if (mapMakerScreen == null)
            {
                mapMakerScreen = appService.Kernel.Get <MapMakerScreen>();
                appManager.AddChildScreen(mapMakerScreen);
            }
            else
            {
                appManager.SetActiveScreen(mapMakerScreen);
            }

            mapMakerScreen.Initialize(track);
        }
Exemple #3
0
        private void OnTrackSelected(Track track)
        {
            if (raceSimulationScreen == null)
            {
                raceSimulationScreen = appService.Kernel.Get <HumanAssistedRacingSimulationScreen>();

                appManager.AddChildScreen(raceSimulationScreen);
            }
            else
            {
                appManager.SetActiveScreen(raceSimulationScreen);
            }

            raceSimulationScreen.OnTrackSelected(track);
        }
Exemple #4
0
        private void StartTesting()
        {
            if (!EnsureNetworkExists())
            {
                return;
            }

            if (selfDrivingTestScreen == null)
            {
                selfDrivingTestScreen = appService.Kernel.Get <SelfDrivingTestScreen>();

                appManager.AddChildScreen(selfDrivingTestScreen);
            }
            else
            {
                appManager.SetActiveScreen(selfDrivingTestScreen);
            }

            selfDrivingTestScreen.Initialize(racingSimulationScreen.CurrentTrack, network);
        }