Esempio n. 1
0
        private void create_subfigure(Figure figure)
        {
            Subfigure subfigure =
                built_repr.create_subfigure(figure) as Subfigure;

            connect_subnode_to_this_builder(subfigure);
        }
Esempio n. 2
0
        public void on_subfigures_touched(Subfigure moved_subfigure, Subfigure other_subfigure)
        {
            if (!change_connections)
            {
                return;
            }
            if (moved_subfigure.is_connected(other_subfigure))
            {
                return;
            }
            Subfigure first_subfigure;
            Subfigure second_subfigure;

            if (moved_subfigure.transform.position.x < other_subfigure.transform.position.x)
            {
                first_subfigure  = moved_subfigure;
                second_subfigure = other_subfigure;
            }
            else
            {
                first_subfigure  = other_subfigure;
                second_subfigure = moved_subfigure;
            }
            first_subfigure.connext_to_next(second_subfigure);
        }
Esempio n. 3
0
 private void mark_object_as_selected(Subfigure selectable)
 {
     if (selectable.selection_sprite_renderer != null)
     {
         selectable.selection_sprite_renderer.material.color = Selector.instance.selected_color;
     }
 }
 private void attach_subfigure(Subfigure subfigure)
 {
     subfigure.transform.parent = subfigures_folder.transform;
     subfigure.parent           = this;
     position_subfigure(subfigure);
     subfigures.Add(subfigure);
 }
Esempio n. 5
0
        private void create_node_for_stencil_interface(Stencil_interface direction)
        {
            Subfigure subfigure =
                built_repr.create_subfigure(direction) as Subfigure;

            connect_subnode_to_this_builder(subfigure);
        }
Esempio n. 6
0
 private void update_direction_of_connections(Subfigure subfigure)
 {
     foreach (Subfigure next_subfigure in subfigure.next.ToArray())
     {
         if (
             subfigure.transform.position.x >
             next_subfigure.transform.position.x
             )
         {
             subfigure.disconnect_from_next(next_subfigure);
             next_subfigure.connext_to_next(subfigure);
             Debug.Log("next_subfigure changes to prev");
         }
     }
     foreach (Subfigure prev_subfigure in subfigure.previous.ToArray())
     {
         if (
             subfigure.transform.position.x <
             prev_subfigure.transform.position.x
             )
         {
             prev_subfigure.disconnect_from_next(subfigure);
             subfigure.connext_to_next(prev_subfigure);
             Debug.Log("prev_subfigure changes to next");
         }
     }
 }
        public ISubfigure create_subfigure(Stencil_interface direction)
        {
            Subfigure subfigure = subfigure_prefab.
                                  create_for_stencil_interface(direction);

            attach_subfigure(subfigure);
            return(subfigure);
        }
Esempio n. 8
0
        public Subfigure create_for_stencil_interface(Stencil_interface direction)
        {
            Subfigure subfigure = this.provide_new <Subfigure>();

            subfigure.id = Id_assigner.get_next_id();
            subfigure.init_for_stencil(direction);
            return(subfigure);
        }
        public ISubfigure create_subfigure(IFigure child_figure)
        {
            Subfigure subfigure = subfigure_prefab.
                                  create_for_figure(child_figure);

            attach_subfigure(subfigure);
            return(subfigure);
        }
Esempio n. 10
0
        public Subfigure create_for_figure(IFigure figure)
        {
            Subfigure subfigure = this.provide_new <Subfigure>();

            subfigure.id = Id_assigner.get_next_id();
            subfigure.referenced_figure = figure;
            subfigure.init_for_figure(figure);
            return(subfigure);
        }
Esempio n. 11
0
 private void write_next_nodes_for(Subfigure subfigure, StringBuilder result)
 {
     foreach (Subfigure next_sunfigure in subfigure.next)
     {
         result.AppendFormat(
             "\"{0}\" -> \"{1}\"\n",
             subfigure.get_name(),
             next_sunfigure.get_name()
             );
     }
 }
Esempio n. 12
0
 private void delete_connection_arrow_to(Subfigure next)
 {
     foreach (
         Connection connection in
         connections_attachment.GetComponentsInChildren <Connection>()
         )
     {
         if (connection.destination == next)
         {
             connection.destroy_object();
         }
     }
 }
Esempio n. 13
0
 private void delete_all_connections_touching(Subfigure detached_subfigure)
 {
     foreach (Subfigure subfigure in subfigures)
     {
         if (detached_subfigure.next.Contains(subfigure))
         {
             detached_subfigure.disconnect_from_next(subfigure);
         }
         if (subfigure.next.Contains(detached_subfigure))
         {
             subfigure.disconnect_from_next(detached_subfigure);
         }
     }
 }
Esempio n. 14
0
 private void disconnect_subnode_from_this_builder(Subfigure subfigure)
 {
     subfigure.manual_figure_builder = null;
     subfigure.click_receiver        = null;
 }
Esempio n. 15
0
        private void create_connection_arrow_to(Subfigure next)
        {
            Connection new_connection = connection_prefab.create(this, next);

            new_connection.transform.parent = connections_attachment;
        }
Esempio n. 16
0
 public void delete_subfigure(Subfigure subfigure)
 {
     delete_all_connections_touching(subfigure);
     subfigures.Remove(subfigure);
     subfigure.destroy_object();
 }
Esempio n. 17
0
 private void position_subfigure(Subfigure subfigure)
 {
     subfigure.transform.position =
         get_position_of_last_subfigure() + subfigures_offset;
 }
Esempio n. 18
0
 public void on_click(Subfigure subfigure)
 {
     deselect_all();
     select(subfigure);
     Mover_of_selected.instance.add_moved_thing(subfigure);
 }
Esempio n. 19
0
 private void select(Subfigure subfigure)
 {
     mark_object_as_selected(subfigure);
     selected_subfigures.Add(subfigure);
 }
Esempio n. 20
0
 private void connect_subnode_to_this_builder(Subfigure subfigure)
 {
     subfigure.manual_figure_builder = this;
     subfigure.click_receiver        = this;
 }