示例#1
0
 public void AddStreak(int streak)
 {
     if (streak != 0)
     {
         this._streak = this._streak.Add(streak);
     }
     else
     {
         this._streak = this._streak.resetStreak();
     }
 }
示例#2
0
 public Habit(Guid id, Guid user, string name, Logs count, Streak value, IGainer logGainer)
 {
     if (name == null)
     {
         throw new Exception("Name cannot be null");
     }
     if (name.Length < 2 || name.Length > 100)
     {
         throw new Exception("Name must between 2 and 100");
     }
     this._id        = id;
     this._users     = user;
     this._name      = name;
     this._daysoff   = new List <String>();
     this._logs      = count;
     this._streak    = value;
     this._logGainer = logGainer;
 }