protected static BoardGamePlayerScore GetScoreData(string gamename, Mobile player) { List<BoardGamePlayerScore> scores = GetScores(gamename); if (scores == null) { var gamedata = new BoardGameData(gamename); GameData.Add(gamedata); scores = gamedata.Scores; } int index = BoardGamePlayerScore.IndexOf(scores, player); if (index == -1) { var newscore = new BoardGamePlayerScore(player); scores.Add(newscore); return newscore; } return scores[index]; }
protected static BoardGamePlayerScore GetScoreData(string gamename, Mobile player) { List <BoardGamePlayerScore> scores = GetScores(gamename); if (scores == null) { var gamedata = new BoardGameData(gamename); GameData.Add(gamedata); scores = gamedata.Scores; } int index = BoardGamePlayerScore.IndexOf(scores, player); if (index == -1) { var newscore = new BoardGamePlayerScore(player); scores.Add(newscore); return(newscore); } return(scores[index]); }