8
Networked Mancala XP & Agile Methods: Team 3 Stephen Olivier & Keith Lee

Networked Mancala

Embed Size (px)

DESCRIPTION

Networked Mancala. XP & Agile Methods: Team 3 Stephen Olivier & Keith Lee. Programming Environment. Side-By-Side Pair Programming Eclipse IDE 3.1.2 Java 1.5 JUnit 3.8.1 Minimal Sleep. Activity Diagram. Class Structure. MancalaGame Directs traffic and bin choices, applies rules - PowerPoint PPT Presentation

Citation preview

Page 1: Networked Mancala

Networked Mancala

XP & Agile Methods: Team 3

Stephen Olivier & Keith Lee

Page 2: Networked Mancala

Programming Environment

Side-By-Side Pair Programming

Eclipse IDE 3.1.2

Java 1.5

JUnit 3.8.1

Minimal Sleep

Page 3: Networked Mancala

Activity Diagram

Login

Play Computer Wait For Remote Player 2 Find Remote Player 1

Game Begins

Player 1 Chooses Bin

Player 2 Chooses Bin

Game Over

New Game.Different Opponent

New Game.Same Opponent

Player 2's Turn

Player 1's Turn

Player 1's TurnPlayer 2's Turn

End Of Game

End Of Game

Connected

Connected

FailureCancel Wait

Page 4: Networked Mancala

Class Structure

MancalaGame Directs traffic and bin choices, applies rules

MancalaBoard Maintains and displays game board state

RemotePlayer Receives bin number from opponent

MancalaConnectionManager Login and game set-up

Helper Classes for Dialogs, Buttons

Page 5: Networked Mancala

Graphical User Interface

Choosing A Bin Bins are buttons with corresponding numbers Current player’s non-empty bins are enabled

Event Listeners Bin number sent to MancalaGame MancalaGame applies game rules Notify board display elements and remote

player program Last move and current player highlighted

Per-User Score Statistics using Box-Plot

Page 6: Networked Mancala

Network Communication: Part 1

Player 1 opens ServerSocket

Player 2 connects Socket to ServerSocket

Player 1 spawns Socket from connection

Player 2 waits to receive player 1’s first move

Game begins

Page 7: Networked Mancala

Network Communication: Part 2

Player Chooses Bin Bin number sent through Socket If turn changes:

Blocking wait to receive opponent’s bin choice Wait is separate thread to keep GUI responsive

Player Waits for Bin Choice Bin number received through Socket If turn changes:

Enable local player to choose bin

Page 8: Networked Mancala

Network Communication: Part 3

Reset Code Sent if local player quits Received if remote player quits

Lost Connection Current game ends Login dialog appears