public ConcentrationNode CreateNewConcentrationNode(string name) { foreach (Node n in NodeList) { if (n.GetName == name) { Console.WriteLine("Le noeud nommé {0} existe déjà. Entrez un nouveau nom :", name); string newName = Console.ReadLine(); return(CreateNewConcentrationNode(newName)); } } ConcentrationNode NewConcentrationNode = new ConcentrationNode(name); NodeList.Add(NewConcentrationNode); LineList.Add(NewConcentrationNode.GetOutputLine); PowerPlant shop = new PurchaseAbroad("shop_" + name, market); NewConcentrationNode.AddInputLineToList(shop.GetOutPutLine); shop.GetOutPutLine.SetOutputNode(NewConcentrationNode); shop.GetOutPutLine.SetIsMarketLine(true); return(NewConcentrationNode); }
public PowerPlant CreateNewPurchasedAbroad(string name, Market market) { foreach (PowerPlant pp in PowerPlantList) { if (pp.GetName == name) { Console.WriteLine("La centrale nommée {0} existe déjà. Entrez un nouveau nom :", name); string newName = Console.ReadLine(); return(CreateNewPurchasedAbroad(newName, market)); } } PowerPlant NewPowerPlant = new PurchaseAbroad(name, market); PowerPlantList.Add(NewPowerPlant); NodeList.Add(NewPowerPlant.GetOutputNode); LineList.Add(NewPowerPlant.GetOutPutLine); MarketList.Add((PurchaseAbroad)NewPowerPlant); return(NewPowerPlant); }
public void SetMyMarket(PurchaseAbroad m) { myMarket = m; }