diff --git a/Diagrammes-UML.md b/Diagrammes-UML.md index aa01f89..b4cc664 100644 --- a/Diagrammes-UML.md +++ b/Diagrammes-UML.md @@ -1 +1 @@ -![](classDiagram.svg) \ No newline at end of file +![](SAE201_ClassDiagram.drawio.svg) \ No newline at end of file diff --git a/SAE201_ClassDiagram.drawio.svg b/SAE201_ClassDiagram.drawio.svg new file mode 100644 index 0000000..7962a84 --- /dev/null +++ b/SAE201_ClassDiagram.drawio.svg @@ -0,0 +1,4 @@ + + + +
Game
Game
- scoreBoard : Dictionary<Player, int>
- scoreBoard : Dictionary<Player, int>
+ GameRunning : bool
+ GameRunning : bool
+ Game()
+ Game()
+ AddPlayerInGame(playerTag: string): bool
+ AddPlayerInGame(playerTag: string): bo...
+ GetBoard(): Board
+ GetBoard(): Board
+ StartGame(): bool
+ StartGame(): bool
+ AddCellUsed(c: Cell)
+ AddCellUsed(c: Cell)
+ EmptyCellUsed()
+ EmptyCellUsed()
+ GetPlayingPlayer(): Player
+ GetPlayingPlayer(): Player
+ GetPlayingPlayerPosition(): int
+ GetPlayingPlayerPosition(): int
+ TileOfPlayerWithPos(postile: int): Tile
+ TileOfPlayerWithPos(postile: int): Tile
+ GiveTilesToPlayers()
+ GiveTilesToPlayers()
+ TileOfPlayerWithPos(postile: int): Tile
+ TileOfPlayerWithPos(postile: int): Tile
Player
Player
+ NameTag: string
+ NameTag: string
+ IsPlaying: bool
+ IsPlaying: bool
+ Player(name: string)
+ Player(name: string)
+ AddTileToPlayer(tile: Tile)
+ AddTileToPlayer(tile: Tile)
+ RemoveTileToPlayer(tile: Tile)
+ RemoveTileToPlayer(tile: Til...
Tile
Tile
- shape: Shape
- shape: Shape
- color: Color
- color: Color
+ GetShape: Shape
+ GetShape: Shape
+ GetColor: Color
+ GetColor: Color
+ Tile(sh: Shape, co: Color)
+ Tile(sh: Shape, co: Col...
+ NameColorTile(): string
+ NameColorTile(): string
+ ToString(): string
+ ToString(): string
TileBag
TileBag
+ TileBag(nbSet: int)
+ TileBag(nbSet: int)
+ AddTileInBag(tile: Tile)
+ AddTileInBag(tile: Tile)
+ RemoveTileInBag(tile: Tile)
+ RemoveTileInBag(tile: Til...

<<Interface>>
IPlayer


+ CreatePlayer(playerTag: string): Player


+ SetNextPlayer(): string


+ SetFirstPlayer(): string


+ PlaceTile(player: Player, tile: Tile, x: int, y: int): bool


+ DrawTiles(player: Player): bool


+ SwapTiles(player: Player, tilesToSwap: List<Tile>): bool


+ GetPlayerScore(player: Player, cellsPlayed ReadOnlyCollection<Cell>, b: Board): int

<<Interface>>...

<<Interface>>
IRules


+ CreateBoard(): Board


+ CreateTileBag(nbSet: int): TileBag


+ IsMoveCorrect(t: Tile, x: int, y: int, b: Board): bool


+ CheckExtendedSurroundingTiles(tile: Tile, x: int, y: int, dx: int, dy: int, b: Board): bool


+ CheckTilesInLine(cells: List<Cell>, b: Board, x: int, y: int): bool


+ IsGameOver();

<<Interface>>...
Board
Board
+ Rows: int
+ Rows: int
+ Columns: int
+ Columns: int
+ Board(rows: int, cols: int)
+ Board(rows: int, cols: int)
+ HasOccupiedCase(): bool
+ HasOccupiedCase(): bool
+ AddTileInCell(x: int, y: int, tile: Tile)
+ AddTileInCell(x: int, y: int, tile: Tile)
+ GetCells(): List<Cell>
+ GetCells(): List<Cell>
+ GetReadCells(): IReadOnlyCollection<Cell>
+ GetReadCells(): IReadOnlyCollection<Cell>
+ GetCell(): Cell
+ GetCell(): Cell

<<Struct>>
Score


- PlayerScore: int


+ PlayerTag: string



+ Score(p: Player)

<<Struct>>...
Cell
Cell
- x: int
- x: int
- y: int
- y: int
+ GetX: int
+ GetX: int
+ GetY: int
+ GetY: int
+ GetTile: Tile
+ GetTile: Tile
+ IsFree: bool
+ IsFree: bool
+ Cell(x: int, y: int)
+ Cell(x: int, y: int)
+ SetTile(addedTile: Tile)
+ SetTile(addedTile: Ti...

<<Enum>>
Color


Red

Blue

Green

Yellow

Orange

Purple

<<Enum>>...

<<Enum>>
Shape


Square

Round

Rhombus

Club

Shuriken

Star

<<Enum>>...
1
1
-*playerTiles
-*playerTiles
-*board
-*board
-*tileBag
-*tileBag
1
1
-*players
-*players
-*tiles
-*tiles
1
1
-*tile
-*tile
1
1
-*cells
-*cells
\ No newline at end of file diff --git a/classDiagram.svg b/classDiagram.svg deleted file mode 100644 index fef50b2..0000000 --- a/classDiagram.svg +++ /dev/null @@ -1 +0,0 @@ -Player-nameTag: string-isPlaying: bool = false+Player(nameTag: string)+getNameTag(): string+placeTiles()+getIsPlaying(): bool+SetIsPlaying(value: bool)+addTilePlayer(tile: Tile)+removeTilePlayer(tile: Tile)«enumeration»ColorRedBlueGreenYellowOrangePurple«enumeration»ShapeSquareRoundRhombusClubShurikenStarTile-shape: Shape-color: Color+Tile()+getShape(): Shape+getColor(): Color«Struct»Score-score: int-playerTag: string+Score(p: Player)Board+Board()+addTileInCell(x: int, y: int, tile: Tile): boolCell-X: int-Y: int+Cell()+getX(): int+getY(): int+isFree(): bool+getTile(): Tile+setTile(addedTile: Tile): bool-*cellsGame+gameRunning: bool+Game()+setPlayersTile()+addPlayerInGame(PlayerTag: string): bool+startGame(): bool+getPlayingPlayerPosition(): int+getNbPlayers(): int+TileOfPlayerWithPos(): Tile+setNextPlayer(old: int, new: int)+nextPlayer(): string+gameRunning(): bool+PlaceTileGame(tile: Tile, x: int, y: int): boolTileBag-nbTiles: int+TileBag(nbSet: int)+RemoveTilesInBag(tile: Tile)-*players-*tileBag-*tiles-*tile-*board-*playerTiles«Interface»IPlayer+CreatePlayer(playerTag: string): Player+SetNextPlayer(players: List<Player>)+IsPlaying(player: Player): bool+PlaceTile(player: Player, tile: Tile, x: int, y: int)+ContinueToPlay(): bool«Interface»IRules \ No newline at end of file