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
Implémentation concrète de l'interface
SkyjoModel.
Gère l'état complet d'une session de jeu Skyjo : matrices de cartes des joueurs,
pile de pioche, pile de défausse, carte tampon et progression des tours.
Le modèle est conçu pour être manipulé exclusivement via le contrôleur,
conformément au patron MVC. Toute modification d'état transite par les commandes
définies dans le package controller.commands.
- Author:
- Joël Stéphane Tchiengang Nchuisseu, Hasmik Tadevosyan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSkyjoModelImpl(ca.uqam.info.max.skyjo.controller.ModelPreset modelPrest, String[] playerNames, Random seed) Constructeur pour le model du jeu. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancolonneSupprimable(int playerIndex, int colIndex) Verifier si la colonne peut être supprimer.ca.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 playerIndex) intintintintgetPlayerName(int playerIndex) int[]intgetRound()booleanisAllPlayerCardsRevealed(int playerIndex) booleanbooleanbooleanbooleanisPlayerCardAtPositionRevealed(int playerIndex, int cardPositionX, int cardPositionY) booleanligneSupprimable(int playerIndex, int rowIndex) Valide si la ligne est supprimable.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[] cards) voidrestoreRow(int playerIndex, int rowIndex, ca.uqam.info.max.skyjo.model.Card[] cards) voidrevealPlayerCard(int playerIndex, int x, int y) voidsetBufferCard(ca.uqam.info.max.skyjo.model.Card card) void
-
Constructor Details
-
SkyjoModelImpl
-
-
Method Details
-
ligneSupprimable
public boolean ligneSupprimable(int playerIndex, int rowIndex) Valide si la ligne est supprimable.- Parameters:
playerIndex- l'indice du joueur.rowIndex- L'indice de la ligne.- Returns:
- Retourne true si la ligne est supprimable, sinon false.
-
colonneSupprimable
public boolean colonneSupprimable(int playerIndex, int colIndex) Verifier si la colonne peut être supprimer.- Parameters:
playerIndex- l'indice du joueurcolIndex- l'indice de la colonne- Returns:
- retourne true si la colonne peut être supprimée sinon false
-
restoreRow
public void restoreRow(int playerIndex, int rowIndex, ca.uqam.info.max.skyjo.model.Card[] cards) - Specified by:
restoreRowin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
restoreColumn
public void restoreColumn(int playerIndex, int colIndex, ca.uqam.info.max.skyjo.model.Card[] cards) - Specified by:
restoreColumnin 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
-
revealPlayerCard
public void revealPlayerCard(int playerIndex, int x, int y) - Specified by:
revealPlayerCardin interfaceca.uqam.info.max.skyjo.model.SkyjoModel
-
endGame
public int[] endGame()- Specified by:
endGamein 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
-
setBufferCard
public void setBufferCard(ca.uqam.info.max.skyjo.model.Card card) - Specified by:
setBufferCardin 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
-
getAmountPlayers
public int getAmountPlayers()- Specified by:
getAmountPlayersin 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
-
getCurrentPlayerIndex
public int getCurrentPlayerIndex()- Specified by:
getCurrentPlayerIndexin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
peekDiscardPile
public ca.uqam.info.max.skyjo.model.Card peekDiscardPile()- Specified by:
peekDiscardPilein 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
-
isBufferCardPresent
public boolean isBufferCardPresent()- Specified by:
isBufferCardPresentin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getPlayerScores
public int[] getPlayerScores()- Specified by:
getPlayerScoresin 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 playerIndex) - Specified by:
getCurrentDimensionsYin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
isGameOverInitialized
public boolean isGameOverInitialized()- Specified by:
isGameOverInitializedin 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
-
getAmountDiscardPileCards
public int getAmountDiscardPileCards()- Specified by:
getAmountDiscardPileCardsin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getAmountDeckCards
public int getAmountDeckCards()- Specified by:
getAmountDeckCardsin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-
getRound
public int getRound()- Specified by:
getRoundin interfaceca.uqam.info.max.skyjo.model.SkyjoModelReadOnly
-