public static string Export(Replay replay)
 {
     Game game = new Game(replay);
     GameState oldState = null;
     List<GameAction> actions = new List<GameAction>();
     for (int i = 0; i < replay.Actions.Count; i++)
     {
         if (replay.Actions[i] is ReplayTimeAction)
             actions.Add(replay.Actions[i]);
         game.Seek(i);
         List<GameAction> newActions = StateDelta.Delta(oldState, game.State);
         actions.AddRange(newActions);
         if (game.State != null)
             oldState = game.State.Clone();
     }
     List<JObject> jActions = new List<JObject>();
     TimeSpan time = TimeSpan.Zero;
     foreach (var action in actions)
     {
         if (action is ReplayTimeAction)
             time = ((ReplayTimeAction)action).Time;
         else
             jActions.Add(SerializeAction(action, time));
     }
     JObject json = new JObject(new JProperty("changes", new JArray(jActions)));
     return json.ToString(Newtonsoft.Json.Formatting.None);
 }