Esempio n. 1
0
        public void AddEntry(ScoreBoardEntry entry)
        {
            if (_scoreBoardEntries.ContainsKey(entry.ID))
            {
                throw new ArgumentException("Entry already added");
            }

            _scoreBoardEntries.Add(entry.ID, entry);
        }
Esempio n. 2
0
        public void SetScore(string id, int score)
        {
            if (!_scoreBoardEntries.ContainsKey(id))
            {
                throw new ArgumentException("No such entry");
            }

            ScoreBoardEntry entry = _scoreBoardEntries[id];

            if (entry.State != ScoreBoardEntry.EntryState.NotUsed)
            {
                throw new ArgumentException("Entry already used");
            }

            entry.Score = score;
        }