static void Main(string[] args) { List <Department> departments = new List <Department>(); double baseBudget = 75000.00; // Create some instances HumanResources hr = new HumanResources("HR", "Jack Reacher", 2); InformationTechnology it = new InformationTechnology("IT", "John Wick", 12); Marketing mkt = new Marketing("Marketing", "John McClane", 12); Sales sls = new Sales("Sales", "Brian Mills", 22); // Add derived departments to the list departments.Add(hr); departments.Add(it); departments.Add(mkt); departments.Add(sls); // Iterate over all items in the list and output a string // representation of the class foreach (Department d in departments) { d.SetBudget(baseBudget); Console.WriteLine($"{d.toString()}"); } }
private IEnumerator LoadInformationTechnologyJobLimits() { UnityWebRequest www = UnityWebRequest.Get("http://18.223.239.177/hello/getIt/" + DB.GameCode); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { JsonData = www.downloadHandler.text; informationTechnology = JsonUtility.FromJson <InformationTechnology>(JsonData); { int max = -1; if (informationTechnology.CTO > max) { max = informationTechnology.CTO; } if (informationTechnology.HOP > max) { max = informationTechnology.HOP; } if (informationTechnology.Applications.architect > max) { max = informationTechnology.Applications.architect; } if (informationTechnology.Applications.developer > max) { max = informationTechnology.Applications.developer; } if (informationTechnology.Applications.manager > max) { max = informationTechnology.Applications.manager; } if (informationTechnology.Designer.leadUX > max) { max = informationTechnology.Designer.leadUX; } if (informationTechnology.Designer.serniorUX > max) { max = informationTechnology.Designer.serniorUX; } if (informationTechnology.Designer.UX > max) { max = informationTechnology.Designer.UX; } informationTechnology.total_upper = max; // sending data here... StartCoroutine(SendInformationTechnologyJobLimits()); } } }