Ejemplo n.º 1
0
 private protected CafeBabeGameThread([NotNull] ReadWriteValueListVault <UInt256> vault, [NotNull] IOutputHelper helper)
 {
     _concreteType = new LocklessConcreteType(this);
     _valueList    = vault ?? throw new ArgumentNullException(nameof(vault));
     _t            = new LocklessWriteOnce <Thread>(InitThread);
     _helper       = helper ?? throw new ArgumentNullException(nameof(helper));
 }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="start">start time</param>
 /// <param name="end">end time</param>
 /// <param name="cancel">cancelled?</param>
 /// <param name="final">final array</param>
 /// <param name="xCount">x count</param>
 /// <param name="oCount">o count</param>
 /// <param name="lookForNumberFoundAt">the index of <see cref="DeadBeefCafeBabeGameConstants.LookForNumber"/> in the
 /// array, if found.</param>
 /// <param name="winningThreadIdx">winning reader thread idx,
 /// null means no winner.</param>
 /// <exception cref="ArgumentNullException"><paramref name="final"/> was <see langword="null"/>
 /// </exception>
 public DeadBeefCafeGameEndedEventArgs(DateTime start, DateTime end, bool cancel, ImmutableArray <UInt256> final, int xCount,
                                       int oCount, int?lookForNumberFoundAt, int?winningThreadIdx)
 {
     _result         = new DeadBeefCafeGameResult(start, end, cancel, final, xCount, oCount, lookForNumberFoundAt, winningThreadIdx);
     _stringRep      = new LocklessWriteOnce <string>(GetStringRep); //string rep lazy init.
     _arrayStringRep = new LocklessWriteOnce <string>(GetArrayString);
 }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="start">start time</param>
 /// <param name="end">end time</param>
 /// <param name="cancel">cancelled?</param>
 /// <param name="final">final string</param>
 /// <param name="xCount">x count</param>
 /// <param name="oCount">o count</param>
 /// <param name="winningThreadIdx">winning reader thread idx,
 /// null means no winner.</param>
 /// <exception cref="ArgumentNullException"><paramref name="final"/> was <see langword="null"/>
 /// </exception>
 public ClortonGameEndedEventArgs(DateTime start, DateTime end, bool cancel, [NotNull] string final, int xCount,
                                  int oCount, int?winningThreadIdx)
 {
     _result    = new ClortonGameResult(start, end, cancel, final, xCount, oCount, winningThreadIdx);
     _stringRep = new LocklessWriteOnce <string>(GetStringRep); //string rep lazy init.
 }