示例#1
0
 /// <summary>
 /// GoldFish constructor, passed to it is the property values
 /// This constructor calls the fish constructor (as a GoldFish is a fish)
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="age">Age</param>
 /// <param name="gender">Gender</param>
 /// <param name="fishFamily">As a goldfish is a fish, we need to pass fishFamily</param>
 /// <param name="numberOfFins">As a goldfish is a fish, we need to pass number of fins</param>
 /// <param name="iDoForget">This is a propewrty of goldfish</param>
 public GoldFish(string name, int age, Gender gender, FishFamily fishFamily, int numberOfFins, bool iDoForget) : base(name, age, gender, fishFamily, numberOfFins)
 {
     foodSchedule = new FoodSchedule();
     foodSchedule.Add("Krill every day.");
     IDoForget = iDoForget;
 }
示例#2
0
 /// <summary>
 /// Piraya constructor, passed to it is the property values
 /// This constructor calls the fish constructor (as a Piraya is a fish)
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="age">Age</param>
 /// <param name="gender">Gender</param>
 /// <param name="fishFamily">As an piraya is a fish, we need to pass fishFamily</param>
 /// <param name="numberOfFins">As an piraya is a fish, we need to pass number of fins</param>
 /// <param name="whyIDangerous">This is a piraya property</param>
 public Piraya(string name, int age, Gender gender, FishFamily fishFamily, int numberOfFins, string whyIDangerous) : base(name, age, gender, fishFamily, numberOfFins)
 {
     foodSchedule = new FoodSchedule();
     foodSchedule.Add("Frosen krill every day");
     WhyIDangerous = whyIDangerous;
 }
示例#3
0
 /// <summary>
 /// Animal constructor, passed to it is the property values
 /// This constructor calls the Animal constructor (as a fish is an animal)
 /// </summary>
 /// <param name="name">Name of mammal</param>
 /// <param name="age">Age of mammal</param>
 /// <param name="gender">gender of mammal</param>
 /// <param name="fishFamily">What fish family the fish belongs to</param>
 public Fish(string name, int age, Gender gender, FishFamily fishFamily, int numberOfFins) : base(name, age, gender)
 {
     FishFamily   = fishFamily;
     NumberOfFins = numberOfFins;
 }