Class Player
java.lang.Object
com.cmiurca.saintseiyadeckbuilding.saintseiya.Player
Player class, where the player is created
- Since:
- 2023-02-04
-
Constructor Summary
ConstructorsConstructorDescriptionPlayer()
Constructor of the player with no parametersConstructor of the player with only name and heroPlayer
(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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
acquireByCosmos
(PlayMat playMat, int index, ArrayList<Card> cards) Method to acquire by Cosmos a card from the PlayMatboolean
acquireByStrength
(PlayMat playMat, int index, ArrayList<Card> cards) Method to acquire by Strength a card from the PlayMatvoid
addCardToDeck
(int id) Method to add a card to the deckvoid
addCardToDeck
(Card card) Method to add a card to the deckvoid
addCardToDestroyedCards
(int id) Method to add card to the destroyed cardsvoid
addCardToDestroyedCards
(Card card) Method to add a card to the destroyed cardsvoid
addCardToDiscard
(int id) Method to add card to the discardvoid
addCardToDiscard
(Card card) Method to add a card to the discardvoid
addCardToHand
(int id) Method to add card to the handvoid
addCardToHand
(Card card) Method to add a card to the handvoid
addCardToInjuredCharacters
(int id) Method to add card to the injured charactersvoid
Method to add a card to the injured charactersvoid
Method to apply the effect of a cardboolean
canAcquireByCosmos
(PlayMat playMat) Method to verify if a card can be aquired by cosmos with all the cards in the handboolean
canAcquireByCosmos
(PlayMat playMat, int index) Method to verify if a card can be aquired by cosmos with all the cards in the handboolean
canAcquireByStrength
(PlayMat playMat) Method to verify if a card can be aquired by strength with all the cards in the handboolean
canAcquireByStrength
(PlayMat playMat, int index) Method to verify if a card can be aquired by strength with all the cards in the handboolean
Method to check if the deck is emptyboolean
Method to check if the destroyed cards is emptyboolean
Method to check if the discard is emptydrawCard()
Method to draw a card from the deckgetArmor()
Getter for armorgetDeck()
Getter for deckGetter for destroyedCardsGetter for discardgetHand()
Getter for handgetHero()
Getter for heroGetter for injuredCharactersgetName()
Getter for nameboolean
Method to check if the hand is emptyboolean
hasCardInHand
(Card card) Method to check if the player has a card in the handboolean
hasCardInHandById
(int id) Method to check if the player has a card in the hand by idvoid
healCardFromInjuredCharacters
(int index) Method to heal a card from the Injured CharactersMethod that return all the things the palyer can doboolean
Method to check if the injured characters is emptyvoid
moveCardFromDeckToDiscard
(int id) Method that move one card from the deck to the discard and removes it from the deckvoid
Method that move one card from the deck to the discard and removes it from the deckvoid
moveCardFromDeckToHand
(int id) Method that move one card from the deck to the hand and removes it from the deckvoid
moveCardFromDeckToHand
(Card card) Method that move one card from the deck to the hand and removes it from the deckvoid
Method that move one card from the deck to the injured characters and removes it from the deckvoid
Method that move one card from the deck to the injured characters and removes it from the deckvoid
moveCardFromDiscardToDeck
(int id) Method that move one card from the discard to the deck and removes it from the discardvoid
Method that move one card from the discard to the deck and removes it from the discardvoid
Method that move one card from the discard to the destroyed cards and removes it from the discardvoid
Method that move one card from the discard to the destroyed cards and removes it from the discardvoid
moveCardFromDiscardToHand
(int id) Method that move one card from the discard to the hand and removes it from the discardvoid
Method that move one card from the discard to the hand and removes it from the discardvoid
Method that move one card from the discard to the injured characters and removes it from the discardvoid
Method that move one card from the discard to the injured characters and removes it from the discardvoid
moveCardFromHandToDeck
(int id) Method that move one card from the hand to the deck and removes it from the handvoid
moveCardFromHandToDeck
(Card card) Method that move one card from the hand to the deck and removes it from the handvoid
moveCardFromHandToDestroyedCards
(int id) Method that move one card from the hand to the destroyed cards and removes it from the handvoid
Method that move one card from the hand to the destroyed cards and removes it from the handvoid
moveCardFromHandToDiscard
(int id) Method that move one card from the hand to the discard and removes it from the handvoid
Method thar move one card from the hand to the discard and removes it from the handvoid
Method that move one card from the hand to the injured characters and removes it from the handvoid
Method that move one card from the hand to the injured characters and removes it from the handvoid
Method that move one card from the injured characters to the deck and removes it from the injured charactersvoid
Method that move one card from the injured characters to the deck and removes it from the injured charactersvoid
Method that move one card from the injured characters to the discard and removes it from the injured charactersvoid
Method that move one card from the injured characters to the discard and removes it from the injured charactersint
occurenceInDeck
(Card card) Method that returns the occurence of a card in the deckint
occurenceInDestroyedCards
(int id) Method that returns the occurence of a card in the destroyed cardsint
occurenceInDiscard
(Card card) Method that returns the occurrence of a card in the discardint
occurenceInHand
(int id) Method that returns the occurence of a card in the handint
occurenceInHand
(Card card) Method that returns the occurence of a card in the handint
occurenceInInjuredCharacters
(int id) Method that returns the occurence of a card in the injured charactersint
occurrenceInDeck
(int id) Method that returns the occurrence of a card in the deckint
Method that returns the occurrence of a card in the destroyed cardsint
occurrenceInDiscard
(int id) Method that returns the occurrence of a card in the discardint
Method that returns the occurrence of a card in the injured characterspositionsInDeck
(int id) Method that returns all the positions of a card in the deckpositionsInDeck
(Card card) Method that returns all the positions of a card in the deckpositionsInDestroyedCards
(int id) Method that returns all the positions of a card in the destroyed cardsMethod that returns all the positions of a card in the destroyed cardspositionsInDiscard
(int id) Method that returns all the positions of a card in the discardpositionsInDiscard
(Card card) Method that returns all the positions of a card in the discardpositionsInHand
(int id) Method that returns all the positions of a card in the handpositionsInHand
(Card card) Method that returns all the positions of a card in the handpositionsInInjuredCharacters
(int id) Method that returns all the positions of a card in the injured charactersMethod that returns all the positions of a card in the injured charactersvoid
removeCardFromDeck
(int id) Method to remove a card from the deckvoid
removeCardFromDeck
(Card card) Method to remove a card from the deckvoid
removeCardFromDestroyedCards
(int id) Method to remove a card from the destroyed cardsvoid
Method to remove a card from the destroyed cardsvoid
removeCardFromDiscard
(int id) Method to remove a card from the discardvoid
removeCardFromDiscard
(Card card) Method to remove a card from the discardvoid
removeCardFromHand
(int id) Method to remove a card from the handvoid
removeCardFromHand
(Card card) Method to remove a card from the handvoid
removeCardFromInjuredCharacters
(int id) Method to remove a card from the injured charactersvoid
Method to remove a card from the injured charactersvoid
Setter for armorvoid
Setter for deckvoid
setDestroyedCards
(ArrayList<Card> destroyedCards) Setter for destroyedCardsvoid
setDiscard
(ArrayList<Card> discard) Setter for discardvoid
Setter for handvoid
Setter for herovoid
setInjuredCharacters
(ArrayList<Card> injuredCharacters) Setter for injuredCharactersvoid
Setter for nameshowDeck()
Method to show the cards in the deckMethod to show the cards in the discardshowHand()
Method to show the cards in the handMethod to show the cards in the injured characterstoString()
Method toString to show the player
-
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 playerhero
- hero of the playerdeck
- deck of the playerhand
- hand of the playerdiscard
- discard of the playerdestroyedCards
- destroyed cards of the playerarmor
- armor of the playerinjuredCharacters
- injured characters of the player
-
Player
Constructor of the player with only name and hero- Parameters:
name
- name of the playerhero
- hero of the player
-
Player
public Player()Constructor of the player with no parameters
-
-
Method Details
-
help
Method that return all the things the palyer can do- Returns:
- String with all the things the player can do
-
canAcquireByStrength
Method to verify if a card can be aquired by strength with all the cards in the hand- Parameters:
playMat
- the playmatindex
- index of the card to be acquired- Returns:
- true if the card can be acquired by strength, false otherwise
-
canAcquireByStrength
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
Method to verify if a card can be aquired by cosmos with all the cards in the hand- Parameters:
playMat
- the playmatindex
- index of the card to be acquired- Returns:
- true if the card can be acquired by cosmos, false otherwise
-
canAcquireByCosmos
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
Method to acquire by Strength a card from the PlayMat- Parameters:
index
- index of the card to be acquired
-
acquireByCosmos
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
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
Getter for name- Returns:
- String name
-
setName
Setter for name- Parameters:
name
- name of the player
-
getHero
Getter for hero- Returns:
- Hero hero
-
setHero
Setter for hero- Parameters:
hero
- hero of the player
-
getDeck
Getter for deck- Returns:
- ArrayList
deck
-
setDeck
Setter for deck- Parameters:
deck
- deck of the player
-
getHand
Getter for hand- Returns:
- ArrayList
hand
-
setHand
Setter for hand- Parameters:
hand
- hand of the player
-
getDiscard
Getter for discard- Returns:
- ArrayList
discard
-
setDiscard
Setter for discard- Parameters:
discard
- discard of the player
-
getDestroyedCards
Getter for destroyedCards- Returns:
- ArrayList
destroyedCards
-
setDestroyedCards
Setter for destroyedCards- Parameters:
destroyedCards
- destroyed cards of the player
-
getArmor
Getter for armor- Returns:
- Card armor
-
setArmor
Setter for armor- Parameters:
armor
- armor of the player
-
getInjuredCharacters
Getter for injuredCharacters- Returns:
- ArrayList
injuredCharacters
-
setInjuredCharacters
Setter for injuredCharacters- Parameters:
injuredCharacters
- injured characters of the player
-
drawCard
Method to draw a card from the deck- Returns:
- Card card
-
addCardToHand
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Method that returns all the positions of a card in the hand- Parameters:
card
- card to be searched for- Returns:
- ArrayList
positions
-
positionsInHand
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
Method that returns all the positions of a card in the discard- Parameters:
card
- card to be searched for- Returns:
- ArrayList
positions
-
positionsInDiscard
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
Method that returns all the positions of a card in the destroyed cards- Parameters:
card
- card to be searched for- Returns:
- ArrayList
positions
-
positionsInDestroyedCards
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
Method that returns all the positions of a card in the injured characters- Parameters:
card
- card to be searched for- Returns:
- ArrayList
positions
-
positionsInInjuredCharacters
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
Method that returns all the positions of a card in the deck- Parameters:
card
- card to be searched for- Returns:
- ArrayList
positions
-
positionsInDeck
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
Method thar move one card from the hand to the discard and removes it from the hand- Parameters:
card
- card to be moved
-
moveCardFromDiscardToDestroyedCards
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
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
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
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
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
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
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
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
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
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
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
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
Method to show the cards in the hand- Returns:
- String with the cards in the hand
-
showDeck
Method to show the cards in the deck- Returns:
- String with the cards in the deck
-
toString
Method toString to show the player -
showDiscard
Method to show the cards in the discard- Returns:
- String with the cards in the discard
-
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
-