From 8ad3a1522a5709fc60c79edcdecd8b6e0bf53348 Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Tue, 10 Jul 2018 22:06:00 +0200 Subject: Clean class visibilities --- .../game/data/definitions/EffectsDefinition.kt | 2 +- .../sevenwonders/game/data/definitions/WonderDefinition.kt | 2 +- .../game/data/serializers/NumericEffectSerializer.kt | 14 ++++++-------- .../game/data/serializers/ProductionIncreaseSerializer.kt | 2 +- .../game/data/serializers/ProductionSerializer.kt | 2 +- .../game/data/serializers/ResourceTypeSerializer.kt | 8 +++----- .../game/data/serializers/ResourceTypesSerializer.kt | 8 +++----- .../game/data/serializers/ResourcesSerializer.kt | 11 ++++------- 8 files changed, 20 insertions(+), 29 deletions(-) (limited to 'game-engine/src/main/kotlin/org/luxons') diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.kt index 978ec4a6..23a8d3ee 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.kt @@ -12,7 +12,7 @@ import org.luxons.sevenwonders.game.effects.SpecialAbility import org.luxons.sevenwonders.game.effects.SpecialAbilityActivation import java.util.ArrayList -internal data class EffectsDefinition( +internal class EffectsDefinition( private val gold: GoldIncrease? = null, private val military: MilitaryReinforcements? = null, private val science: ScienceProgress? = null, diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt index 013a3d9c..2e6efac4 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt @@ -4,7 +4,7 @@ import org.luxons.sevenwonders.game.Settings import org.luxons.sevenwonders.game.data.WonderSide import org.luxons.sevenwonders.game.wonders.Wonder -internal data class WonderDefinition( +internal class WonderDefinition( private val name: String, private val sides: Map ) { diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializer.kt index 510a511c..9a9a006e 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializer.kt @@ -1,12 +1,5 @@ package org.luxons.sevenwonders.game.data.serializers -import java.lang.reflect.Type - -import org.luxons.sevenwonders.game.effects.Effect -import org.luxons.sevenwonders.game.effects.GoldIncrease -import org.luxons.sevenwonders.game.effects.MilitaryReinforcements -import org.luxons.sevenwonders.game.effects.RawPointsIncrease - import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer import com.google.gson.JsonElement @@ -14,8 +7,13 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer +import org.luxons.sevenwonders.game.effects.Effect +import org.luxons.sevenwonders.game.effects.GoldIncrease +import org.luxons.sevenwonders.game.effects.MilitaryReinforcements +import org.luxons.sevenwonders.game.effects.RawPointsIncrease +import java.lang.reflect.Type -class NumericEffectSerializer : JsonSerializer, JsonDeserializer { +internal class NumericEffectSerializer : JsonSerializer, JsonDeserializer { override fun serialize(effect: Effect, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { val value: Int = when (effect) { diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializer.kt index 112c0adc..6412d6b5 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializer.kt @@ -11,7 +11,7 @@ import org.luxons.sevenwonders.game.effects.ProductionIncrease import org.luxons.sevenwonders.game.resources.Production import java.lang.reflect.Type -class ProductionIncreaseSerializer : JsonSerializer, JsonDeserializer { +internal class ProductionIncreaseSerializer : JsonSerializer, JsonDeserializer { override fun serialize( productionIncrease: ProductionIncrease, diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt index 781ee3af..06b46bb2 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt @@ -12,7 +12,7 @@ import org.luxons.sevenwonders.game.resources.ResourceType import org.luxons.sevenwonders.game.resources.Resources import java.lang.reflect.Type -class ProductionSerializer : JsonSerializer, JsonDeserializer { +internal class ProductionSerializer : JsonSerializer, JsonDeserializer { override fun serialize(production: Production, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { val fixedResources = production.fixedResources diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt index 74dee483..cff2b974 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt @@ -1,9 +1,5 @@ package org.luxons.sevenwonders.game.data.serializers -import java.lang.reflect.Type - -import org.luxons.sevenwonders.game.resources.ResourceType - import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer import com.google.gson.JsonElement @@ -11,8 +7,10 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer +import org.luxons.sevenwonders.game.resources.ResourceType +import java.lang.reflect.Type -class ResourceTypeSerializer : JsonSerializer, JsonDeserializer { +internal class ResourceTypeSerializer : JsonSerializer, JsonDeserializer { override fun serialize(type: ResourceType, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { return JsonPrimitive(type.symbol!!) diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt index 75fcabf0..b794f884 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt @@ -1,9 +1,5 @@ package org.luxons.sevenwonders.game.data.serializers -import java.lang.reflect.Type - -import org.luxons.sevenwonders.game.resources.ResourceType - import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer import com.google.gson.JsonElement @@ -11,8 +7,10 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer +import org.luxons.sevenwonders.game.resources.ResourceType +import java.lang.reflect.Type -class ResourceTypesSerializer : JsonSerializer>, JsonDeserializer> { +internal class ResourceTypesSerializer : JsonSerializer>, JsonDeserializer> { override fun serialize( resources: List, diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt index 0a60e4cf..c6c6a962 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt @@ -1,11 +1,5 @@ package org.luxons.sevenwonders.game.data.serializers -import java.lang.reflect.Type -import java.util.stream.Collectors - -import org.luxons.sevenwonders.game.resources.ResourceType -import org.luxons.sevenwonders.game.resources.Resources - import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer import com.google.gson.JsonElement @@ -14,8 +8,11 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer +import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.resources.Resources +import java.lang.reflect.Type -class ResourcesSerializer : JsonSerializer, JsonDeserializer { +internal class ResourcesSerializer : JsonSerializer, JsonDeserializer { override fun serialize(resources: Resources, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { val s = resources.asList().map { it.symbol }.joinToString("") -- cgit