ChessDBLibrary.Game.AddNewGame C# (CSharp) Method

AddNewGame() public method

public AddNewGame ( int blackPlayerID, int whitePlayerID, int creatorID, System startDateTime, int timeControl, int gameStatus, string movesHistory, string boardState, int whiteRestTime, int blackRestTime ) : void
blackPlayerID int
whitePlayerID int
creatorID int
startDateTime System
timeControl int
gameStatus int
movesHistory string
boardState string
whiteRestTime int
blackRestTime int
return void
        public void AddNewGame(int blackPlayerID, int whitePlayerID, int creatorID, System.DateTime startDateTime, int timeControl, int gameStatus,
                                    string movesHistory, string boardState, int whiteRestTime, int blackRestTime)
        {
            try
            {
                ChessDataSet.GamesRow newRow = gamesTable.NewGamesRow();

                newRow.BlackPlayerID = blackPlayerID;
                newRow.WhitePlayerID = whitePlayerID;
                newRow.CreatorID = creatorID;
                newRow.StartDateTime = startDateTime;
                newRow.TimeControl = timeControl;
                newRow.GameStatus = gameStatus;
                newRow.MovesHistory = movesHistory;
                newRow.BoardState = boardState;
                newRow.WhiteRestTime = whiteRestTime;
                newRow.BlackRestTime = blackRestTime;

                gamesTable.AddGamesRow(newRow);
                gamesAdapter.Update(gamesTable);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }