void OnHireWrestler() { Wrestler hiredWrestler = wrestlers.Find(x => x.wrestlerName == wrestlerDialog.GetSelectedOption().name); gameManager.GetPlayerCompany().AddWrestlerToRoster(hiredWrestler); gameManager.GetPlayerCompany().money -= hiredWrestler.hiringCost; gameManager.OnCompanyUpdated(); bool hasTwoPlusWrestlers = (gameManager.GetPlayerCompany().GetRoster().Count > 1); // If the player doesn't have enough wrestlers, we won't let the player leave the hiring screen. bool hasMoreWrestlersToHire = (GetWrestlersForHire().Count > 0); addAnotherDialog = gameManager.GetGUIManager().InstantiateInfoDialog(); if (hasMoreWrestlersToHire) { if (gameManager.GetPlayerCompany().CanAddWrestlers()) { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\n" + (hasTwoPlusWrestlers ? "Would you like to hire another wrestler?" : "Now, choose another wrestler!"), new UnityAction(HireWrestler), hasTwoPlusWrestlers, new UnityAction(DoneHiring), "Yes", "No"); } else { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\nYour roster is now full.", new UnityAction(DoneHiring)); } } else { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\nThere aren't any more wrestlers available for hire.", new UnityAction(DoneHiring)); } }
void OnFireWrestler() { Wrestler firedWrestler = wrestlers.Find(x => x.wrestlerName == wrestlerDialog.GetSelectedOption().name); gameManager.GetPlayerCompany().RemoveFromRoster(firedWrestler); gameManager.OnCompanyUpdated(); bool canFireMoreWrestlers = (gameManager.GetPlayerCompany().GetRoster().Count > 2); InfoDialog addAnotherDialog = gameManager.GetGUIManager().InstantiateInfoDialog(); if (canFireMoreWrestlers) { addAnotherDialog.Initialize("Wrestler fired!", "You fired " + firedWrestler.wrestlerName + "!\n" + "Would you like to fire another wrestler?", new UnityAction(FireWrestler), true, new UnityAction(DoneFiring), "Yes", "No"); } else { addAnotherDialog.Initialize("Wrestler fired!", "You fired " + firedWrestler.wrestlerName + "!\n" + cantFireMessage, new UnityAction(DoneFiring)); } }
void OnChooseWrestler() { selectedWrestler = roster.Find(x => x.wrestlerName == wrestlerDialog.GetSelectedOption().name); trainingTypeDialog = GameManager.Instance.GetGUIManager().InstantiateSelectOptionDialog(true); trainingTypeDialog.Initialize("Choose a training type", GetTrainingTypes(), new UnityAction(OnTrainingChosen), true, new UnityAction(ChooseWrestler), "OK", "Back"); }