public override void Do(Track habitTrack) { HabitTrack ht = habitTrack as HabitTrack; if (ht == null) { throw new Exception("habitTrack is not valid"); } bool IsFounded = false; foreach (Habit list in Habits) { if (ht.Todo == list) { IsFounded = true; ht.Todo.AddLogsHabit(_gainer.Gain(), ht.Date); break; } } if (IsFounded == false) { throw new Exception("Not habit is founded"); } }
public static Tracker AddTracker(HabitTrack tracked) { return(new Tracker(tracked.Todo.ID, tracked.Person, tracked.Date)); }