private void GreatPersonRequested(GreatPersonType type) { if (FreeGreatPeopleCanon.GetFreeGreatPeopleForCiv(ObjectToDisplay) > 0) { GreatPersonFactory.BuildGreatPerson(type, ObjectToDisplay); FreeGreatPeopleCanon.RemoveFreeGreatPersonFromCiv(ObjectToDisplay); Refresh(); } }
public void PerformGreatPeopleGeneration() { foreach (var greatPersonType in EnumUtil.GetValues <GreatPersonType>()) { float progress = GreatPersonCanon.GetPointsTowardsTypeForCiv(greatPersonType, this); float needed = GreatPersonCanon.GetPointsNeededForTypeForCiv(greatPersonType, this); if (progress >= needed && GreatPersonFactory.CanBuildGreatPerson(greatPersonType, this)) { float pointsLeft = progress - needed; GreatPersonCanon.SetPointsTowardsTypeForCiv(greatPersonType, this, pointsLeft); GreatPersonFactory.BuildGreatPerson(greatPersonType, this); } } }