Class UndiscoveredEggGroup

All Implemented Interfaces:
EggGroup, ITranslatable

public class UndiscoveredEggGroup extends BasicEggGroup
An extension of the BasicEggGroup that rejects all other egg groups as a partner
Since:
24/06/2022
  • Constructor Details

    • UndiscoveredEggGroup

      public UndiscoveredEggGroup(int index, String name)
      Basic constructor taking the index and the name
      Parameters:
      index - The index of the egg group
      name - The name of the egg group
    • UndiscoveredEggGroup

      public UndiscoveredEggGroup()
  • Method Details

    • canBreed

      public boolean canBreed(Gender first, Gender second)
      Description copied from interface: EggGroup
      Checks if the two Gender
      Specified by:
      canBreed in interface EggGroup
      Overrides:
      canBreed in class AbstractEggGroup
      Parameters:
      first - The first gender
      second - The second gender
      Returns:
      True if they can breed
    • canBreedWith

      public boolean canBreedWith(List<EggGroup> others)
      Description copied from interface: EggGroup
      Checks if this egg group can breed with any of the given other egg groups Will return true if a single one works
      Specified by:
      canBreedWith in interface EggGroup
      Overrides:
      canBreedWith in class AbstractEggGroup
      Parameters:
      others - The egg groups being checked
      Returns:
      True if it works
    • canBreedWith

      public boolean canBreedWith(EggGroup... others)
      Description copied from interface: EggGroup
      Checks if this egg group can breed with any of the given other egg groups Will return true if a single one works
      Specified by:
      canBreedWith in interface EggGroup
      Overrides:
      canBreedWith in class AbstractEggGroup
      Parameters:
      others - The egg groups being checked
      Returns:
      True if it works
    • canBreedWith

      public boolean canBreedWith(EggGroup other)
      Description copied from interface: EggGroup
      Checks if the other egg group can breed with this egg group Make sure it is consistent in both directions (i.e. if it returns true in this one, it should return true in the other one)
      Specified by:
      canBreedWith in interface EggGroup
      Overrides:
      canBreedWith in class BasicEggGroup
      Parameters:
      other - The other egg group to check
      Returns:
      True if they can breed together, false if not