130 likes | 262 Vues
This document outlines the class definitions and key functions for the board game "Sorry!" as implemented in Mordor Programming. It includes detailed descriptions of the `Board`, `Player`, `Pawn`, and `Card` classes, showcasing their attributes and methods. Key functionalities such as moving players, drawing cards, checking for winners, and handling slides and bumps are integrated into the structure. The relationships and activity diagrams illustrate the game setup, player movements, and interactions, providing a clear framework for understanding the game's mechanics.
E N D
Sorry! By: Mordor Programming
Class Definitions • Board-players : array[Player]-cards : Cards -board : CircularArrayList[BoardSquare]+slide() +isBump() : boolean+bump() +checkWinner() : int +drawCard() : int • BoardSquare -colorPanel : string -pawnColor : string -startSlide : boolean -isSZEntrance: boolean +getColorPanel() : string +getPawnColor() : string +getStartSlide() : boolean +getIsSZEntrance() : boolean
Class Definitions cont’d • Pawn -positionIndex : int -start : boolean -home : boolean -inSZ : boolean +getPositionIndex() : int +movePositionIndex(newPosition : int) : boolean +getSZ() : boolean +getHome() : boolean +changeStart(switch : boolean) : boolean +changeHome(switch : boolean) : boolean +changeSZ(switch : boolean) : boolean • Player -color : string -pawns : array[Pawn]-ai : boolean+choosePawnToMove(index : int) : boolean+movePawn(positionToMove : int) : boolean • Cards -deck : array[int] -top : int +shuffle() +discard() +drawTopCard() : int