Beispiel #1
0
        /// <summary>
        /// Checks if character is in any fishing zone
        /// </summary>
        /// <param name="character">Character</param>
        /// <returns>True if character is in some fishing zone, otherwise false</returns>
        private bool IsCharacterInAnyFishingZone(Character character)
        {
            FishingZone zone = fishingZones.SingleOrDefault(x => x.IsCharacterInZoneWithCorrectRotation(character));

            if (zone == null)
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Stops fishing for character
        /// </summary>
        /// <param name="character">Character</param>
        public void StopFishing(Character character)
        {
            FishingZone zone = GetFishingZoneWhereCharacterIsIn(character);

            if (zone == null)
            {
                return;
            }
            zone.StopFishing(character);
        }
Beispiel #3
0
        /// <summary>
        /// Attemps to catch a fish from some fishing spot
        /// </summary>
        /// <param name="character">Character</param>
        public bool StartFishing(Character character)
        {
            FishingZone zone = GetFishingZoneWhereCharacterIsIn(character);

            if (zone == null)
            {
                return(false);
            }
            zone.StartFishing(character);
            return(true);
        }
Beispiel #4
0
 public void SpawnRandomFishingZone(FishingZone despawnedZone)
 {
     foreach (FishingZone zone in this.fishingZones)
     {
         if (!despawnedZone.Equals(zone) && !zone.IsActive())
         {
             zone.Spawn();
             break;
         }
     }
 }