public ChurchRadiusCalculator(ChurchInfo church, Point mapLoc, Size villageSize) { _church = church; _mapLoc = mapLoc; _villageSize = villageSize; }
public VillageTooltip(Village village) { _village = village; _church = World.Default.Map.Manipulators.ChurchManipulator.GetChurch(_village); }
public void ChurchChange(Village village, int level, bool redrawMaps = true) { if (ChurchChanged != null) { var church = _map.Manipulators.ChurchManipulator.GetChurch(village); if (church == null) { church = new ChurchInfo(village, level); } else { church.ChurchLevel = level; } ChurchChanged(null, new ChurchEventArgs(church)); if (redrawMaps) { World.Default.DrawMaps(false); } } }
private static UICommand[] CreateChurchLevelCommands(CommandEventHandler handler, ChurchInfo church) { var churchLevelCommands = new List<UICommand>(); for (int i = 0; i <= 3; i++) { churchLevelCommands.Add(CreateChurchLevelCommand(handler, i, church == null ? -1 : church.ChurchLevel)); } return churchLevelCommands.ToArray(); }
public static void AddChurchCommands(UIContextMenu menu, ChurchInfo church, CommandEventHandler handler) { Debug.Assert(World.Default.Settings.Church); string commandText = "Church" + (church == null ? "" : string.Format(" ({0})", church.ChurchLevel)); var containerCommand = new UICommand("", commandText) { Image = Properties.Resources.Church }; containerCommand.Commands.AddRange(CreateChurchLevelCommands(handler, church)); if (church != null) { containerCommand.Commands.AddSeparator(); containerCommand.Commands.AddChangeColorCommand("Color", church.Color, ChurchInfo.DefaultColor, (sender, selectedColor) => church.Color = selectedColor); } menu.Commands.Add(containerCommand); }