예제 #1
0
        /// <summary>
        /// Checks if there are nearby enemy living pirates within a given range. Default range will be the unload range of the city
        /// </summary>
        /// <param name="range">The range to check</param>
        /// <returns>true for enemies nearby, else false</returns>
        public bool IsCamped(int range = -1)
        {
            // The default check range is the unload range of the city
            if (range == -1)
            {
                range = City.UnloadRange;
            }

            // Return true if the list size of nearby enemy pirates within the range is grater than 0
            return(CountNearbyObjects(PirateGameEx.ConvertList <PirateEx, MapObjectEx>(GameManager.CurrentTurn.EnemyLivingPirates), range) > 0);
        }
예제 #2
0
 /// <summary>
 /// Gets my closest city to the island
 /// </summary>
 /// <returns>CityEx object</returns>
 public CityEx GetClosestCity()
 {
     return(GetClosest(PirateGameEx.ConvertList <CityEx, MapObjectEx>(GameManager.CurrentTurn.MyCities)) as CityEx);
 }