Наследование: IEnableLogging
Пример #1
0
        public ModController(IMod mod)
            : base(mod) {
            Contract.Requires<ArgumentNullException>(mod != null);
            _contentEngine = CalculatedGameSettings.ContentManager.ContentEngine;
            Mod = mod;
            _modState = new ModState(mod);
            _sixSyncModInstaller = new SixSyncModInstaller(mod, _modState);

            Model.State = _modState.State;
        }
Пример #2
0
        public ModController(IMod mod)
            : base(mod)
        {
            if (mod == null)
            {
                throw new ArgumentNullException(nameof(mod));
            }
            _contentEngine       = CalculatedGameSettings.ContentManager.ContentEngine;
            Mod                  = mod;
            _modState            = new ModState(mod);
            _sixSyncModInstaller = new SixSyncModInstaller(mod, _modState);

            Model.State = _modState.State;
        }
Пример #3
0
        public async Task ConvertOrInstallOrUpdateInternal(IAbsoluteDirectoryPath path, bool force,
                                                           StatusRepo statusRepo, ModState modState, IAbsoluteDirectoryPath packPath)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (statusRepo == null)
            {
                throw new ArgumentNullException(nameof(statusRepo));
            }
            if (modState == null)
            {
                throw new ArgumentNullException(nameof(modState));
            }

            _path = path;

            var opts = GetOptions(statusRepo, packPath.ToString(), force);

            if (!modState.Exists)
            {
                await Install(opts).ConfigureAwait(false);

                return;
            }

            var updateAvailable = modState.State != ContentState.Uptodate;

            if (modState.DoesRepoExist())
            {
                await Update(opts, null, !updateAvailable).ConfigureAwait(false);
            }
            else
            {
                var repo = Convert(opts);
                await Update(opts, repo).ConfigureAwait(false);
            }
        }
        public async Task ConvertOrInstallOrUpdateInternal(IAbsoluteDirectoryPath path, bool force,
            StatusRepo statusRepo, ModState modState, IAbsoluteDirectoryPath packPath) {
            Contract.Requires<ArgumentNullException>(path != null);
            Contract.Requires<ArgumentNullException>(statusRepo != null);
            Contract.Requires<ArgumentNullException>(modState != null);

            _path = path;

            var opts = GetOptions(statusRepo, packPath.ToString(), force);
            if (!modState.Exists) {
                await Install(opts).ConfigureAwait(false);
                return;
            }

            var updateAvailable = modState.State != ContentState.Uptodate;
            if (modState.DoesRepoExist())
                await Update(opts, null, !updateAvailable).ConfigureAwait(false);
            else {
                var repo = Convert(opts);
                await Update(opts, repo).ConfigureAwait(false);
            }
        }
Пример #5
0
 public SixSyncModInstaller(IMod mod, ModState state)
 {
     _mod      = mod;
     _modState = state;
 }
 public SixSyncModInstaller(IMod mod, ModState state) {
     _mod = mod;
     _modState = state;
 }