Skip to content
Snippets Groups Projects
Select Git revision
  • dcbb784f16a9f2e64574e2787bcdab57c49f5ec9
  • main default protected
  • leveleditor
  • david-author
  • clang-tidy-cleanup
  • architecture-refactoring
  • cleanUpMenus
  • doxygen-cleanup
  • project-structure-refactoring
  • interpolation
  • buildingFeatures
  • win_end_screen
  • helpMenu
  • leveleditor-placement
  • text-rendering
  • updated_unit_contextmenu
  • level-from-commandline
  • unit_contextmenu
  • player
  • engine-scaling
  • clang-tidy
21 results

RecruitingMenu.hpp

Blame
  • GraphVisualizer.cs 676 B
    using Microsoft.Msagl.Drawing;
    
    namespace FlowForge;
    
    public class GraphVisualizer
    {
        public static Graph ConvertToMsaglGraph(FlowGraph flowGraph)
        {
            Graph msaglGraph = new Graph();
    
            foreach (var vertex in flowGraph.Graph.Vertices)
            {
                var msaglNode = msaglGraph.AddNode(vertex.Id);
                msaglNode.LabelText = vertex.Label; // Use the label from FlowNode
            }
    
            foreach (var edge in flowGraph.Graph.Edges)
            {
                var msaglEdge = msaglGraph.AddEdge(edge.Source.Id, edge.Target.Id);
                msaglEdge.LabelText = $"{edge.CurrentFlow}/{edge.MaxFlow}";
            }
    
            return msaglGraph;
        }
    }