static void Main(string[] args) { Logger.LogSeparator(); Logger.Log("Запуск программы"); VisiblityConsole(false); gamePlatform = new GameWPF(); foreach (string arg in args) { if (arg[0] == '-') { if (arg == "-console") { VisiblityConsole(true); gamePlatform = new GameConsole(); } } else { mapPath = arg; } } gamePlatform.Run(mapPath); }
public BasicGameMainShellView(IGamePlatform customPlatform, IGameInfo gameData, BasicData basicData, IStartUp start, IStandardScreen screen) { UIPlatform.ShowMessageAsync = (async message => { await DisplayAlert("Message", message, "Okay"); customPlatform.ResetPopups(); }); UIPlatform.ShowError = (async message => { await DisplayAlert("Error", message, "Okay"); UIPlatform.ExitApp(); }); NavigationPage.SetHasNavigationBar(this, false); GameData = gameData; BasicData = basicData; _start = start; _screen = screen; CustomPlatform = customPlatform; BuildXAMLAsync().Wait(); }
public GamePage( IGamePlatform customPlatform, IGameInfo gameData, BasicGameFrameworkLibrary.BasicGameDataClasses.BasicData basicData, IStartUp start, IStandardScreen screen) : base(customPlatform, gameData, basicData, start, screen) { }
public MultiplayerBasicShellView( IGamePlatform customPlatform, IGameInfo gameData, BasicData basicData, IStartUp start, IStandardScreen screen) : base(customPlatform, gameData, basicData, start, screen) { }
public GamePage( IGamePlatform customPlatform, IGameInfo gameData, BasicData basicData, IStartUp start, IStandardScreen screen) : base(customPlatform, gameData, basicData, start, screen) { }
public GamePage( IGamePlatform customPlatform, IGameInfo gameData, BasicData basicData, IStartUp start, IStandardScreen screen) : base(customPlatform, gameData, basicData, start, screen) { //TODO: may need to think about if we need load or update (?) }
//attempt no navigation. public LoaderViewModel() { Starts = cons !.Resolve <IStartUp>(); Platform = cons.Resolve <IGamePlatform>(); //Navigation = navigation; Mode = EnumGamePackageMode.Production; //needs some testing for now unfortunately for the loader. GenerateGameList(); PackagePicker = new GamePackageLoaderPickerCP(); PackagePicker.LoadTextList(GameList); PackagePicker.ItemSelectedAsync += PackagePicker_ItemSelectedAsync; }
public LoggingService(IGamePlatform platform, Stream stream) { _OutputChannels = new List <TextWriter>() { new StreamWriter(stream, Encoding.UTF8) }; _Platform = platform; _Platform.Game.Exiting += OnPlatformExit; _Log = new StringBuilder(); }
public LoggingService(IGamePlatform platform, TextWriter writer) { _OutputChannels = new List <TextWriter>() { writer }; _Platform = platform; _Platform.Game.Exiting += OnPlatformExit; _Log = new StringBuilder(); }
public MainPlatform( IUserInput userInputService, IOptions <UserInfoSettings> options, ISigningService signingService, IGamePlatform gamePlatform, ILogger <MainPlatform> logger, ISingleStorage <AuthInfo> authInfo, IStatisticsService statisticsService) { _userInputService = userInputService; _settings = options.Value; _signingService = signingService; _gamePlatform = gamePlatform; _logger = logger; _authInfo = authInfo; _statisticsService = statisticsService; }
private async Task <ProcessEx> StartSubnauticaAsync() { string subnauticaPath = Config.SubnauticaPath; string subnauticaLaunchArguments = Config.SubnauticaLaunchArguments; string subnauticaExe = Path.Combine(subnauticaPath, GameInfo.Subnautica.ExeName); IGamePlatform platform = GamePlatforms.GetPlatformByGameDir(subnauticaPath); // Start game & gaming platform if needed. using ProcessEx game = platform switch { Steam s => await s.StartGameAsync(subnauticaExe, GameInfo.Subnautica.SteamAppId, subnauticaLaunchArguments), EpicGames e => await e.StartGameAsync(subnauticaExe, subnauticaLaunchArguments), MSStore m => await m.StartGameAsync(subnauticaExe), DiscordStore d => await d.StartGameAsync(subnauticaExe, subnauticaLaunchArguments), _ => throw new Exception($"Directory '{subnauticaPath}' is not a valid {GameInfo.Subnautica.Name} game installation or the game's platform is unsupported by Nitrox.") }; return(game ?? throw new Exception($"Unable to start game through {platform.Name}")); }
public static void RegisterGame(IGamePlatform platform) { if (IsRegistered) { return; } _instance.Platform = platform; _instance.Enabled = true; _instance.UpdateOrder = 1; _instance.Game.Components.Add(_instance); // create logger string logFile = Path.Combine(_instance.Platform.LogDirectory, "CurrentLog.txt"); _instance.Services.Register <ILogger>(new LoggingService(_instance.Platform, _instance.Platform.OpenWriteStream(logFile))); _instance.InitializeSubSystem(); }
public BasicGameBootstrapper(IGamePlatform customPlatform, IStartUp starts, EnumGamePackageMode mode) { BeginningColorDimensions.GraphicsHeight = 0; BeginningColorDimensions.GraphicsWidth = 0; AssemblyLinker.ExtraViewModelLocations.Clear(); //AssemblyLinker.ExtraViewModelLocations.Add(Assembly.GetCallingAssembly()!); //needs that too. AssemblyLinker.ExtraViewLocations.Clear(); ViewLocator.ManuelVMList.Clear(); MiscDelegates.ComputerChooseColorsAsync = null; MiscDelegates.ContinueColorsAsync = null; MiscDelegates.FillRestColors = null; MiscDelegates.GetMiscObjectsToReplace = null; RegularSimpleCard.ClearSavedList(); //looks like this was not good enough. JsonSettingsGlobals.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None; //try this way. because otherwise, does not work if not everybody is .net core unfortunately. JsonSettingsGlobals.TypeNameHandling = Newtonsoft.Json.TypeNameHandling.None; //try this as well. otherwise, gets hosed with .net core and xamarin forms. _startInfo = starts; _mode = mode; CustomPlatform = customPlatform; InitalizeAsync(); //maybe its okay to be async void. doing the other is causing too many problems with the game package. }
public PlatformException(IGamePlatform platform, string message, Exception innerException) : base($"{platform.GetType().Name}: {message}", innerException) { }
public Bootstrapper(IGamePlatform customPlatform, IStartUp starts, EnumGamePackageMode mode) : base(customPlatform, starts, mode) { }
public StartPage(IGamePlatform platform, IStartUp starts, IForceOrientation forces, IScreen screen, bool multiPlayer) : base(platform, starts, forces, screen, multiPlayer) { }
public PlatformException(IGamePlatform platform, string message) : base($"{platform.GetType().Name}: {message}") { }
public App(IGamePlatform platform, IForceOrientation forces, IScreen screen) { IStartUp starts = new MainStartUp(); MainPage = new NavigationPage(new StartPage(platform, starts, forces, screen, true)); }
public static void Initialize(IGamePlatform gamePlatform) { _gamePlatform = gamePlatform; }
public StartPage(IGamePlatform platform) { _platform = platform; Init(); }
public App(IGamePlatform platform, IForceOrientation forces, IScreen screen) { IStartUp starts = new SinglePlayerStartUpClass(); MainPage = new NavigationPage(new StartPage(platform, starts, forces, screen, false)); }
public NewGameCommand(IGamePlatform gamePlatform) { this.gamePlatform = gamePlatform; }
public App(IGamePlatform platform) { MainPage = new StartPage(platform); }