Class TourInsecte

java.lang.Object
fr.formiko.formiko.interfaces.TourInsecte
All Implemented Interfaces:
Tour, Serializable

public class TourInsecte extends Object implements Serializable, Tour
Insect implementation.
Allow an insect to play a turn.
All insects can extends this class to modify runAway(), eat() or reproduce()
Author:
Hydrolien
See Also:
  • Field Details

  • Constructor Details

    • TourInsecte

      public TourInsecte()
  • Method Details

    • unTour

      public void unTour(Creature c)
      PLay 1 turn with Creature c.
      Specified by:
      unTour in interface Tour
      Parameters:
      c - The Creature that need to play a turn.
    • tour

      public void tour()
      Play a turn as an Insecte.
      Turn work like this :
      • Eat if the creature is starving.
      • Run away from predator.
      • Eat if the creature is hungry.
      • Try to fined an other creature to reproduce.
      • Eat if the creature is not full.
      • End turn.
    • endTurn

      public void endTurn(Creature cTemp)
      End a turn as an Insecte.
      Specified by:
      endTurn in interface Tour
      Parameters:
      cTemp - The Creature that need to end a turn.
    • reproduce

      private void reproduce()
      reproduce.