示例#1
0
 public ChurchRadiusCalculator(ChurchInfo church, Point mapLoc, Size villageSize)
 {
     _church = church;
     _mapLoc = mapLoc;
     _villageSize = villageSize;
 }
示例#2
0
 public VillageTooltip(Village village)
 {
     _village = village;
     _church = World.Default.Map.Manipulators.ChurchManipulator.GetChurch(_village);
 }
示例#3
0
        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);
                }
            }
        }
示例#4
0
 public ChurchRadiusCalculator(ChurchInfo church, Point mapLoc, Size villageSize)
 {
     _church      = church;
     _mapLoc      = mapLoc;
     _villageSize = villageSize;
 }
示例#5
0
        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();
        }
示例#6
0
        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);
        }