コード例 #1
0
 public Application(IMigrationLocator migrationLocator, IVersionLocator versionLocator,
                    IMigrationStrategy migrationStrategy)
 {
     _migrationLocator  = migrationLocator;
     _versionLocator    = versionLocator;
     _migrationStrategy = migrationStrategy;
 }
コード例 #2
0
ファイル: CoreInfoLib.cs プロジェクト: QingYunHX/QYHXLib
 /// <summary>
 ///     核心选项
 /// </summary>
 /// <param name="gameRootPath">游戏根目录,默认为 ./.minecraft </param>
 /// <param name="javaPath">JAVA地址,默认为自动搜寻所的第一个</param>
 /// <param name="versionLocator">Version定位器,默认为 JVersionLoacator</param>
 public LauncherCoreCreationOption(string gameRootPath = null, IVersionLocator versionLocator = null)
 {
     GameRootPath = new DirectoryInfo(gameRootPath ?? ".minecraft").FullName;
     //JavaPath = javaPath ?? SystemTools.FindJava().FirstOrDefault();
     JavaPath       = MainClass.OtherJava;
     VersionLocator = versionLocator ?? new JVersionLocator();
     if (!Directory.Exists(GameRootPath))
     {
         Directory.CreateDirectory(GameRootPath);
     }
 }
コード例 #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="launchSettings">启动设置</param>
        /// <param name="launcherProfileParser">Mojang官方launcher_profiles.json适配组件</param>
        /// <param name="versionLocator"></param>
        /// <param name="authResult"></param>
        /// <param name="rootPath"></param>
        /// <param name="rootVersion"></param>
        public DefaultLaunchArgumentParser(LaunchSettings launchSettings, ILauncherProfileParser launcherProfileParser, IVersionLocator versionLocator, AuthResult authResult, string rootPath, string rootVersion)
        {
            if (launchSettings == null || launcherProfileParser == null)
            {
                throw new ArgumentNullException();
            }

            AuthResult            = authResult;
            VersionLocator        = versionLocator;
            RootPath              = rootPath;
            LaunchSettings        = launchSettings;
            LauncherProfileParser = launcherProfileParser;
            VersionInfo           = LaunchSettings.VersionLocator.GetGame(LaunchSettings.Version);
            GameProfile           = LauncherProfileParser.GetGameProfile(LaunchSettings.GameName);

            ClassPath = string.Join(string.Empty,
                                    VersionInfo.Libraries.Select(l =>
                                                                 $"{GamePathHelper.GetLibraryPath(launchSettings.GameResourcePath, l.Path.Replace('/', '\\'))};"));
            ClassPath += string.IsNullOrEmpty(rootVersion)
                ? GamePathHelper.GetGameExecutablePath(rootPath, launchSettings.Version)
                : GamePathHelper.GetGameExecutablePath(rootPath, rootVersion);
            LastAuthResult = LaunchSettings.Authenticator.GetLastAuthResult();
        }
コード例 #4
0
 public static LauncherCoreCreationOption Create(string gameRootPath = null, string javaPath = null, IVersionLocator versionLocator = null)
 {
     return(new LauncherCoreCreationOption(gameRootPath, javaPath, versionLocator));
 }
コード例 #5
0
 public MigrationRunner(IMigrationLocator migrationLocator, IVersionLocator versionLocator)
 {
     _migrationLocator = migrationLocator;
     _versionLocator   = versionLocator;
 }
コード例 #6
0
ファイル: LauncherCore.cs プロジェクト: CodingEric/KMCCC
		public static LauncherCoreCreationOption Create(string gameRootPath = null, string javaPath = null, IVersionLocator versionLocator = null)
		{
			return new LauncherCoreCreationOption(gameRootPath, javaPath, versionLocator);
		}
コード例 #7
0
ファイル: LauncherCore.cs プロジェクト: CodingEric/KMCCC
		/// <summary>
		///     核心选项
		/// </summary>
		/// <param name="gameRootPath">游戏根目录,默认为 ./.minecraft </param>
		/// <param name="javaPath">JAVA地址,默认为自动搜寻所的第一个</param>
		/// <param name="versionLocator">Version定位器,默认为 JVersionLoacator</param>
		public LauncherCoreCreationOption(string gameRootPath = null, string javaPath = null, IVersionLocator versionLocator = null)
		{
			GameRootPath = new DirectoryInfo(gameRootPath ?? ".minecraft").FullName;
			JavaPath = javaPath ?? SystemTools.FindJava().FirstOrDefault();
			VersionLocator = versionLocator ?? new JVersionLocator();
			if (!Directory.Exists(GameRootPath))
			{
				Directory.CreateDirectory(GameRootPath);
			}
		}
コード例 #8
0
ファイル: Application.cs プロジェクト: virajs/Mongo.Migration
 public Application(IMongoRegistrator mongoRegistrator, IMigrationLocator migrationLocator, IVersionLocator versionLocator)
 {
     _mongoRegistrator = mongoRegistrator;
     _migrationLocator = migrationLocator;
     _versionLocator   = versionLocator;
 }