0% found this document useful (0 votes)
180 views1 page

UML Class Diagram

This UML class diagram summarizes the Connect 4 game project. It shows the key classes like Connect4, GameEngine, GameBoardPanel, and their relationships. The Connect4 class acts as the main driver and coordinates classes like the GameEngine for game logic and GameBoardPanel for display. It also contains player objects and tracks the current game state.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views1 page

UML Class Diagram

This UML class diagram summarizes the Connect 4 game project. It shows the key classes like Connect4, GameEngine, GameBoardPanel, and their relationships. The Connect4 class acts as the main driver and coordinates classes like the GameEngine for game logic and GameBoardPanel for display. It also contains player objects and tracks the current game state.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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