コード例 #1
0
        private static void AddFish(FishRegister myFishRegister, string fisher, Fish fish, Location location)
        {
            Fisherman fisherMan = myFishRegister.Fishers.Find(x => x.Name == fisher);

            if (fisherMan != null)
            {
                myFishRegister.FishingEventList.Add(new FishingEvent(fisherMan, fish, location));
            }
            else
            {
                Console.WriteLine("Fisher can't be found. Typo in the name?");
            }
            Console.WriteLine($"{fisherMan.Name} got a new fish!");
            Console.WriteLine(fish.ToString());
            Console.WriteLine(location.ToString() + "\n");
        }
コード例 #2
0
 public FishingEvent(Fisherman fisherman, Fish fish, Location location)
 {
     Fisher   = fisherman;
     Fish     = fish;
     Location = location;
 }
コード例 #3
0
 private static void AddFisher(FishRegister myFishRegister, Fisherman fisher)
 {
     myFishRegister.Fishers.Add(fisher);
     Console.WriteLine($"Fisher {fisher.Name} added into the Fishregister.\n");
 }