private int GetImpactPointsFor(GeographyTrait t) { if (t.Category == 3) { return(HighImpactPopularity); } if (t.Category == 2) { return(MediumImpactPopularity); } if (t.Category == 1) { return(LowImpactPopularity); } throw new System.Exception("Geography traits with a category outside 1,2,3 is not allowed."); }
private void UpdateDistrictAges() { foreach (District d in Districts.Values) { GeographyTrait coreTrait = d.Geography.FirstOrDefault(x => x.Type == GeographyTraitType.Core); if (coreTrait != null) { d.Geography.Remove(coreTrait); } GeographyTrait newTrait = d.Geography.FirstOrDefault(x => x.Type == GeographyTraitType.New); if (newTrait != null) { d.Geography.Remove(newTrait); } if (d.OrderId < 2) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.Core, 3)); } else if (d.OrderId < 4) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.Core, 2)); } else if (d.OrderId < 6) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.Core, 1)); } int numDistricts = Districts.Count; if (numDistricts - d.OrderId - 1 < 2) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.New, 3)); } else if (numDistricts - d.OrderId - 1 < 4) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.New, 2)); } else if (numDistricts - d.OrderId - 1 < 6) { d.Geography.Add(GetGeographyTrait(GeographyTraitType.New, 1)); } } }
public void Init(UI_ElectionTactics ui, GeographyTrait gt) { HoverAction = () => { UI.MapControls.ShowGeographyOverlay(gt.Type); }; Init(ui, gt.FullName, gt.BaseName, gt.Description); }