Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lscgh committed Jan 26, 2024
1 parent df2a022 commit 6f32557
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .gitlab-ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public List<String> onTabComplete(CommandSender sender, Command command, String
return filteredCompletions;
}


public GameConfig createGameConfigFromCommand(Player mainPlayer, String args[]) throws InvalidArgCountException, OpponentPlayerNotFoundException, NumberFormatException {
if(args.length < CommandTicTacToe.minValidArgCount && args.length > CommandTicTacToe.maxValidArgCount) {
throw new InvalidArgCountException("CommandTicTacToe.createGameConfigFromCommand was called with " + args.length + "arguments! (min = " + CommandTicTacToe.minValidArgCount + "; max = " + CommandTicTacToe.maxValidArgCount + ")");
Expand Down
28 changes: 27 additions & 1 deletion mavenmcserver/src/main/java/mavenmcserver/game/GameConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,48 @@

public class GameConfig {

/**
* The minimum X and Z size of a game
*/
static int minFlatSize = 2;

/**
* The minimum Y size of a game
*/
static int minHeight = 1;

/**
* The player who started the game
*/
public Player mainPlayer;

/**
* The player who was invited to the game
*/
public Player opponentPlayer;

/**
* The X, Y, Z size of the game
*/
public Vector3i size;

/**
* The number of same-player-marked fields required for that player to win
*/
public int winRequiredAmount;


public GameConfig(Player mainPlayer, Player opponentPlayer, Vector3i size, int winRequiredAmount) {
this.mainPlayer = mainPlayer;
this.opponentPlayer = opponentPlayer;
this.size = size;
this.winRequiredAmount = winRequiredAmount;
}

/// Returns an empty list if everything is OK.
/**
* Checks the config for errors.
* @return a list with all errors found on this config. If no errors are found, an empty list is returned.
*/
public List<String> validate() {
ArrayList<String> errors = new ArrayList<String>();

Expand Down

0 comments on commit 6f32557

Please sign in to comment.