public WinGameCommand(INotifier notifier, IScoreboard scoreboard, IDataState data)
 {
     this.Data = data;
     this.Data.PlayTime = (DateTime.Now - this.Data.StartTime).TotalMinutes;
     this.Notifier = notifier;
     this.Scoreboard = scoreboard;
 }
 public ActionsController(IDataState data, INotifier notifier, INumberGenerator numberGenerator, IScoreboard scoreboard, ICommandsFactory commandsFactory, IActionsReader reader)
 {
     this.Data = data;
     this.ActionsReader = reader;
     this.Notifier = notifier;
     this.Scoreboard = scoreboard;
     this.CommandsFactory = commandsFactory;
     this.NumberGenerator = numberGenerator;
 }
 public CommandsFactory(IDataState data, INotifier notifier, INumberGenerator numberGenerator, IScoreboard scoreboard)
 {
     this.Data = data;
     this.Notifier = notifier;
     this.Scoreboard = scoreboard;
     this.NumberGenerator = numberGenerator;
     this.CommandsList = new Dictionary<string, ICommand>();
     this.FourDigitNumberPattern = new Regex(FourDigitsPatternForRegex);
 }
Example #4
0
 /// <summary>
 /// 禁用
 /// </summary>
 public static IDisposable Disable(this IDataState dataState, string key)
 {
     return(dataState.UseData(key, false));
 }
Example #5
0
 /// <summary>
 /// 是否已启用
 /// </summary>
 public static bool IsEnabled(this IDataState dataState, string key)
 {
     return(dataState.GetData(key, false));
 }
 /// <inheritdoc cref="ICancellationTokenAccessor"/>
 public DataStateCancellationTokenAccessor(IDataState dataState)
 {
     _dataState = dataState;
 }
 public GuessCommand(IDataState data, INotifier notifier, string guess)
 {
     this.Data = data;
     this.Notifier = notifier;
     this.Guess = guess;
 }
 public CheatCommand(IDataState data, INotifier notifier, INumberGenerator numberGenerator)
 {
     this.Data = data;
     this.Notifier = notifier;
     this.NumberGenerator = numberGenerator;
 }
Example #9
0
 /// <inheritdoc />
 public ReadWriteConnectionStringResolver(IOptions <DbConnectionOptions> options, IDataState state)
 {
     _state   = state;
     _options = options.Value;
 }