diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2018-07-10 22:06:00 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2018-07-10 22:06:00 +0200 |
commit | 8ad3a1522a5709fc60c79edcdecd8b6e0bf53348 (patch) | |
tree | 22f12c8f7d0176f21c9e0cc9b7a7ad80c8a2629e /game-engine/src/main/kotlin/org | |
parent | Remove unnecessary properties from cards/wonders.json (diff) | |
download | seven-wonders-8ad3a1522a5709fc60c79edcdecd8b6e0bf53348.tar.gz seven-wonders-8ad3a1522a5709fc60c79edcdecd8b6e0bf53348.tar.bz2 seven-wonders-8ad3a1522a5709fc60c79edcdecd8b6e0bf53348.zip |
Clean class visibilities
Diffstat (limited to 'game-engine/src/main/kotlin/org')
8 files changed, 20 insertions, 29 deletions
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<WonderSide, WonderSideDefinition> ) { 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<Effect>, JsonDeserializer<Effect> { +internal class NumericEffectSerializer : JsonSerializer<Effect>, JsonDeserializer<Effect> { 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<ProductionIncrease>, JsonDeserializer<ProductionIncrease> { +internal class ProductionIncreaseSerializer : JsonSerializer<ProductionIncrease>, JsonDeserializer<ProductionIncrease> { 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<Production>, JsonDeserializer<Production> { +internal class ProductionSerializer : JsonSerializer<Production>, JsonDeserializer<Production> { 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<ResourceType>, JsonDeserializer<ResourceType> { +internal class ResourceTypeSerializer : JsonSerializer<ResourceType>, JsonDeserializer<ResourceType> { 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<List<ResourceType>>, JsonDeserializer<List<ResourceType>> { +internal class ResourceTypesSerializer : JsonSerializer<List<ResourceType>>, JsonDeserializer<List<ResourceType>> { override fun serialize( resources: List<ResourceType>, 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<Resources>, JsonDeserializer<Resources> { +internal class ResourcesSerializer : JsonSerializer<Resources>, JsonDeserializer<Resources> { override fun serialize(resources: Resources, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { val s = resources.asList().map { it.symbol }.joinToString("") |