Exemple #1
0
        /// <summary>
        /// Shows the building indicator.
        /// </summary>
        /// <param name="coord">The positionI.</param>
        /// <param name="area">The ownership of the area.</param>
        public void ShowBuildingIndicator(PositionI coord, TileTouchHandler.Area area)
        {
            var gid = new CCTileGidAndFlags(Client.Common.Constants.HelperSpritesGid.GREENINDICATOR);

            m_areaIndicators.TryGetValue(area, out gid);

            var buildings = Core.Controllers.Controller.Instance.RegionManagerController.GetRegion(coord.RegionPosition)
                                .GetEntity(coord.CellPosition).Owner.TerritoryBuildings.Keys;

            int range;
            foreach (var building in buildings)
            {
                var entity = Core.Controllers.Controller.Instance.RegionManagerController.GetRegion(building.RegionPosition).GetEntity(building.CellPosition);
                if (entity.Definition.SubType == Core.Models.Definitions.EntityType.Headquarter)
                {
                    range = Core.Models.Constants.HEADQUARTER_TERRITORY_RANGE;
                }
                else
                {
                    range = Core.Models.Constants.GUARDTOWER_TERRITORY_RANGE;
                }

                var surroundedPositions = LogicRules.GetSurroundedPositions(building, range);
                m_surroundedPositions.UnionWith(surroundedPositions);
            }

            AddSprites(gid);
        }
Exemple #2
0
        /// <summary>
        /// Draws the indicator on the Map
        /// </summary>
        /// <param name="coord">The Center Position.</param>
        /// <param name="range">The Range.</param>
        /// <param name="area">The Area Type.</param>
        public void ShowUnitIndicator(PositionI coord, int range, TileTouchHandler.Area area)
        {
            var gid = new CCTileGidAndFlags(Client.Common.Constants.HelperSpritesGid.GREENINDICATOR);

            m_areaIndicators.TryGetValue(area, out gid);

            if (area == TileTouchHandler.Area.Movement)
            {
                var indi = new Core.Controllers.AStar_Indicator.Indicator(coord, range, GameAppDelegate.Account.ID);
                m_surroundedPositions = indi.FindPossiblePositions();
            }

            AddSprites(gid);
        }