Exemplo n.º 1
0
        public void AddEdge(int from, int to, int weight = 1)
        {
            if (from < 0 || from > CurrGraph.Nodes.Count || to < 0 || to > CurrGraph.Nodes.Count)
            {
                throw new ArgumentOutOfRangeException();
            }

            CurrGraph.AddConnection(from, to, weight);
        }
Exemplo n.º 2
0
        public void RemoveEdge(int from, int to)
        {
            if (from < 0 || from > CurrGraph.Nodes.Count || to < 0 || to > CurrGraph.Nodes.Count)
            {
                throw new ArgumentOutOfRangeException();
            }

            CurrGraph.RemoveConnection(from, to);
        }
Exemplo n.º 3
0
        public void AddNode(float x, float y)
        {
            if (x < 0 || x > Width || y < 0 || y > Height)
            {
                throw new ArgumentOutOfRangeException();
            }

            CurrGraph.AddDrawableNode(x, y, Radius);
        }