java.lang.Object
com.cmiurca.saintseiyadeckbuilding.saintseiya.Player

public class Player extends Object
Player class, where the player is created
Since:
2023-02-04
  • Constructor Details

    • Player

      public Player(String name, Hero hero, ArrayList<Card> deck, ArrayList<Card> hand, ArrayList<Card> discard, ArrayList<Card> destroyedCards, Card armor, ArrayList<Card> injuredCharacters)
      Constructor of the player
      Parameters:
      name - name of the player
      hero - hero of the player
      deck - deck of the player
      hand - hand of the player
      discard - discard of the player
      destroyedCards - destroyed cards of the player
      armor - armor of the player
      injuredCharacters - injured characters of the player
    • Player

      public Player(String name, Hero hero)
      Constructor of the player with only name and hero
      Parameters:
      name - name of the player
      hero - hero of the player
    • Player

      public Player()
      Constructor of the player with no parameters
  • Method Details

    • help

      public String help(PlayMat playMat)
      Method that return all the things the palyer can do
      Returns:
      String with all the things the player can do
    • canAcquireByStrength

      public boolean canAcquireByStrength(PlayMat playMat, int index)
      Method to verify if a card can be aquired by strength with all the cards in the hand
      Parameters:
      playMat - the playmat
      index - index of the card to be acquired
      Returns:
      true if the card can be acquired by strength, false otherwise
    • canAcquireByStrength

      public boolean canAcquireByStrength(PlayMat playMat)
      Method to verify if a card can be aquired by strength with all the cards in the hand
      Parameters:
      playMat - the playmat
      Returns:
      true if the card can be acquired by strength, false otherwise
    • canAcquireByCosmos

      public boolean canAcquireByCosmos(PlayMat playMat, int index)
      Method to verify if a card can be aquired by cosmos with all the cards in the hand
      Parameters:
      playMat - the playmat
      index - index of the card to be acquired
      Returns:
      true if the card can be acquired by cosmos, false otherwise
    • canAcquireByCosmos

      public boolean canAcquireByCosmos(PlayMat playMat)
      Method to verify if a card can be aquired by cosmos with all the cards in the hand
      Parameters:
      playMat - the playmat
      Returns:
      true if the card can be acquired by cosmos, false otherwise
    • acquireByStrength

      public boolean acquireByStrength(PlayMat playMat, int index, ArrayList<Card> cards)
      Method to acquire by Strength a card from the PlayMat
      Parameters:
      index - index of the card to be acquired
    • acquireByCosmos

      public void acquireByCosmos(PlayMat playMat, int index, ArrayList<Card> cards)
      Method to acquire by Cosmos a card from the PlayMat
      Parameters:
      index - index of the card to be acquired
    • healCardFromInjuredCharacters

      public void healCardFromInjuredCharacters(int index)
      Method to heal a card from the Injured Characters
      Parameters:
      index - index of the card to be healed
    • applyEffect

      public void applyEffect(Card card, ArrayList<Card> cards, PlayMat playMat, ArrayList<Player> players)
      Method to apply the effect of a card
      Parameters:
      card - card to be applied
    • hasCardInHand

      public boolean hasCardInHand(Card card)
      Method to check if the player has a card in the hand
      Parameters:
      card - card to be checked
    • hasCardInHandById

      public boolean hasCardInHandById(int id)
      Method to check if the player has a card in the hand by id
      Parameters:
      id - of card to be checked
    • getName

      public String getName()
      Getter for name
      Returns:
      String name
    • setName

      public void setName(String name)
      Setter for name
      Parameters:
      name - name of the player
    • getHero

      public Hero getHero()
      Getter for hero
      Returns:
      Hero hero
    • setHero

      public void setHero(Hero hero)
      Setter for hero
      Parameters:
      hero - hero of the player
    • getDeck

      public ArrayList<Card> getDeck()
      Getter for deck
      Returns:
      ArrayList deck
    • setDeck

      public void setDeck(ArrayList<Card> deck)
      Setter for deck
      Parameters:
      deck - deck of the player
    • getHand

      public ArrayList<Card> getHand()
      Getter for hand
      Returns:
      ArrayList hand
    • setHand

      public void setHand(ArrayList<Card> hand)
      Setter for hand
      Parameters:
      hand - hand of the player
    • getDiscard

      public ArrayList<Card> getDiscard()
      Getter for discard
      Returns:
      ArrayList discard
    • setDiscard

      public void setDiscard(ArrayList<Card> discard)
      Setter for discard
      Parameters:
      discard - discard of the player
    • getDestroyedCards

      public ArrayList<Card> getDestroyedCards()
      Getter for destroyedCards
      Returns:
      ArrayList destroyedCards
    • setDestroyedCards

      public void setDestroyedCards(ArrayList<Card> destroyedCards)
      Setter for destroyedCards
      Parameters:
      destroyedCards - destroyed cards of the player
    • getArmor

      public Card getArmor()
      Getter for armor
      Returns:
      Card armor
    • setArmor

      public void setArmor(Card armor)
      Setter for armor
      Parameters:
      armor - armor of the player
    • getInjuredCharacters

      public ArrayList<Card> getInjuredCharacters()
      Getter for injuredCharacters
      Returns:
      ArrayList injuredCharacters
    • setInjuredCharacters

      public void setInjuredCharacters(ArrayList<Card> injuredCharacters)
      Setter for injuredCharacters
      Parameters:
      injuredCharacters - injured characters of the player
    • drawCard

      public Card drawCard()
      Method to draw a card from the deck
      Returns:
      Card card
    • addCardToHand

      public void addCardToHand(Card card)
      Method to add a card to the hand
      Parameters:
      card - card to be added to the hand
    • addCardToHand

      public void addCardToHand(int id)
      Method to add card to the hand
      Parameters:
      id - of the card to be added to the hand
    • addCardToDiscard

      public void addCardToDiscard(Card card)
      Method to add a card to the discard
      Parameters:
      card - card to be added to the discard
    • addCardToDiscard

      public void addCardToDiscard(int id)
      Method to add card to the discard
      Parameters:
      id - of the card to be added to the discard
    • addCardToDestroyedCards

      public void addCardToDestroyedCards(Card card)
      Method to add a card to the destroyed cards
      Parameters:
      card - card to be added to the destroyed cards
    • addCardToDestroyedCards

      public void addCardToDestroyedCards(int id)
      Method to add card to the destroyed cards
      Parameters:
      id - of the card to be added to the destroyed cards
    • addCardToInjuredCharacters

      public void addCardToInjuredCharacters(Card card)
      Method to add a card to the injured characters
      Parameters:
      card - card to be added to the injured characters
    • addCardToInjuredCharacters

      public void addCardToInjuredCharacters(int id)
      Method to add card to the injured characters
      Parameters:
      id - of the card to be added to the injured characters
    • removeCardFromHand

      public void removeCardFromHand(Card card)
      Method to remove a card from the hand
      Parameters:
      card - card to be removed from the hand
    • removeCardFromHand

      public void removeCardFromHand(int id)
      Method to remove a card from the hand
      Parameters:
      id - of the card to be removed from the hand
    • removeCardFromDiscard

      public void removeCardFromDiscard(Card card)
      Method to remove a card from the discard
      Parameters:
      card - card to be removed from the discard
    • removeCardFromDiscard

      public void removeCardFromDiscard(int id)
      Method to remove a card from the discard
      Parameters:
      id - id of the card to be removed from the discard
    • removeCardFromDestroyedCards

      public void removeCardFromDestroyedCards(Card card)
      Method to remove a card from the destroyed cards
      Parameters:
      card - card to be removed from the destroyed cards
    • removeCardFromDestroyedCards

      public void removeCardFromDestroyedCards(int id)
      Method to remove a card from the destroyed cards
      Parameters:
      id - of the card to be removed from the destroyed cards
    • removeCardFromInjuredCharacters

      public void removeCardFromInjuredCharacters(Card card)
      Method to remove a card from the injured characters
      Parameters:
      card - card to be removed from the injured characters
    • removeCardFromInjuredCharacters

      public void removeCardFromInjuredCharacters(int id)
      Method to remove a card from the injured characters
      Parameters:
      id - of the card to be removed from the injured characters
    • removeCardFromDeck

      public void removeCardFromDeck(Card card)
      Method to remove a card from the deck
      Parameters:
      card - card to be removed from the deck
    • removeCardFromDeck

      public void removeCardFromDeck(int id)
      Method to remove a card from the deck
      Parameters:
      id - of the card to be removed from the deck
    • addCardToDeck

      public void addCardToDeck(Card card)
      Method to add a card to the deck
      Parameters:
      card - card to be added to the deck
    • addCardToDeck

      public void addCardToDeck(int id)
      Method to add a card to the deck
      Parameters:
      id - of the card to be added to the deck
    • occurenceInHand

      public int occurenceInHand(Card card)
      Method that returns the occurence of a card in the hand
      Parameters:
      card - card to be searched for
      Returns:
      int occurence
    • occurenceInHand

      public int occurenceInHand(int id)
      Method that returns the occurence of a card in the hand
      Parameters:
      id - of the card to be searched for
      Returns:
      int occurence
    • occurenceInDiscard

      public int occurenceInDiscard(Card card)
      Method that returns the occurrence of a card in the discard
      Parameters:
      card - card to be searched for
      Returns:
      int occurrence
    • occurrenceInDiscard

      public int occurrenceInDiscard(int id)
      Method that returns the occurrence of a card in the discard
      Parameters:
      id - of the card to be searched for
      Returns:
      int occurrence
    • occurrenceInDestroyedCards

      public int occurrenceInDestroyedCards(Card card)
      Method that returns the occurrence of a card in the destroyed cards
      Parameters:
      card - card to be searched for
      Returns:
      int occurrence
    • occurenceInDestroyedCards

      public int occurenceInDestroyedCards(int id)
      Method that returns the occurence of a card in the destroyed cards
      Parameters:
      id - id of the card to be searched for
      Returns:
      int occurence
    • occurrenceInInjuredCharacters

      public int occurrenceInInjuredCharacters(Card card)
      Method that returns the occurrence of a card in the injured characters
      Parameters:
      card - card to be searched for
      Returns:
      int occurrence
    • occurenceInInjuredCharacters

      public int occurenceInInjuredCharacters(int id)
      Method that returns the occurence of a card in the injured characters
      Parameters:
      id - of the card to be searched for
      Returns:
      int occurence
    • occurenceInDeck

      public int occurenceInDeck(Card card)
      Method that returns the occurence of a card in the deck
      Parameters:
      card - card to be searched for
      Returns:
      int occurence
    • occurrenceInDeck

      public int occurrenceInDeck(int id)
      Method that returns the occurrence of a card in the deck
      Parameters:
      id - of the card to be searched for
      Returns:
      int occurrence
    • positionsInHand

      public ArrayList<Integer> positionsInHand(Card card)
      Method that returns all the positions of a card in the hand
      Parameters:
      card - card to be searched for
      Returns:
      ArrayList positions
    • positionsInHand

      public ArrayList<Integer> positionsInHand(int id)
      Method that returns all the positions of a card in the hand
      Parameters:
      id - id of the card to be searched for
      Returns:
      ArrayList positions
    • positionsInDiscard

      public ArrayList<Integer> positionsInDiscard(Card card)
      Method that returns all the positions of a card in the discard
      Parameters:
      card - card to be searched for
      Returns:
      ArrayList positions
    • positionsInDiscard

      public ArrayList<Integer> positionsInDiscard(int id)
      Method that returns all the positions of a card in the discard
      Parameters:
      id - of the card to be searched for
      Returns:
      ArrayList positions
    • positionsInDestroyedCards

      public ArrayList<Integer> positionsInDestroyedCards(Card card)
      Method that returns all the positions of a card in the destroyed cards
      Parameters:
      card - card to be searched for
      Returns:
      ArrayList positions
    • positionsInDestroyedCards

      public ArrayList<Integer> positionsInDestroyedCards(int id)
      Method that returns all the positions of a card in the destroyed cards
      Parameters:
      id - of the card to be searched for
      Returns:
      ArrayList positions
    • positionsInInjuredCharacters

      public ArrayList<Integer> positionsInInjuredCharacters(Card card)
      Method that returns all the positions of a card in the injured characters
      Parameters:
      card - card to be searched for
      Returns:
      ArrayList positions
    • positionsInInjuredCharacters

      public ArrayList<Integer> positionsInInjuredCharacters(int id)
      Method that returns all the positions of a card in the injured characters
      Parameters:
      id - id of the card to be searched for
      Returns:
      ArrayList positions
    • positionsInDeck

      public ArrayList<Integer> positionsInDeck(Card card)
      Method that returns all the positions of a card in the deck
      Parameters:
      card - card to be searched for
      Returns:
      ArrayList positions
    • positionsInDeck

      public ArrayList<Integer> positionsInDeck(int id)
      Method that returns all the positions of a card in the deck
      Parameters:
      id - id of the card to be searched for
      Returns:
      ArrayList positions
    • moveCardFromHandToDiscard

      public void moveCardFromHandToDiscard(Card card)
      Method thar move one card from the hand to the discard and removes it from the hand
      Parameters:
      card - card to be moved
    • moveCardFromDiscardToDestroyedCards

      public void moveCardFromDiscardToDestroyedCards(Card card)
      Method that move one card from the discard to the destroyed cards and removes it from the discard
      Parameters:
      card - card to be moved
    • moveCardFromDiscardToDestroyedCards

      public void moveCardFromDiscardToDestroyedCards(int id)
      Method that move one card from the discard to the destroyed cards and removes it from the discard
      Parameters:
      id - id of the card to be moved
    • moveCardFromHandToDiscard

      public void moveCardFromHandToDiscard(int id)
      Method that move one card from the hand to the discard and removes it from the hand
      Parameters:
      id - id of the card to be moved
    • moveCardFromHandToInjuredCharacters

      public void moveCardFromHandToInjuredCharacters(Card card)
      Method that move one card from the hand to the injured characters and removes it from the hand
      Parameters:
      card - card to be moved
    • moveCardFromHandToInjuredCharacters

      public void moveCardFromHandToInjuredCharacters(int id)
      Method that move one card from the hand to the injured characters and removes it from the hand
      Parameters:
      id - id of the card to be moved
    • moveCardFromHandToDestroyedCards

      public void moveCardFromHandToDestroyedCards(Card card)
      Method that move one card from the hand to the destroyed cards and removes it from the hand
      Parameters:
      card - card to be moved
    • moveCardFromHandToDestroyedCards

      public void moveCardFromHandToDestroyedCards(int id)
      Method that move one card from the hand to the destroyed cards and removes it from the hand
      Parameters:
      id - id of the card to be moved
    • moveCardFromDiscardToHand

      public void moveCardFromDiscardToHand(Card card)
      Method that move one card from the discard to the hand and removes it from the discard
      Parameters:
      card - card to be moved
    • moveCardFromDiscardToHand

      public void moveCardFromDiscardToHand(int id)
      Method that move one card from the discard to the hand and removes it from the discard
      Parameters:
      id - id of the card to be moved
    • moveCardFromHandToDeck

      public void moveCardFromHandToDeck(Card card)
      Method that move one card from the hand to the deck and removes it from the hand
      Parameters:
      card - card to be moved
    • moveCardFromHandToDeck

      public void moveCardFromHandToDeck(int id)
      Method that move one card from the hand to the deck and removes it from the hand
      Parameters:
      id - id of the card to be moved
    • moveCardFromDeckToHand

      public void moveCardFromDeckToHand(Card card)
      Method that move one card from the deck to the hand and removes it from the deck
      Parameters:
      card - card to be moved
    • moveCardFromDeckToHand

      public void moveCardFromDeckToHand(int id)
      Method that move one card from the deck to the hand and removes it from the deck
      Parameters:
      id - id of the card to be moved
    • moveCardFromDeckToDiscard

      public void moveCardFromDeckToDiscard(Card card)
      Method that move one card from the deck to the discard and removes it from the deck
      Parameters:
      card - card to be moved
    • moveCardFromDeckToDiscard

      public void moveCardFromDeckToDiscard(int id)
      Method that move one card from the deck to the discard and removes it from the deck
      Parameters:
      id - id of the card to be moved
    • moveCardFromDiscardToDeck

      public void moveCardFromDiscardToDeck(Card card)
      Method that move one card from the discard to the deck and removes it from the discard
      Parameters:
      card - card to be moved
    • moveCardFromDiscardToDeck

      public void moveCardFromDiscardToDeck(int id)
      Method that move one card from the discard to the deck and removes it from the discard
      Parameters:
      id - id of the card to be moved
    • moveCardFromDeckToInjuredCharacters

      public void moveCardFromDeckToInjuredCharacters(Card card)
      Method that move one card from the deck to the injured characters and removes it from the deck
      Parameters:
      card - card to be moved
    • moveCardFromDeckToInjuredCharacters

      public void moveCardFromDeckToInjuredCharacters(int id)
      Method that move one card from the deck to the injured characters and removes it from the deck
      Parameters:
      id - id of the card to be moved
    • moveCardFromInjuredCharactersToDeck

      public void moveCardFromInjuredCharactersToDeck(Card card)
      Method that move one card from the injured characters to the deck and removes it from the injured characters
      Parameters:
      card - card to be moved
    • moveCardFromInjuredCharactersToDeck

      public void moveCardFromInjuredCharactersToDeck(int id)
      Method that move one card from the injured characters to the deck and removes it from the injured characters
      Parameters:
      id - id of the card to be moved
    • moveCardFromInjuredCharactersToDiscard

      public void moveCardFromInjuredCharactersToDiscard(Card card)
      Method that move one card from the injured characters to the discard and removes it from the injured characters
      Parameters:
      card - card to be moved
    • moveCardFromInjuredCharactersToDiscard

      public void moveCardFromInjuredCharactersToDiscard(int id)
      Method that move one card from the injured characters to the discard and removes it from the injured characters
      Parameters:
      id - id of the card to be moved
    • moveCardFromDiscardToInjuredCharacters

      public void moveCardFromDiscardToInjuredCharacters(Card card)
      Method that move one card from the discard to the injured characters and removes it from the discard
      Parameters:
      card - card to be moved
    • moveCardFromDiscardToInjuredCharacters

      public void moveCardFromDiscardToInjuredCharacters(int id)
      Method that move one card from the discard to the injured characters and removes it from the discard
      Parameters:
      id - id of the card to be moved
    • showHand

      public String showHand()
      Method to show the cards in the hand
      Returns:
      String with the cards in the hand
    • showDeck

      public String showDeck()
      Method to show the cards in the deck
      Returns:
      String with the cards in the deck
    • toString

      public String toString()
      Method toString to show the player
      Overrides:
      toString in class Object
      Returns:
      String with the player
    • showDiscard

      public String showDiscard()
      Method to show the cards in the discard
      Returns:
      String with the cards in the discard
    • showInjuredCharacters

      public String showInjuredCharacters()
      Method to show the cards in the injured characters
      Returns:
      String with the cards in the injured characters
    • handIsEmpty

      public boolean handIsEmpty()
      Method to check if the hand is empty
      Returns:
      true if the hand is empty, false if not
    • deckIsEmpty

      public boolean deckIsEmpty()
      Method to check if the deck is empty
      Returns:
      true if the deck is empty, false if not
    • discardIsEmpty

      public boolean discardIsEmpty()
      Method to check if the discard is empty
      Returns:
      true if the discard is empty, false if not
    • injuredCharactersIsEmpty

      public boolean injuredCharactersIsEmpty()
      Method to check if the injured characters is empty
      Returns:
      true if the injured characters is empty, false if not
    • destroyedCardsIsEmpty

      public boolean destroyedCardsIsEmpty()
      Method to check if the destroyed cards is empty
      Returns:
      true if the destroyed cards is empty, false if not