public GraphEdge(BinaryReader reader) { m_type = Factory.ObjectType.GraphEdge; m_from = null; m_to = null; m_loop = reader.ReadBoolean(); }
public Graph() { m_roots = new ArrayList(); m_leafs = new ArrayList(); m_parent = null; m_type = Factory.ObjectType.Graph; }
public GraphEdge(GraphNode from, GraphNode to) { m_type = Factory.ObjectType.GraphEdge; m_from = from; m_to = to; if (to.Successors.Count > 0 && to.getRoot() == from.getRoot()) m_loop = true; else m_loop = false; }
public Settings(BinaryReader reader) : this((RoomGraph)null) { m_type = Factory.ObjectType.Settings; bool start_room_saved = reader.ReadBoolean(); if (start_room_saved) { m_startroomindex = reader.ReadInt32(); } }
public GraphNode() { m_location = new Point(0,0); m_size = new Point(0,0); m_succs = new ArrayList(); m_preds = new ArrayList(); m_properties = new ArrayList(); m_type = Factory.ObjectType.GraphNode; m_name = "Node"; m_lower_graph = null; }
public Settings(RoomGraph graph) { // // Required for Windows Form Designer support // InitializeComponent(); m_graph = graph; m_startroom = null; m_type = Factory.ObjectType.Settings; m_startroomindex = -1; }
public GraphNode(BinaryReader reader) : this() { m_location.X = reader.ReadInt32(); m_location.Y = reader.ReadInt32(); m_size.X = reader.ReadInt32(); m_size.Y = reader.ReadInt32(); m_name = reader.ReadString(); m_type = Factory.ObjectType.GraphNode; int count = reader.ReadInt32(); for (int i = 0; i < count; ++i){ m_properties.Add(new ObjProperty(reader)); } bool subgraph = reader.ReadBoolean(); if (subgraph){ //load subgraph //attention: currently, the parent member cannot be restored. //It is re-set when needed by the GraphFrom m_lower_graph = (Graph)Factory.makeObject(reader); } }
public Graph(BinaryReader reader) : this() { m_type = Factory.ObjectType.Graph; ArrayList tmpnodes = new ArrayList(); int count = reader.ReadInt32(); for (int i = 0; i < count; ++i) { GraphNode node = (GraphNode)Factory.makeObject(reader); tmpnodes.Add(node); addUnconnectedNode(node); } count = reader.ReadInt32(); for (int i = 0; i < count; ++i) { GraphEdge edge = (GraphEdge)Factory.makeObject(reader); int from = reader.ReadInt32(); int to = reader.ReadInt32(); edge.From = (GraphNode)tmpnodes[from]; edge.To = (GraphNode)tmpnodes[to]; addEdge(edge); } }