Exemple #1
0
 public static string Serialize(StoredGameData obj)
 {
     return(JsonConvert.SerializeObject(obj, new JsonSerializerSettings
     {
         TypeNameHandling = TypeNameHandling.Auto
     }));
 }
Exemple #2
0
        private StoredGameData PrepareGameDataToPersist(IGame game)
        {
            StoredGameData gameData = _gameDataPersistMapper.Map(game);

            gameData.Items = game.Items.Select(_ => _fundsDriverPersistMapper.Map(_)).ToArray();
            game.ModifiedFundsDrivers.Clear();
            return(gameData);
        }
Exemple #3
0
 public void StoreGameDataForUser(string userId, StoredGameData gameData)
 {
     using (var proxy = new TInfrastructureProxy())
     {
         var channel = proxy.CreateChannel(_endpoint);
         channel.StoreGameDataForUser(userId, gameData);
         proxy.CloseChannel();
     }
 }