Skip to content

Commit 77a8f08

Browse files
docs: Add missing documentation
1 parent 67f23e9 commit 77a8f08

16 files changed

+46
-21
lines changed

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ if (enablePreviewFeatures) {
7373

7474
tasks.withType<Javadoc>() {
7575
(options as StandardJavadocDocletOptions).apply {
76-
addBooleanOption("-enable-preview", true)
76+
addStringOption("Xmaxwarns", "1")
77+
addBooleanOption("-enable-preview", true)
7778
source = "24"
7879
}
7980
}

api/src/main/java/org/xxdc/oss/example/PlayerNode.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
import org.xxdc.oss.example.transport.TransportConfiguration;
88
import org.xxdc.oss.example.transport.TransportServer;
99

10-
/**
11-
* The `PlayerNode` interface represents a player in a game. It provides methods to get the player's
12-
* marker and apply the player's next move to the game state.
13-
*
14-
* <p>The `Local` implementation of `PlayerNode` represents a local player, where the player's logic
15-
* is implemented directly in the application.
16-
*
17-
* <p>The `Remote` implementation of `PlayerNode` represents a remote player, where the player's
18-
* logic is implemented in a separate process and communicated with the application through a
19-
* transport mechanism.
20-
*/
10+
/// The `PlayerNode` interface represents a player in a game. It provides methods to get the
11+
// player's
12+
/// marker and apply the player's next move to the game state.
13+
///
14+
/// The `Local` implementation of `PlayerNode` represents a local player, where the player's logic
15+
/// is implemented directly in the application.
16+
///
17+
/// The `Remote` implementation of `PlayerNode` represents a remote player, where the player's
18+
/// logic is implemented in a separate process and communicated with the application through a
19+
/// transport mechanism.
2120
public sealed interface PlayerNode extends ToIntFunction<GameState> {
2221

2322
/**

api/src/main/java/org/xxdc/oss/example/PlayerPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.net.InetAddress;
44
import java.net.UnknownHostException;
55

6-
/** Provides a utility to generate a player identifier string for a given `PlayerNode`. */
6+
/// Provides a utility to generate a player identifier string for a given `PlayerNode`.
77
public class PlayerPrinter {
88

99
/**

api/src/main/java/org/xxdc/oss/example/analysis/Analyzers.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
import java.util.stream.Gatherer.Integrator;
55
import org.xxdc.oss.example.GameState;
66

7+
/** A collection of analyzers for gathering data points from the game state. */
78
public class Analyzers {
89

10+
private Analyzers() {}
11+
912
static class GathererState {
1013
private GameState prevGameState;
1114
private int currMoveNumber;

api/src/main/java/org/xxdc/oss/example/analysis/StrategicTurningPoint.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
/// A strategic turning point in a game of Tic-Tac-Toe.
77
public sealed interface StrategicTurningPoint {
88

9-
static enum PriorityLevel {
9+
/// Priority/severity level of the strategic turning point.
10+
enum PriorityLevel {
1011
HIGH,
1112
MEDIUM,
1213
LOW

api/src/main/java/org/xxdc/oss/example/bot/custom/NaiveFifoGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
import java.lang.constant.MethodTypeDesc;
77
import java.lang.invoke.MethodHandles;
88

9+
/// Naive FIFO bot implementation that implements the CustomBotStrategy interface.
10+
/// This bot uses a FIFO (First-In-First-Out) strategy to make moves on the game board.
911
public class NaiveFifoGenerator {
1012

13+
/// Generates a new instance of the NaiveFifoGenerator class.
1114
public static CustomBotStrategy newGeneratedBot() {
1215
try {
1316
byte[] classBytes = generateBotClass();
@@ -19,6 +22,7 @@ public static CustomBotStrategy newGeneratedBot() {
1922
}
2023
}
2124

25+
/// Generates the bytecode for the NaiveFifoGenerator class.
2226
private static byte[] generateBotClass() {
2327
return ClassFile.of()
2428
.build(

api/src/main/java/org/xxdc/oss/example/commentary/CommentaryPersona.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
44

5+
/**
6+
* Persona / personality that provides a comment on a strategic turning point in the game.
7+
*/
58
public interface CommentaryPersona {
69
String comment(StrategicTurningPoint turningPoint);
710
}

api/src/main/java/org/xxdc/oss/example/commentary/DefaultAckCommentaryPersona.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
44

5+
/**
6+
* Persona / personality that provides an acknowledgement of a strategic turning point in the game.
7+
*/
58
public class DefaultAckCommentaryPersona implements CommentaryPersona {
69

710
@Override

api/src/main/java/org/xxdc/oss/example/commentary/DefaultLiveCommentaryPersona.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
44

5+
/**
6+
* Persona / personality that provides a comment on a strategic turning point in the game.
7+
*/
58
public class DefaultLiveCommentaryPersona implements CommentaryPersona {
69

710
@Override

api/src/main/java/org/xxdc/oss/example/commentary/DefaultPostAnalysisCommentaryPersona.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
44

5+
/**
6+
* Persona that provides post-game analysis commentary on a strategic turning point in the game.
7+
*/
58
public class DefaultPostAnalysisCommentaryPersona implements CommentaryPersona {
69

710
@Override

api/src/main/java/org/xxdc/oss/example/commentary/EsportsLiveCommentaryPersona.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
66

7+
/**
8+
* Persona that provides energetic, esports-style commentary on a strategic turning point in the game.
9+
*/
710
public class EsportsLiveCommentaryPersona implements CommentaryPersona {
811

912
@Override

api/src/main/java/org/xxdc/oss/example/commentary/EsportsPostAnalysisConmmentaryPersona.java renamed to api/src/main/java/org/xxdc/oss/example/commentary/EsportsPostAnalysisCommentaryPersona.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import org.xxdc.oss.example.analysis.StrategicTurningPoint;
44

5-
public class EsportsPostAnalysisConmmentaryPersona implements CommentaryPersona {
5+
/**
6+
* Persona that provides esports-style post-game analysis commentary on a strategic turning point in the game.
7+
*/
8+
public class EsportsPostAnalysisCommentaryPersona implements CommentaryPersona {
69

710
@Override
811
public String comment(StrategicTurningPoint turningPoint) {

app/src/main/java/org/xxdc/oss/example/App.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.lang.System.Logger.Level;
1111
import org.xxdc.oss.example.bot.BotStrategy;
1212
import org.xxdc.oss.example.commentary.EsportsLiveCommentaryPersona;
13-
import org.xxdc.oss.example.commentary.EsportsPostAnalysisConmmentaryPersona;
13+
import org.xxdc.oss.example.commentary.EsportsPostAnalysisCommentaryPersona;
1414

1515
/** A simple java tic-tac-toe game. */
1616
public class App {
@@ -40,7 +40,7 @@ private void logLiveCommentary(Game game) {
4040

4141
private void logPostAnalysisCommentary(Game game) {
4242
log.log(Level.INFO, "Post-Game Analysis:");
43-
var commentary = new EsportsPostAnalysisConmmentaryPersona();
43+
var commentary = new EsportsPostAnalysisCommentaryPersona();
4444
game.history().stream()
4545
.gather(strategicTurningPoints())
4646
.map(commentary::comment)

app/src/main/java/org/xxdc/oss/example/AppTrainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.lang.System.Logger.Level;
1010
import org.xxdc.oss.example.bot.BotStrategy;
1111
import org.xxdc.oss.example.commentary.EsportsLiveCommentaryPersona;
12-
import org.xxdc.oss.example.commentary.EsportsPostAnalysisConmmentaryPersona;
12+
import org.xxdc.oss.example.commentary.EsportsPostAnalysisCommentaryPersona;
1313

1414
/// A simple java tic-tac-toe game with a bot playing another bot for training
1515
/// the JDK for AOT class loading and linking. NB: Uses bots so not all paths are
@@ -56,7 +56,7 @@ private void logLiveCommentary(Game game) {
5656

5757
private void logPostAnalysisCommentary(Game game) {
5858
log.log(Level.INFO, "Post-Game Analysis:");
59-
var commentary = new EsportsPostAnalysisConmmentaryPersona();
59+
var commentary = new EsportsPostAnalysisCommentaryPersona();
6060
game.history().stream()
6161
.gather(strategicTurningPoints())
6262
.map(commentary::comment)

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@ tasks.register("checkSigningEnvSetup") {
5151
}
5252
}
5353

54-

0 commit comments

Comments
 (0)