/// <summary> /// Sets (updates/creates) a record category. /// </summary> public JsonResult RecordCategory(RecordCategory recordCategory) { var clientV2 = SvcBldr.AdministrationV2(); var srRecCat = new SR <RecordCategory>(); if (recordCategory.Id == Guid.Empty) { recordCategory.Id = Functions.NewSeq(); srRecCat = clientV2.CreateRecordCategory(recordCategory); } else { srRecCat = clientV2.UpdateRecordCategory(recordCategory); } return(Result(srRecCat.Result, srRecCat.Error)); }
private void OnRecordDeleted(int teamId, RecordCategory recordCategory, string recordedTimestamp) { if (recordCategory == RecordCategory.Goal) { if (teamId >= 0 && teamId <= 1) { _teamScores[teamId]--; _scoreText.text = string.Format("{0} : {1}", _teamScores[0], _teamScores[1]); } } var teamTimestamps = teamId == 0 ? _team1Timestamps : _team2Timestamps; if (teamTimestamps.ContainsKey(recordCategory)) { teamTimestamps[recordCategory].Remove(recordedTimestamp); } }
private void RecordTimestamp(int teamId, RecordCategory recordCategory) { if (teamId == 0) { if (!_team1Timestamps.ContainsKey(recordCategory)) { _team1Timestamps[recordCategory] = new List <string>(); } _team1Timestamps[recordCategory].Add(_timer.GetCurrentTime()); } else { if (!_team2Timestamps.ContainsKey(recordCategory)) { _team2Timestamps[recordCategory] = new List <string>(); } _team2Timestamps[recordCategory].Add(_timer.GetCurrentTime()); } }
public void SetCategory(RecordCategory recordCategory) { m_recordCategory = recordCategory; }