Esempio n. 1
0
 public serializable.Network create_serializable_network()
 {
     serializable.Network out_network = new serializable.Network();
     serialize_action_groups(out_network);
     serialize_figures(out_network);
     return(out_network);
 }
Esempio n. 2
0
 private void serialize_figures(serializable.Network out_network)
 {
     foreach (
         Figure figure in
         figure_provider.get_known_figures()
         )
     {
         out_network.figures.Add(
             new serializable.Figure(figure)
             );
         serialize_figure_appearances(out_network, figure);
     }
 }
Esempio n. 3
0
 private void serialize_action_groups(serializable.Network out_network)
 {
     foreach (
         IAction_group action_group in
         action_history.get_action_groups(
             0, action_history.last_moment
             )
         )
     {
         out_network.action_groups.Add(
             new serializable.Action_group(action_group)
             );
     }
 }
Esempio n. 4
0
 private void serialize_figure_appearances(
     serializable.Network out_network,
     general.IFigure figure
     )
 {
     foreach (
         IFigure_appearance appearance in
         figure.get_appearances_in_interval(
             0,
             action_history.last_moment
             )
         )
     {
         out_network.figure_appearances.Add(
             new serializable.Figure_appearance(appearance)
             );
     }
 }
Esempio n. 5
0
 private void reconstruct_network(serializable.Network network)
 {
     //load_figures(network.figures);
     load_action_groups(network.action_groups);
     load_figure_appearances(network.figure_appearances);
 }
Esempio n. 6
0
 public void on_load(string file)
 {
     serializable.Network in_network = read_json <serializable.Network>(file);
     reconstruct_network(in_network);
 }
Esempio n. 7
0
 public void on_save(string file)
 {
     serializable.Network out_network = create_serializable_network();
     write_json(file, out_network);
 }