/// <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); }
/// <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); }
/// <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); }
public void SpawnRandomFishingZone(FishingZone despawnedZone) { foreach (FishingZone zone in this.fishingZones) { if (!despawnedZone.Equals(zone) && !zone.IsActive()) { zone.Spawn(); break; } } }