public LaunchGameTask(IParkitect parkitect) : base("Launch parkitect") { _parkitect = parkitect; StatusDescription = "Launch the game."; }
public ModsPageView(IParkitect parkitect, ILogger log, IPresenter parent, IQueueableTaskManager queueableTaskManager, IWebsite website) : base(parkitect, website, log, AssetType.Mod, parent, "Mods") { _parkitect = parkitect; _queueableTaskManager = queueableTaskManager; _website = website; }
private static void InstallModLoaderFile(IParkitect parkitect, string fileName) { var targetDirectory = parkitect.Paths.NativeMods; Directory.CreateDirectory(targetDirectory); var targetPath = Path.Combine(targetDirectory, fileName); var sourcePath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), fileName); if (!File.Exists(sourcePath)) { return; } if (File.Exists(targetPath)) { using (var stream = File.OpenRead(sourcePath)) using (var stream2 = File.OpenRead(targetPath)) if (stream.CreateMD5Checksum() == stream2.CreateMD5Checksum()) { return; } } File.Copy(sourcePath, targetPath, true); }
private static void InstallModLoaderFile(IParkitect parkitect, string fileName, string exten) { var targetDirectory = parkitect.Paths.NativeMods; Directory.CreateDirectory(targetDirectory); var targetPath = Path.Combine(targetDirectory, fileName + "." + exten); var sourcePath = NSBundle.MainBundle.PathForResource(fileName, exten); if (!File.Exists(sourcePath)) { return; } if (File.Exists(targetPath)) { using (var stream = File.OpenRead(sourcePath)) using (var stream2 = File.OpenRead(targetPath)) if (stream.CreateMD5Checksum() == stream2.CreateMD5Checksum()) { return; } } File.Copy(sourcePath, targetPath, true); }
private object Generate(string action, IParkitect parkitect, Exception exception) { try { var os = OperatingSystem.Detect(); switch (os) { case SupportedOperatingSystem.Windows: return(new WindowsCrashReport(parkitect, action, exception, _log)); case SupportedOperatingSystem.MacOSX: return(new MacOSXCrashReport(parkitect, action, exception, _log)); case SupportedOperatingSystem.Linux: return(new LinuxCrashReport(parkitect, action, exception, _log)); default: throw new Exception("unsupported operating system " + os); } } catch (Exception e) { return(new FailedCrashReport(action, exception, e)); } }
public CheckForUpdatesTask(IParkitect parkitect, IWebsite website, ILogger log, IQueueableTaskManager queueableTaskManager) : base("Check for updates") { _parkitect = parkitect; _website = website; _log = log; _queueableTaskManager = queueableTaskManager; StatusDescription = "Check for updates."; }
public CrashReporterFactory(INexusWebClientFactory webClientFactory, IWebsite website, IParkitect parkitect, ILogger log) { _website = website; _parkitect = parkitect; _webClientFactory = webClientFactory; _log = log; }
protected BaseParkitectPaths(IParkitect parkitect) { if (parkitect == null) { throw new ArgumentNullException(nameof(parkitect)); } Parkitect = parkitect; }
public LocalAssetRepository(IParkitect parkitect, IWebsite website, ILogger log, IAssetMetadataStorage assetMetadataStorage, IAssetCachedDataStorage assetCachedDataStorage) { _parkitect = parkitect; _website = website; _log = log; _assetMetadataStorage = assetMetadataStorage; _assetCachedDataStorage = assetCachedDataStorage; }
public InstallAssetTask(IParkitect parkitect, IWebsite website, IRemoteAssetRepository remoteAssetRepository, IQueueableTaskManager queueableTaskManager) : base("Install asset") { _parkitect = parkitect; _website = website; _remoteAssetRepository = remoteAssetRepository; _queueableTaskManager = queueableTaskManager; StatusDescription = "Install an asset."; }
public App(IPresenterFactory presenterFactory, IParkitect parkitect, IQueueableTaskManager taskManager, ILogger log, IUpdateManager updateManager, Migrator migrator) { _migrator = migrator; _presenterFactory = presenterFactory; _parkitect = parkitect; _taskManager = taskManager; _log = log; _updateManager = updateManager; }
public MacOSXCrashReport(IParkitect parkitect, string action, Exception exception, ILogger logger) { if (parkitect == null) throw new ArgumentNullException(nameof(parkitect)); if (exception == null) throw new ArgumentNullException(nameof(exception)); _logger = logger; _parkitect = parkitect; Action = action; Exception = exception; }
public UpdateModTask(IModAsset mod, IParkitect parkitect, IQueueableTaskManager queueableTaskManager, IWebsite website) : base($"Update mod {mod?.Name}") { if (mod == null) throw new ArgumentNullException(nameof(mod)); _mod = mod; _parkitect = parkitect; _queueableTaskManager = queueableTaskManager; _website = website; StatusDescription = $"Update mod {mod.Name}"; }
public UpdateModTask(IModAsset mod, IParkitect parkitect, IQueueableTaskManager queueableTaskManager, IWebsite website) : base($"Update mod {mod?.Name}") { if (mod == null) { throw new ArgumentNullException(nameof(mod)); } _mod = mod; _parkitect = parkitect; _queueableTaskManager = queueableTaskManager; _website = website; StatusDescription = $"Update mod {mod.Name}"; }
public static void InstallModLoader(IParkitect parkitect, ILogger logger) { if (parkitect == null) throw new ArgumentNullException(nameof(parkitect)); if (logger == null) throw new ArgumentNullException(nameof(logger)); try { InstallModLoaderFile(parkitect, "ParkitectNexus.Mod.ModLoader", "dll"); } catch (Exception e) { logger.WriteLine("Failed to install mod loader.", LogLevel.Warn); logger.WriteException(e, LogLevel.Warn); } }
public MacOSXCrashReport(IParkitect parkitect, string action, Exception exception, ILogger logger) { if (parkitect == null) { throw new ArgumentNullException(nameof(parkitect)); } if (exception == null) { throw new ArgumentNullException(nameof(exception)); } _logger = logger; _parkitect = parkitect; Action = action; Exception = exception; }
public AssetsPageView(IParkitect parkitect, IWebsite website, ILogger log, AssetType type, IPresenter parent, string displayName) : base(log, displayName) { if (!(parent is MainView)) throw new ArgumentException("parent must be MainView", nameof(parent)); _parkitect = parkitect; _website = website; _log = log; _type = type; MainView = (MainView) parent; parkitect.Assets.AssetAdded += Assets_AssetAdded; parkitect.Assets.AssetRemoved += Assets_AssetRemoved; GetRequiredMods(); }
public AssetsPageView(IParkitect parkitect, IWebsite website, ILogger log, AssetType type, IPresenter parent, string displayName) : base(log, displayName) { if (!(parent is MainView)) { throw new ArgumentException("parent must be MainView", nameof(parent)); } _parkitect = parkitect; _website = website; _log = log; _type = type; MainView = (MainView)parent; parkitect.Assets.AssetAdded += Assets_AssetAdded; parkitect.Assets.AssetRemoved += Assets_AssetRemoved; GetRequiredMods(); }
public static void InstallModLoader(IParkitect parkitect, ILogger logger) { if (parkitect == null) { throw new ArgumentNullException(nameof(parkitect)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } try { InstallModLoaderFile(parkitect, "ParkitectNexus.Mod.ModLoader.dll"); } catch (Exception e) { logger.WriteLine("Failed to install mod loader.", LogLevel.Warn); logger.WriteException(e, LogLevel.Warn); } }
private static void InstallModLoaderFile(IParkitect parkitect, string fileName) { var targetDirectory = parkitect.Paths.NativeMods; Directory.CreateDirectory(targetDirectory); var targetPath = Path.Combine(targetDirectory, fileName); var sourcePath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), fileName); if (!File.Exists(sourcePath)) return; if (File.Exists(targetPath)) { using (var stream = File.OpenRead(sourcePath)) using (var stream2 = File.OpenRead(targetPath)) if (stream.CreateMD5Checksum() == stream2.CreateMD5Checksum()) return; } File.Copy(sourcePath, targetPath, true); }
private static void InstallModLoaderFile(IParkitect parkitect, string fileName, string exten) { var targetDirectory = parkitect.Paths.NativeMods; Directory.CreateDirectory(targetDirectory); var targetPath = Path.Combine(targetDirectory, fileName + "." + exten); var sourcePath = NSBundle.MainBundle.PathForResource(fileName, exten); if (!File.Exists(sourcePath)) return; if (File.Exists(targetPath)) { using (var stream = File.OpenRead(sourcePath)) using (var stream2 = File.OpenRead(targetPath)) if (stream.CreateMD5Checksum() == stream2.CreateMD5Checksum()) return; } File.Copy(sourcePath, targetPath, true); }
private object Generate(string action, IParkitect parkitect, Exception exception) { try { var os = OperatingSystem.Detect(); switch (os) { case SupportedOperatingSystem.Windows: return new WindowsCrashReport(parkitect, action, exception, _log); case SupportedOperatingSystem.MacOSX: return new MacOSXCrashReport(parkitect, action, exception, _log); case SupportedOperatingSystem.Linux: return new LinuxCrashReport(parkitect, action, exception, _log); default: throw new Exception("unsupported operating system " + os); } } catch (Exception e) { return new FailedCrashReport(action, exception, e); } }
public BlueprintsPageView(IParkitect parkitect, IWebsite website, ILogger log, IPresenter parent) : base(parkitect, website, log, AssetType.Blueprint, parent, "Blueprints") { }
public Migrator(IParkitect parkitect) { _parkitect = parkitect; }
public MenuPageView(IParkitect parkitect, ILogger log, IWebsite website, App app) : base(log, "Menu") { _parkitect = parkitect; _website = website; }
public WindowsParkitectPaths(IParkitect parkitect) : base(parkitect) { }
public ModCompiler(IParkitect parkitect, ILogger log) { _parkitect = parkitect; _log = log; }
protected BaseParkitectPaths(IParkitect parkitect) { if (parkitect == null) throw new ArgumentNullException(nameof(parkitect)); Parkitect = parkitect; }
public ScenariosPageView(IParkitect parkitect, IWebsite website, ILogger log, IPresenter parent) : base(parkitect, website, log, AssetType.Scenario, parent, "Scenarios") { }
public SavegamesPageView(IParkitect parkitect, IWebsite website, ILogger log, IPresenter parent) : base(parkitect, website, log, AssetType.Savegame, parent, "Savegames") { }
public ModLoadOrderBuilder(IParkitect parkitect, ILogger log) { _parkitect = parkitect; _log = log; }