Class SkyjoModelImpl
java.lang.Object
ca.uqam.info.student.skyjo.model.SkyjoModelImpl
- All Implemented Interfaces:
ca.uqam.info.max.skyjo.model.SkyjoModel,ca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
Implementation of the SkyjoModel interface.
-
Constructor Summary
ConstructorsConstructorDescriptionSkyjoModelImpl(String[] players, Random random, ca.uqam.info.max.skyjo.controller.ModelPreset preset) Constructs a dynamic Skyjo model. -
Method Summary
Modifier and TypeMethodDescriptionvoidca.uqam.info.max.skyjo.model.Card[]eliminateColumn(int playerIndex, int colIndex) ca.uqam.info.max.skyjo.model.Card[]eliminateRow(int playerIndex, int rowIndex) int[]endGame()intintintca.uqam.info.max.skyjo.model.Cardca.uqam.info.max.skyjo.model.CardgetCardForPlayerByPosition(int playerIndex, int cardPositionX, int cardPositionY) intgetCurrentDimensionsX(int playerIndex) intgetCurrentDimensionsY(int currentPlayerIndex) intintintintgetPlayerName(int playerIndex) int[]intgetRound()booleanisAllPlayerCardsRevealed(int playerIndex) booleanbooleanbooleanThis methode iterates through all players and verifies if at least one player has revealed all of their cards.booleanisPlayerCardAtPositionRevealed(int playerIndex, int cardPositionX, int cardPositionY) ca.uqam.info.max.skyjo.model.Cardca.uqam.info.max.skyjo.model.Cardca.uqam.info.max.skyjo.model.CardpopDeck()ca.uqam.info.max.skyjo.model.CardvoidpushDiscardPile(ca.uqam.info.max.skyjo.model.Card card) ca.uqam.info.max.skyjo.model.CardreplacePlayerCard(int playerIndex, int x, int y, ca.uqam.info.max.skyjo.model.Card card) voidrestoreColumn(int playerIndex, int colIndex, ca.uqam.info.max.skyjo.model.Card[] colCards) voidrestoreRow(int playerIndex, int rowIndex, ca.uqam.info.max.skyjo.model.Card[] rowCards) voidrevealPlayerCard(int playerIndex, int x, int y) voidsetBufferCard(ca.uqam.info.max.skyjo.model.Card card) void
-
Constructor Details
-
SkyjoModelImpl
-
-
Method Details
-
getAmountDeckCards
public int getAmountDeckCards()- Specified by:
getAmountDeckCardsin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isBufferCardPresent
public boolean isBufferCardPresent()- Specified by:
isBufferCardPresentin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getBufferCard
public ca.uqam.info.max.skyjo.model.Card getBufferCard()- Specified by:
getBufferCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
setBufferCard
public void setBufferCard(ca.uqam.info.max.skyjo.model.Card card) - Specified by:
setBufferCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
getAmountPlayers
public int getAmountPlayers()- Specified by:
getAmountPlayersin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getCurrentPlayerIndex
public int getCurrentPlayerIndex()- Specified by:
getCurrentPlayerIndexin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getInitialDimensionsX
public int getInitialDimensionsX()- Specified by:
getInitialDimensionsXin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getInitialDimensionsY
public int getInitialDimensionsY()- Specified by:
getInitialDimensionsYin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getCurrentDimensionsX
public int getCurrentDimensionsX(int playerIndex) - Specified by:
getCurrentDimensionsXin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getCurrentDimensionsY
public int getCurrentDimensionsY(int currentPlayerIndex) - Specified by:
getCurrentDimensionsYin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getRound
public int getRound()- Specified by:
getRoundin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isGameOverInitialized
public boolean isGameOverInitialized()This methode iterates through all players and verifies if at least one player has revealed all of their cards.- Specified by:
isGameOverInitializedin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly- Returns:
- true if such a player exists, false otherwise.
-
peekDiscardPile
public ca.uqam.info.max.skyjo.model.Card peekDiscardPile()- Specified by:
peekDiscardPilein interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getAmountDiscardPileCards
public int getAmountDiscardPileCards()- Specified by:
getAmountDiscardPileCardsin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isGameOver
public boolean isGameOver()- Specified by:
isGameOverin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getGameEnder
public int getGameEnder()- Specified by:
getGameEnderin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getPlayerName
- Specified by:
getPlayerNamein interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isPlayerCardAtPositionRevealed
public boolean isPlayerCardAtPositionRevealed(int playerIndex, int cardPositionX, int cardPositionY) - Specified by:
isPlayerCardAtPositionRevealedin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isAllPlayerCardsRevealed
public boolean isAllPlayerCardsRevealed(int playerIndex) - Specified by:
isAllPlayerCardsRevealedin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getCardForPlayerByPosition
public ca.uqam.info.max.skyjo.model.Card getCardForPlayerByPosition(int playerIndex, int cardPositionX, int cardPositionY) - Specified by:
getCardForPlayerByPositionin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getPlayerScores
public int[] getPlayerScores()- Specified by:
getPlayerScoresin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
revealPlayerCard
public void revealPlayerCard(int playerIndex, int x, int y) - Specified by:
revealPlayerCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
eliminateRow
public ca.uqam.info.max.skyjo.model.Card[] eliminateRow(int playerIndex, int rowIndex) - Specified by:
eliminateRowin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
eliminateColumn
public ca.uqam.info.max.skyjo.model.Card[] eliminateColumn(int playerIndex, int colIndex) - Specified by:
eliminateColumnin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
restoreColumn
public void restoreColumn(int playerIndex, int colIndex, ca.uqam.info.max.skyjo.model.Card[] colCards) - Specified by:
restoreColumnin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
restoreRow
public void restoreRow(int playerIndex, int rowIndex, ca.uqam.info.max.skyjo.model.Card[] rowCards) - Specified by:
restoreRowin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
replacePlayerCard
public ca.uqam.info.max.skyjo.model.Card replacePlayerCard(int playerIndex, int x, int y, ca.uqam.info.max.skyjo.model.Card card) - Specified by:
replacePlayerCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
popDeck
public ca.uqam.info.max.skyjo.model.Card popDeck()- Specified by:
popDeckin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
popDiscardPile
public ca.uqam.info.max.skyjo.model.Card popDiscardPile()- Specified by:
popDiscardPilein interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
pushDiscardPile
public void pushDiscardPile(ca.uqam.info.max.skyjo.model.Card card) - Specified by:
pushDiscardPilein interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
popBufferCard
public ca.uqam.info.max.skyjo.model.Card popBufferCard()- Specified by:
popBufferCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
advancePlayer
public void advancePlayer()- Specified by:
advancePlayerin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
setGameEnder
public void setGameEnder()- Specified by:
setGameEnderin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
endGame
public int[] endGame()- Specified by:
endGamein interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-