You are on page 1of 1

COMP 2911 15s1 Final Project

Connect 4 - UML Class Diagram

Connect4
<<Runnable>>

- mainFrame : JFrame
- menuPanel : MenuPanel
- simulationPanel : GameBoardPanel
- gameEngine : GameEngine
- homeGlassPane : JPanel
- threadGE : Thread
- threadGUI : Thread
- isMuted : boolean

+ main(String[]) : void
+ display() : void
+ setVisity() : boolean
+ suspendGame() : void
+ isMuted() : boolean
+ setIsMuted(boolean) : void LogoPanel <JPanel>
+ changeGlassPane(int) : void
+ run() : void

+ paint(Graphics) : void

HowToPlay <JPanel> ResizeImage ButtonSound

- clip:AudioClip
- url: URL
+ changeImage
+ paint(Graphics) : void (oldImageIcon: ImageIcon,
widith:int, height: int):
ImageIcon + music( String songName)
GameBoardPanel <JPanel> <JFrame>
GameState GameEngine <<ActionListener>>
<<Runnable>>
- board : Player[][] - gameWindow : GameWindow
- currPlayer : Player - currState : GameState - mainGame : Connect4
- nextPlayer : Player - gameBoardPanel : GameBoardPanel - gameEngine : GameEngine Credits <JPanel>
- winner : Player - isInGame : boolean - finishPanel : JPanel
- turn : int - totalGame : int - player1 : Player
- winDiscs : ArrayList<Integer> - player2 : Player
+ startNewGame(Player,Player,GameBoardPanel) : void - gameMode : int
+ run() : void - buttons : ArrayList<JButton>
+ runNextMove(int) : int + sleep(int) : void
+ checkGameEnd() : boolean + getCurrState() : GameState + paint(Graphics) : void
+ getWinDiscs() : ArrayList<Integer> + getCurrPlayer() : Player + displayDisc(int,int,int) : void
+ getLocation(int,int) : Player + getOtherPlayer() : Player + updateStatisticsPanel() : void
+ getBoard : Player[][] + isValidMove(int) : boolean + displayEndGame(Player, ArrayList<Integer>) : void
+ getAvailableRow(int) : int + isInGame() : boolean + restartNewGame() : void
+ getWinner() : Player + suspendGame() : void + startNewGame() : void GUI Main Frame Holder
+ incTurn() ; void + getCurrPlayerIndex() : int + startSimulationGame() : void
+ isValidMove(int) : boolean + initSinglePlayerGame(String, int) : void MenuPanel <JPanel>
+ initDoublePlayersGame(String,String) : void

- mainGame : Connect4;
- muteButton : JButton
- muteActionListener : ActionListener
BackgroundMusic

- clip:AudioClip
Player - url: URL
<<Interface>> + mute() : void
+ unmute() : void
+ closeJOptionPanel() : void + music( String songName)
+ stopMusic()

+ getName(): String
+ decideMove(GameState currState): int

SinglePlayerMenu <JPanel> DoublePlayersMenu


- mainGame: Connect4
- AIMode: int - mainGame : Connect4
- group: ButtonGroup
- AIButton0: JRadioButton
- AIButton1: JRadioButton
- AIButton2: JRadioButton
AI User

- name: String - name: String


- hALgo: AlphaBetaHeuristic - nextMove: int
- mode: int - isReady: boolean
- depth: int
- nextMove: int

GameWindow <JFrame>

- gameBoardPanel: GameBoardPanel
- gameStatisticsPanel: GameStatisticsPanel
AlphaBetaHeuristic - mainGame: Connect4
<<Interface>>
+ startSinglePlayerGame(String, int):void
+ startDoublePlayersGame(String, String): void
+ h(GameState state) : int

H0 H1 H2 GameStatisticsPanel GameMenuBar

- gameWindow: GameWindow
- mainGame: Connect4 - mainGame : Connect4
- gameEngine: GameEngine - gameWindow : GameWindow
+ h(GameState state) : int + h(GameState state) : int + h(GameState state) : int - player1: JLabel - muteIcon : ImageIcon
- player2: JLabel
- title : String

+ setPlayerNames(Player, Player): void


+ setAvatorIcon(): void
+ setWhosTurn(): void
+ displayEndGame(): void

You might also like