private static void SetupPlaygroundPanel() { var panelPlayground = _modelingForm.PlaygroundPanel; PanelPlaygroundWidth = _topology.ColsCount * TopologyCellSize; PanelPlaygroundHeight = _topology.RowsCount * TopologyCellSize + 1 * TopologyCellSize; DestinationPointsDefiner.DefineCommonPoints(); panelPlayground.Size = new Size(PanelPlaygroundWidth, PanelPlaygroundHeight); for (int i = 0; i < _topology.RowsCount; i++) { for (int j = 0; j < _topology.ColsCount; j++) { var topologyElement = _topology[j, i]; if (topologyElement == null) { continue; } var creationPointX = j * TopologyCellSize; var creationPointY = i * TopologyCellSize; var creationPoint = new Point(creationPointX, creationPointY); if (topologyElement is CashCounter) { CreateCashCounter(topologyElement as CashCounter, creationPoint); } if (topologyElement is Entry) { CreateEnter(creationPoint); } if (topologyElement is Exit) { CreateExit(creationPoint); } if (topologyElement is FuelDispenser fuelDispenser) { CreateFuelDispenser(fuelDispenser, creationPoint); } if (topologyElement is FuelTank fuelTank) { CreateFuelTank(fuelTank, creationPoint); ModelSettings.AddUniqueFuel(fuelTank.Fuel); } } } panelPlayground.MouseClick += ClickEventProvider.PlaygroundPanel_Click; }
internal static MappedTopology MapTopology(ModelingForm modelingForm, Topology.Topology topology, TrafficFlow trafficFlow) { _modelingForm = modelingForm; _topology = topology; ModelSettings.SetUpModelSettings(trafficFlow); _mappedTopology = new MappedTopology(); ElementPictureBoxProducer.SetUpElementPictureBoxProducer(modelingForm, _mappedTopology); SetupPlaygroundPanel(); SetupServiceArea(); DestinationPointsDefiner.DefineElementsPoints(_mappedTopology); return(_mappedTopology); }