/*private void load_figures(List<serializable.Figure> figures) { * figure_storage = persistence.figure_storage; * foreach (serializable.Figure figure in figures) { * if (figure.subfigures.Any()) { * create_figure_having(figure.subfigures); * } * else { * figure_storage.provide_pattern_for_base_input(pattern.id); * } * } * } * private void create_figure_having(IList<string> subfigures_ids) { * List<IFigure> subfigures = new List<IFigure>(); * foreach (string subfigure_id in subfigures_ids) { * subfigures.Add(figure_storage.provide_pattern_for_base_input(subfigure_id)); * } * figure_storage.provide_pattern_having(subfigures); * }*/ #endregion figures #region action_groups private void load_action_groups(IList <serializable.Action_group> action_groups) { Action_history history = persistence.action_history; foreach (serializable.Action_group group in action_groups) { Action_group new_group = history.create_next_action_group(group.mood); new_group.transform.position = group.position.to_unity(); } }
private void load_figure_appearances(IList <serializable.Figure_appearance> appearances) { Action_history history = persistence.action_history; Figure_provider figure_provider = persistence.figure_provider; foreach (serializable.Figure_appearance appearance in appearances) { IFigure figure = figure_provider.find_figure_with_id( appearance.appeared_figure ); Contract.Ensures( figure != null, "figures should be loaded before their appearances" ); history.create_figure_appearance( figure, history.get_action_group_at_moment(appearance.get_start_moment()), history.get_action_group_at_moment(appearance.get_end_moment()) ); } }