Beispiel #1
0
 public static async void InsertChessResult(ChessGameResult result)
 {
     await Task.Run(() => {
         result.Uid = Guid.NewGuid().ToString();
         _db.InsertAsync <ChessGameResult>(result);
     });
 }
		private double GetGameRatingFromGameResult(ChessGameResult gameResult)
		{
			switch (gameResult)
			{
				case ChessGameResult.WhiteWon:
					return 100;
				case ChessGameResult.BlackWon:
					return -100;
				case ChessGameResult.Draw:
					return 0;
				default:
					throw new ArgumentOutOfRangeException(nameof(gameResult), gameResult, null);
			}
		}
 public ChessBoardPresenter( )
 {
     _result = new ChessGameResult();
 }