diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/GamePhaseType.java b/src/main/java/com/lovetropics/minigames/common/core/game/GamePhaseType.java index ede5ee69..0b8f1f0d 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/GamePhaseType.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/GamePhaseType.java @@ -8,8 +8,9 @@ import java.util.function.IntFunction; public enum GamePhaseType { - PLAYING, - WAITING, + PLAYING, // Players are loaded into and playing in a game world + PAUSED, // Game world is paused, but potentially child game worlds are now in PLAYING or WAITING + WAITING, // Players are loaded into the 'waiting world' before being loaded into a game world ; private static final IntFunction BY_ID = ByIdMap.continuous(Enum::ordinal, values(), ByIdMap.OutOfBoundsStrategy.ZERO); diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/IGamePhaseDefinition.java b/src/main/java/com/lovetropics/minigames/common/core/game/IGamePhaseDefinition.java index f5c80352..4501bf74 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/IGamePhaseDefinition.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/IGamePhaseDefinition.java @@ -5,6 +5,9 @@ import com.lovetropics.minigames.common.util.Util; import net.minecraft.world.phys.AABB; +/** + * For data driven game phase info + */ public interface IGamePhaseDefinition { IGameMapProvider getMap(); diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/config/GameConfig.java b/src/main/java/com/lovetropics/minigames/common/core/game/config/GameConfig.java index 1505ee69..336e1bd3 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/config/GameConfig.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/config/GameConfig.java @@ -11,6 +11,9 @@ import javax.annotation.Nullable; import java.util.Optional; +/** + * Stores data-driven info about a minigame + */ public final class GameConfig implements IGameDefinition { public final ResourceLocation id; public final ResourceLocation backendId; diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameInstance.java b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameInstance.java index ad81ee6c..7b252fe6 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameInstance.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameInstance.java @@ -9,6 +9,9 @@ import java.util.UUID; +/** + * A unique instance of a specific minigame, stored in a GameLobby + */ final class GameInstance implements IGame { final GameLobby lobby; final MinecraftServer server; diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameLobby.java b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameLobby.java index 5cd47f78..f941a5a8 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameLobby.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GameLobby.java @@ -31,6 +31,12 @@ import javax.annotation.Nullable; // TODO: do we want a different game lobby implementation for something like carnival games? +/** + * This is what is created when the command /game create is run - it is not the 'waiting room' lobby, it is a game lobby, as in + * basically a 'party' of players that will play games together. + * + * A game lobby can have many games in its queue, each will be given a GameInstance. + */ final class GameLobby implements IGameLobby { final MultiGameManager manager; final MinecraftServer server; diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GamePhase.java b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GamePhase.java index 7ffa0b2f..49a770da 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/impl/GamePhase.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/impl/GamePhase.java @@ -41,6 +41,9 @@ import java.util.UUID; import java.util.concurrent.CompletableFuture; +/** + * Think of a GamePhase like an act in a play, where the play is a GameInstance + */ public class GamePhase implements IGamePhase { final GameInstance game; final MinecraftServer server; diff --git a/src/main/java/com/lovetropics/minigames/common/core/game/lobby/QueuedGame.java b/src/main/java/com/lovetropics/minigames/common/core/game/lobby/QueuedGame.java index 7737f650..a4c1edc8 100644 --- a/src/main/java/com/lovetropics/minigames/common/core/game/lobby/QueuedGame.java +++ b/src/main/java/com/lovetropics/minigames/common/core/game/lobby/QueuedGame.java @@ -8,6 +8,9 @@ import javax.annotation.Nullable; import java.util.concurrent.atomic.AtomicInteger; +/** + * Essentially the data underlying a queued game which is stored in a game lobby + */ public record QueuedGame(int networkId, IGameDefinition definition, BehaviorList playingBehaviors, @Nullable BehaviorList waitingBehaviors) { private static final AtomicInteger NEXT_NETWORK_ID = new AtomicInteger();