private Node CreateEventNode(string eventName, NodeType type, Color color) { Node eventNode; if (eventNodes.TryGetValue(eventName, out eventNode)) { Debug.LogError("Event node already exists " + eventName); return(eventNode); } var info = new GameEventNodeInfo(eventName) { type = type, color = color }; ICurve curve = CurveFactory.CreateRectangle(info.baseSize.x, info.baseSize.y, new Point()); eventNode = new Node(curve, info); eventNodes.Add(eventName, eventNode); graph.Nodes.Add(eventNode); return(eventNode); }
private Node CreateUserNode(string user) { Node node; if (userNodes.TryGetValue(user, out node)) { Debug.LogError("Node " + user + " already exists"); return(node); } var info = new GameEventNodeInfo(user) { type = NodeType.User, color = Color.black }; ICurve curve = CurveFactory.CreateRectangleWithRoundedCorners(info.baseSize.x, info.baseSize.y, nodeRadii.x, nodeRadii.y, new Point()); //ICurve curve = CurveFactory.CreateDiamond(info.baseSize.x, info.baseSize.y, new Point()); // ICurve curve = CurveFactory.CreateRectangle(info.baseSize.x, info.baseSize.y, new Point()); node = new Node(curve, info); userNodes.Add(user, node); graph.Nodes.Add(node); return(node); }