-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Server can make a random position, role, character to start game
- Loading branch information
1 parent
f90c910
commit 3f1524d
Showing
4 changed files
with
94 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/lapisberry/net/packets/ServerStartGamePacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,33 @@ | ||
package com.lapisberry.net.packets; | ||
|
||
import com.lapisberry.game.entities.characters.CharacterEnum; | ||
import com.lapisberry.game.entities.players.Player; | ||
|
||
import java.io.Serial; | ||
import java.util.ArrayList; | ||
|
||
/** | ||
* The {@code ServerStartGamePacket} is a packet that is sent to all clients by the server to start the game. | ||
*/ | ||
public class ServerStartGamePacket extends ServerPacket { | ||
@Serial | ||
private static final long serialVersionUID = -4405052934644343377L; | ||
// Fields | ||
private final ArrayList<Player> shuffledPlayers; | ||
private final ArrayList<CharacterEnum> shuffledCharacters; | ||
|
||
// Constructors | ||
public ServerStartGamePacket(ArrayList<Player> shuffledPlayers, ArrayList<CharacterEnum> shuffledCharacters) { | ||
this.shuffledPlayers = new ArrayList<>(shuffledPlayers); | ||
this.shuffledCharacters = new ArrayList<>(shuffledCharacters); | ||
} | ||
|
||
// Getter Setters | ||
public ArrayList<Player> getShuffledPlayers() { | ||
return shuffledPlayers; | ||
} | ||
|
||
public ArrayList<CharacterEnum> getShuffledCharacters() { | ||
return shuffledCharacters; | ||
} | ||
} |