Exemple #1
0
        /// <summary>
        /// </summary>
        /// <param name="checkpoint"></param>
        /// <param name="cpScore"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        public bool SetScore(int checkpoint, UpdateScore updateScore, ICycleScoreUpdater update)
        {
            var cpScore = new CpScore(updateScore.ResistanceScore.Value, updateScore.EnlightenedScore.Value);

            _scores[checkpoint] = cpScore;
            //this saves it
            return(update.UpdateScore(Cycle, checkpoint, long.Parse(updateScore.TimeStamp), cpScore));
        }
 public bool SetSnooze(bool isSnooze, ICycleScoreUpdater scoreUpdater)
 {
     return scoreUpdater.SetSnooze(Cycle, _timestampTicks, isSnooze);
 }
 public bool SetScore(IEnumerable<KeyValuePair<int, CpScore>> scores, ICycleScoreUpdater update, long? timeStamp = null)
 {
     var arrayScores = scores.ToArray();
     foreach (var keyValuePair in arrayScores)
     {
         _scores[keyValuePair.Key] = keyValuePair.Value;
     }
     //this persists it
     return update.UpdateScore(Cycle, timeStamp, arrayScores);
 }
 /// <summary>
 /// </summary>
 /// <param name="checkpoint"></param>
 /// <param name="updateScore"></param>
 /// <param name="update"></param>
 /// <returns></returns>
 public bool SetScore(int checkpoint, UpdateScore updateScore, ICycleScoreUpdater update)
 {
     var cpScore = new CpScore(updateScore.ResistanceScore.Value, updateScore.EnlightenedScore.Value, updateScore.Kudos);
     _scores[checkpoint] = cpScore;
     //this persists it
     return update.UpdateScore(Cycle, checkpoint, updateScore.ConvertTimeStamp(), cpScore);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="scoreUpdater">should be a singleton</param>
 /// <param name="slackSender"></param>
 public ValuesController(ICycleScoreUpdater scoreUpdater, ISlackSender slackSender)
 {
     _scoreUpdater = scoreUpdater;
     _slackSender  = slackSender;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="scoreUpdater">should be a singleton</param>
 /// <param name="slackSender"></param>
 public ValuesController(ICycleScoreUpdater scoreUpdater, ISlackSender slackSender)
 {
     _scoreUpdater = scoreUpdater;
     _slackSender = slackSender;
 }
 /// <summary>
 /// </summary>
 /// <param name="checkpoint"></param>
 /// <param name="cpScore"></param>
 /// <param name="update"></param>
 /// <returns></returns>
 public bool SetScore(int checkpoint, UpdateScore updateScore, ICycleScoreUpdater update)
 {
     var cpScore = new CpScore(updateScore.ResistanceScore.Value, updateScore.EnlightenedScore.Value);
     _scores[checkpoint] = cpScore;
     //this saves it
     return update.UpdateScore(Cycle, checkpoint, long.Parse(updateScore.TimeStamp), cpScore);
 }