/// <summary>Warns the player.</summary>
        /// <param name="playerId">The player identifier.</param>
        /// <returns>
        /// WarnPlayer this method is used to warn the yoyo fitness test participents  <br />
        /// </returns>
        public Player WarnPlayer(int playerId)
        {
            var playersList = _getPlayerRepository.GetPlayers();
            int editIndex   = playersList.FindIndex(o => o.id == playerId);

            playersList[editIndex].warn = true;
            //save data someware..

            return(playersList[editIndex]);
        }
        /// <summary>Results the player.</summary>
        /// <param name="playerId">The player identifier.</param>
        /// <param name="result">The result.</param>
        /// <returns>
        /// ResultPlayer this method is used to get the final result of the participents  <br />
        /// </returns>
        public PlayerResultViewModel ResultPlayer(int playerId, string result)
        {
            var playerResult = new PlayerResultViewModel();

            try
            {
                var playersList = _getPlayerRepository.GetPlayers();
                int editIndex   = playersList.FindIndex(o => o.id == playerId);
                playerResult.id     = playersList[editIndex].id;
                playerResult.result = result;
                //save data someware..
            }
            catch (Exception ex)
            {
            }

            return(playerResult);
        }
Exemple #3
0
 /// <summary>Gets the players.</summary>
 /// <returns>
 /// GetPlayers this method is used to get the list of participants in the yoyo test <br />
 /// </returns>
 public List <Player> GetPlayers()
 {
     return(_getPlayerRepository.GetPlayers());
 }