コード例 #1
0
ファイル: Program.cs プロジェクト: Nostritius/OpenSAGE
        public static void Main(string[] args)
        {
            // TODO: Get this from a launch parameter.
            const SageGame sageGame = SageGame.CncGenerals;

            // TODO: Support other locators.
            var locator      = new RegistryInstallationLocator();
            var installation = locator.FindInstallations(sageGame).First();
            var fileSystem   = installation.CreateFileSystem();

            HostPlatform.Start();

            var game = new Game(
                HostPlatform.GraphicsDevice,
                HostPlatform.GraphicsDevice2D,
                fileSystem,
                sageGame);

            SetupInitialScene(game);

            var hostView = new GameView
            {
                Game = game,
                Dock = DockStyle.Fill
            };

            // TODO: Use something other than WinForms for cross-platform compatibility.
            var window = new Form
            {
                Size = new Size(1024, 768),
                // TODO: Read game version from assembly metadata or .git folder
                Text = "OpenSAGE (master)",
                Icon = GetIcon()
            };

            window.Controls.Add(hostView);
            window.Show();

            // TODO: This only works on Windows and DX11. Implement this for other platforms.
            RenderLoop.Run(hostView, game.Tick);

            HostPlatform.Stop();
        }
コード例 #2
0
        static GameTestDiscoverer()
        {
            var locator = new RegistryInstallationLocator();

            InstalledGames = SageGames.GetAll().Where(game => locator.FindInstallations(game).Any()).ToSet();
        }
コード例 #3
0
        static GameTestDiscoverer()
        {
            var locator = new RegistryInstallationLocator();

            InstalledGames = GameDefinition.All.Where(game => locator.FindInstallations(game).Any()).ToSet();
        }