1 / 1

Multiplayer Battleship Game Management System in Java

This application serves as a complete management system for a multiplayer Battleship game. Built using Java's Swing for GUI design, it supports player interactions, including placing boats, shooting coordinates, and tracking game state. The system encompasses multiple components like GUI, Control, Board, and Player classes, facilitating seamless communication between players and game logic. Key functionalities include saving and loading game states, refreshing the board, and handling user events. This implementation aims to enhance user experience while providing a solid gaming foundation.

pooky
Download Presentation

Multiplayer Battleship Game Management System in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GUI - boatNumber : int - vert : boolean - gridbag : GridBagLayout - contentPane : Container - text : JTextField - coordinates[][] : JButton - m : int - l : int - textArea : JTextArea - r : int - x : int - y : int - c : GridBagConstraints - lytt : boolean - klasseSomVilHa : Object - ctrl : Control + GUI(windowsTittle : String, ctrl : Control + placeComponents() : void + getCoord(obj : Object) : void + actionPerformed(event : ActionEvent) : void + itemStateChanged(e ItemEvent) : void + action(evt : Event, arg : Object) : boolean + output(textWritten : String) : void + refresh(board : int[][]) : void + refresh2(board : int[][]) : void + refresh(board : int[][], board2 : int[][]) : void Board - boats : Boat [] - board : int[][] - counter : int - ctrl : Control + Board(ctrl : Control) + Board(ctrl: Control, board : int[][], counter : int) + getNameBoat(boatNumber : int) : String +placeBoat(coord : int[], boat : int) : boolean + shootCoord(coordX : int, coordY : int) : boolean + returnCount() : int + reduceCount() : void + getArray() : int[][] Mottaker setCoord(innCoord : int[]) : void Starter + main(args : String[]) : void Slave - STANDARD_PORT : int - PROTOCOL_GETCOORD : String - PROTOCOL_MESSAGE : String - PROTOCOL_ENDGAME : String - minServer : Server - innData : Object - boardMeg : Board - boardDeg : Board - coord : int[] - minGui : GUI - connected : boolean - venteTeller : int + Slave(innMinGui : GUI) + run() : void + setCoord(inCoord : int[]) : void Boat - size : int + Boat(size : int) + reduceBoat() : boolean + getSize() : int Control - p1 : int - p2 : int - gui : GUI - name1 : String - name2 : String - p1Board : Board - p2Board : Board - player1 : Player - player2 : Player - filesys : FileSystem - trad : Thread + Control() + start(p1 : int, p2 : int, name1 : String, name2 ; String) : void + sinkBoat(s : String) : void + refresh(b : boolean, c : boolean) : void + load(name : String) : void + save(name : String) : void + run() : void MTB - oSize : int - size : int - name : String + MTB() FileSystem - skilletegn + save(name : String, list : ArrayList) : void + load(name : String) : ArrayList Server - minServer : ServerSocket - minSocket : Socket - les : ObjectInputStream - skriv : ObjectOutputStream - returObject : Object + Server(inPort : int) + send(data : Object) : void + lytt() : Object Destroyer - oSize : int - size : int - name : String + Destroyer() Human - trad : Thread - lyttende : boolean - coord : int[] - gui : GUI + Human(inName : String, inGui : GUI, trad : Thread) + shoot() : int[] + placeBoat() : int[] + setCoord(inCoord : int[]) : void Player / name : String Player(inName : String) shoot(): int[] placeBoat(): int[] Cruiser - oSize : int - size : int - name : String + Cruiser() Client - minSocket : Socket - host : String - les : ObjectInputStream - skriv : ObjectOutputStream - returObject : Object + Client(inHost : String, inPort : int) + send(data : Object) : void + lytt() : Object NetworkPlayer - STANDARD_PORT : int - PROTOCOL_GETCOORD : String - PROTOCOL_MESSAGE : String - PROTOCOL_ENDGAME : String - myClient : Client - boardMeg : Board - boardDeg : Board + NetworkPlayer(playerName : String, host: String) + shoot() : int[] + plcaeBoat() : int[] + message(message : String) : void + endGame() : void + refresh(boardMeg : Board, boardDeg : Board) : void Carrier - oSize : int - size : int - name : String + Carrier() AI8 - returnumb : int[] - opBoard : Board - myBoard : Board - board : int[][] + AI8(name : String, board : Board) + placeBoat() : int[] + shoot() : int[] Submarine - oSize : int - size : int - name : String + Submarine()

More Related