Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualDieRollResult" /> class.
 /// </summary>
 /// <param name="die">The die.</param>
 /// <param name="rolledNumber">The rolled number.</param>
 /// <param name="criticalSuccess">if set to <c>true</c> the result is marked as a critical success.</param>
 /// <param name="criticalFailure">if set to <c>true</c> the result is marked as a critical failure.</param>
 // ReSharper disable once TooManyDependencies
 public VirtualDieRollResult(IDie die, int rolledNumber, bool criticalSuccess, bool criticalFailure)
 {
     Die           = die;
     _RolledNumber = rolledNumber;
     _Value        = new ResultValueSet {
         { "Number", rolledNumber }
     };
     _IsCriticalFailure = criticalFailure;
     _IsCriticalSuccess = criticalSuccess;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DieRollResult"/> class.
 /// </summary>
 /// <param name="die">The die.</param>
 /// <param name="rolledNumber">The rolled number.</param>
 public DieRollResult(IDie die, int rolledNumber)
 {
     Die           = die;
     _RolledNumber = rolledNumber;
     _ValueSet     = new ResultValueSet {
         { "Number", rolledNumber }
     };
     if (rolledNumber == 1)
     {
         _CriticalFailure = true;
     }
     if (rolledNumber == die.Sides)
     {
         _CriticalSuccess = true;
     }
 }