Skip to content

Commit

Permalink
Updated version to 1.0.1
Browse files Browse the repository at this point in the history
Updated justice-utils to 1.3.4
  • Loading branch information
DrCorchit committed Nov 11, 2023
1 parent 7d6341e commit 97e26f4
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 33 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>justice-core</artifactId>
<groupId>com.drcorchit</groupId>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<name>justice-core</name>
Expand Down Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>com.github.DrCorchit</groupId>
<artifactId>justice-utils</artifactId>
<version>1.2.1</version>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.json.getString
import com.drcorchit.justice.utils.json.getString
import com.google.gson.JsonObject

abstract class AbstractElement(private val parent: AbstractMechanic<*>, name: String, private val id: Int) : GameElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.Logger
import com.drcorchit.utils.json.getOrDefault
import com.drcorchit.justice.utils.Logger
import com.drcorchit.justice.utils.json.getOrDefault
import com.google.gson.JsonObject

private val log = Logger.getLogger(AbstractMechanic::class.java)
Expand Down
7 changes: 4 additions & 3 deletions src/main/kotlin/com/drcorchit/justice/games/Game.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.Version
import com.drcorchit.utils.json.*
import com.drcorchit.utils.math.Rng
import com.drcorchit.justice.utils.Version
import com.drcorchit.justice.utils.json.*
import com.drcorchit.justice.utils.json.Result.Companion.failWithReason
import com.drcorchit.justice.utils.math.Rng
import com.google.errorprone.annotations.CanIgnoreReturnValue
import com.google.gson.JsonArray
import com.google.gson.JsonObject
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/drcorchit/justice/games/GameElement.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.json.GSON
import com.drcorchit.utils.normalize
import com.drcorchit.justice.utils.Strings.Companion.normalize
import com.drcorchit.justice.utils.json.JsonUtils.Companion.GSON
import com.google.gson.JsonElement
import com.google.gson.JsonObject

Expand All @@ -15,7 +15,7 @@ interface GameElement : Syncable<JsonObject> {
//Contract: The key is unique and does not change under any circumstances.
//Contract: parent().getElement(key()).equals(this) is always true
val key: Any
get() = normalize(name())
get() = name().normalize()

//A short description of the object visible to the client
fun description(): String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.json.GSON
import com.drcorchit.justice.utils.json.JsonUtils.Companion.GSON
import com.google.gson.JsonObject

interface GameMechanic<T : GameElement> : Syncable<JsonObject>, Iterable<T> {
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/drcorchit/justice/games/GameState.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.drcorchit.justice.games

import com.google.gson.JsonElement

enum class GameState(val isJoiningEnabled: Boolean, val isEventsEnabled: Boolean, val isSavingEnabled: Boolean) {
//Transitions to "open" when minPlayers is reached
STAGING(true, false, false),
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/drcorchit/justice/games/GridElement.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.json.getString
import com.drcorchit.utils.math.Space
import com.drcorchit.justice.utils.json.getString
import com.drcorchit.justice.utils.math.Space
import com.google.gson.JsonObject

abstract class GridElement(val parent: GridMechanic<*>, val coord: Space.Coordinate) : GameElement {
Expand Down
14 changes: 7 additions & 7 deletions src/main/kotlin/com/drcorchit/justice/games/GridMechanic.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.drcorchit.justice.games

import com.drcorchit.utils.Logger
import com.drcorchit.utils.json.getBool
import com.drcorchit.utils.json.getOrDefault
import com.drcorchit.utils.math.Grid
import com.drcorchit.utils.math.Layout
import com.drcorchit.utils.math.Space
import com.drcorchit.justice.utils.Logger
import com.drcorchit.justice.utils.json.getBool
import com.drcorchit.justice.utils.json.getOrDefault
import com.drcorchit.justice.utils.math.Grid
import com.drcorchit.justice.utils.math.Layout
import com.drcorchit.justice.utils.math.Space
import com.google.gson.JsonObject

private val log = Logger.getLogger(GridMechanic::class.java)
Expand Down Expand Up @@ -34,7 +34,7 @@ abstract class GridMechanic<T : GridElement>(game: Game, info: JsonObject, date:

override fun get(key: Any): T {
if (key is Space.Coordinate) {
return grid.get(key)
return grid.get(key)!!
} else {
throw IllegalArgumentException("Supplied key is not a valid coordinate")
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/kotlin/com/drcorchit/justice/games/mods/Mod.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.drcorchit.justice.games.mods

import com.drcorchit.utils.exceptions.MissingDependencyException
import com.drcorchit.utils.json.JsonDiff
import com.drcorchit.utils.json.getString
import com.drcorchit.utils.json.parseFromUrl
import com.drcorchit.utils.math.AcyclicGraph
import com.drcorchit.utils.whitelist
import com.drcorchit.justice.utils.Strings.Companion.whitelist
import com.drcorchit.justice.utils.exceptions.MissingDependencyException
import com.drcorchit.justice.utils.json.JsonDiff
import com.drcorchit.justice.utils.json.JsonUtils.Companion.parseFromUrl
import com.drcorchit.justice.utils.json.getString
import com.drcorchit.justice.utils.math.AcyclicGraph
import com.google.common.collect.ImmutableBiMap
import com.google.common.collect.ImmutableMap
import com.google.common.collect.ImmutableSet
Expand Down Expand Up @@ -42,6 +42,7 @@ class Mod private constructor(info: JsonObject) {
"description",
"No description is available for this mod"
).whitelist()

author = info.get("author").asString.whitelist()

reqMechanics = if (info.has("mechanics")) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/com/drcorchit/justice/games/mods/ModID.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.drcorchit.justice.games.mods

import com.drcorchit.utils.Version
import com.drcorchit.utils.createCache
import com.drcorchit.utils.json.parseFromUrl
import com.drcorchit.utils.normalize
import com.drcorchit.utils.whitelist
import com.drcorchit.justice.utils.Strings.Companion.normalize
import com.drcorchit.justice.utils.Strings.Companion.whitelist
import com.drcorchit.justice.utils.Version
import com.drcorchit.justice.utils.createCache
import com.drcorchit.justice.utils.json.JsonUtils.Companion.parseFromUrl
import com.google.common.cache.LoadingCache
import com.google.gson.JsonObject
import java.util.concurrent.ConcurrentHashMap
Expand All @@ -19,7 +19,7 @@ class ModID private constructor(pair: Pair<String, String>) {

init {
name = pair.first
normalName = normalize(name)
normalName = name.normalize()
version = Version(pair.second)
value = "${normalName}_v$version"
val current: ModID? = LATEST_VERSIONS[normalName]
Expand Down

0 comments on commit 97e26f4

Please sign in to comment.