Class Confrontation

java.lang.Object
fr.uga.miage.pc.dilemme.back.Confrontation

public class Confrontation
extends java.lang.Object
This class allows to construct a object fight. This object describes all the features of a fight, the opponent, name and others. This class was created for a french university project
Since:
1.0
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static interface  Confrontation.ConfrontationConstants
    This is interface is here to define all the constants associated to the class Confrontation
  • Constructor Summary

    Constructors 
    Constructor Description
    Confrontation​(IStrategie s1, IStrategie s2)
    Constructs the fight with the two opponents given in parameter
  • Method Summary

    Modifier and Type Method Description
    int getFinalScore​(int numStrategie)
    Give the final score of the first or second strategie
    int getFinalScoreS1()
    Deprecated.
    Use getFinalScore(int numStrategie) instead
    int getFinalScoreS2()
    Deprecated.
    Use getFinalScore(int numStrategie) instead
    IStrategie getStrategie​(int numStrategie)
    Give the first or the second strategie in function of the number given in parameter
    IStrategie getStrategie1()
    Deprecated.
    Use getStrategie(int numStrategie) instead
    IStrategie getStrategie2()
    Deprecated.
    Use getStrategie(int numStrategie)
    void setStrategie​(int numStrategie, IStrategie strategie)
    Set the first or second Strategie of the confrontation
    void setStrategie1​(IStrategie strategie1)
    Deprecated.
    Use setStrategie(int numStrategie, IStrategie strategie)
    void setStrategie2​(IStrategie strategie2)
    Deprecated.
    Use setStrategie(int numStrategie, IStrategie strategie) instead
    void start​(int nbTours)
    Start the fight between the two opponents
    java.lang.String toString()
    Give a brief description of the fight

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Confrontation

      public Confrontation​(IStrategie s1, IStrategie s2)
      Constructs the fight with the two opponents given in parameter
      Parameters:
      s1 - The first opponent
      s2 - The second opponnent
      Since:
      1.0
      See Also:
      IStrategie
  • Method Details

    • getStrategie

      public IStrategie getStrategie​(int numStrategie)
      Give the first or the second strategie in function of the number given in parameter
      Parameters:
      numStrategie - The number of the Strategie to return
      Since:
      3.0
      See Also:
      Confrontation.ConfrontationConstants
    • setStrategie

      public void setStrategie​(int numStrategie, IStrategie strategie)
      Set the first or second Strategie of the confrontation
      Parameters:
      numStrategie - The number of the Strategie to return
      Since:
      3.0
      See Also:
      Confrontation.ConfrontationConstants
    • getFinalScore

      public int getFinalScore​(int numStrategie)
      Give the final score of the first or second strategie
      Parameters:
      numStrategie - The strategie that we want the final score
      Returns:
      the final of a strategie
      Since:
      3.0
      See Also:
      Confrontation.ConfrontationConstants
    • toString

      public java.lang.String toString()
      Give a brief description of the fight
      Overrides:
      toString in class java.lang.Object
      Returns:
      String The versus of this fight
      See Also:
      IStrategie.getNom()
    • start

      public void start​(int nbTours)
      Start the fight between the two opponents
      Parameters:
      nbTours - Number of round in this fight
      See Also:
      IStrategie.clear(), IStrategie.setOppPlay(String)
    • setStrategie1

      @Deprecated public void setStrategie1​(IStrategie strategie1)
      Deprecated.
      Use setStrategie(int numStrategie, IStrategie strategie)
      Change the first opponent of the fight
      Parameters:
      IStrategie - a strategie
    • setStrategie2

      @Deprecated public void setStrategie2​(IStrategie strategie2)
      Deprecated.
      Use setStrategie(int numStrategie, IStrategie strategie) instead
      Change the second opponent of the fight
      Parameters:
      IStrategie - a strategie
    • getFinalScoreS1

      @Deprecated public int getFinalScoreS1()
      Deprecated.
      Use getFinalScore(int numStrategie) instead
      Return the final score of the fight for the first Opponent
      Returns:
      int Final score for the first opponent
      Since:
      1.0
    • getFinalScoreS2

      @Deprecated public int getFinalScoreS2()
      Deprecated.
      Use getFinalScore(int numStrategie) instead
      Return the final score of the fight for the second Opponent
      Returns:
      int Final score for the second opponent
      Since:
      1.0
    • getStrategie1

      @Deprecated public IStrategie getStrategie1()
      Deprecated.
      Use getStrategie(int numStrategie) instead
      Give the object which represents the first opponent
      Returns:
      IStrategie First opponent
      See Also:
      IStrategie
    • getStrategie2

      @Deprecated public IStrategie getStrategie2()
      Deprecated.
      Use getStrategie(int numStrategie)
      Give the object which represents the first opponent
      Returns:
      IStrategie First opponent
      See Also:
      IStrategie