Пример #1
0
        public int getPlayerScore(int playerID)
        {
            int output = -1;

            DTO.PlayerInstance playerToRetrieve = connection.Table <DTO.PlayerInstance>().Where(x => x.identifier == playerID).FirstOrDefault();
            if (playerToRetrieve != null)
            {
                output = playerToRetrieve.score;
            }
            return(output);
        }
Пример #2
0
 /// <summary>
 /// Moves the given player to the given scene.
 /// </summary>
 /// <param name="playerID"></param>
 /// <param name="newScene"></param>
 public void setPlayerScene(int playerID, string newScene)
 {
     DTO.PlayerInstance playerToUpdate = connection.Table <DTO.PlayerInstance>().Where(x => x.identifier == playerID).FirstOrDefault();
     playerToUpdate.scene = newScene;
     connection.Update(playerToUpdate);
 }
Пример #3
0
 /// <summary>
 /// Adds to the player's score.
 /// </summary>
 /// <param name="playerID"></param>
 public void incrementPlayerScore(int playerID)
 {
     DTO.PlayerInstance playerToUpdate = connection.Table <DTO.PlayerInstance>().Where(x => x.identifier == playerID).FirstOrDefault();
     playerToUpdate.score = playerToUpdate.score + 1;
     connection.Update(playerToUpdate);
 }
Пример #4
0
 /// <summary>
 /// Finds the scene the given player is currently in.
 /// </summary>
 /// <param name="playerID"></param>
 /// <returns></returns>
 public string getPlayerScene(int playerID)
 {
     DTO.PlayerInstance player = connection.Table <DTO.PlayerInstance>().Where(x => x.identifier == playerID).FirstOrDefault();
     return(player.scene);
 }