public string Save() { string s = ""; //_game.Serialize(); s += "[State]\n"; s += StaticHelpers.SetValue("Version", SERIALIZATION_VERSION); s += StaticHelpers.SetValue("GameState", _gameState); s += StaticHelpers.SetValue("TotalCardsDropped", _totalCardsDropped); s += StaticHelpers.SetValue("Dealer", _dealer); s += StaticHelpers.SetValue("PlayerCountingPoints", _nPlayerCountingPoint); s += StaticHelpers.SetValue("PlayerPointsThisTurn", _nPlayerPointsThisTurn); s += StaticHelpers.SetValue("ComputerCountingPoints", _nComputerCountingPoint); s += StaticHelpers.SetValue("ComputerPointsThisTurn", _nComputerPointsThisTurn); s += StaticHelpers.SetValue("CribPointsThisTurn", _nCribPointsThisTurn); s += StaticHelpers.SetValue("PlayerScore", _game.GetCurrentScore(PlayerType.Player)); s += StaticHelpers.SetValue("ComputerScore", _game.GetCurrentScore(PlayerType.Computer)); s += "[Grids]\n"; s += StaticHelpers.SetValue("Player", StaticHelpers.SerializeFromList(_view.GridPlayer.Items)); s += StaticHelpers.SetValue("Computer", StaticHelpers.SerializeFromList(_view.GridComputer.Items)); s += StaticHelpers.SetValue("Played", StaticHelpers.SerializeFromList(_view.GridPlayedCards.Items)); s += StaticHelpers.SetValue("Crib", StaticHelpers.SerializeFromList(_view.GridCrib.Items)); s += StaticHelpers.SetValue("SharedCard", _game.GetSharedCard().Serialize()); s += _game.Serialize(); s += _view.Save(); return(s); }
public string Save() { // // Score Instance and Cards use "," as a seperator. This is level 2, use "|" string s = String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|", _player, _scoreType, _score.Save(), _index, _total, _actualScore, _gameScore, StaticHelpers.SerializeFromList(_cards)); return(s); }