public void RemoveContract() { List <Contract> contracts = trader.GetContracts(); contracts.Remove(contract); trader.SetContracts(contracts); GameObject.Find("TraderInfo").GetComponent <TraderUI>().DisplayContract(); }
public void DisplayContract() { simpleMenu.CloseWindow(); if (trader == null) { return; } List <Contract> contracts = trader.GetContracts(); List <GameObject> objectList = new List <GameObject>(); for (int i = 0; i < contracts.Count; i++) { GameObject obj = Instantiate(contractTemp, simpleMenu.GetContent()); obj.GetComponent <ContractUI>().SetContract(trader, contracts[i], i); objectList.Add(obj); } simpleMenu.Display(objectList, "Contracts"); }
public void AddContract() { if (trader == null) { return; } if (settlement == null) { return; } if (workshop == null) { return; } List <Contract> contracts = trader.GetContracts(); contracts.Add(new Production(settlement.GetPosition(), settlement as Settlement, trader as Trader, settlement.GetWallet(), workshop as Workshop)); trader.SetContracts(contracts); }
public void AddContract() { if (desire == null) { return; } if (trader == null) { return; } if (settlement == null) { return; } List <Contract> contracts = trader.GetContracts(); contracts.Add(new Trade(trader as Trader, settlement as Settlement, settlement.GetPosition(), desire as Desire, desire.GetPrice())); trader.SetContracts(contracts); }