package ru.dbotthepony.kstarbound.defs.actor.player

import com.google.common.collect.ImmutableList
import com.google.common.collect.ImmutableMap
import com.google.common.collect.ImmutableSet
import com.google.gson.JsonObject
import ru.dbotthepony.kommons.math.RGBAColor
import ru.dbotthepony.kommons.util.AABB
import ru.dbotthepony.kommons.vector.Vector2d
import ru.dbotthepony.kstarbound.Registry
import ru.dbotthepony.kstarbound.defs.ActorMovementParameters
import ru.dbotthepony.kstarbound.defs.AssetReference
import ru.dbotthepony.kstarbound.defs.Species
import ru.dbotthepony.kstarbound.defs.actor.StatusControllerConfig
import ru.dbotthepony.kstarbound.util.SBPattern
import ru.dbotthepony.kstarbound.defs.animation.AnimationDefinition
import ru.dbotthepony.kstarbound.defs.item.ItemDescriptor
import ru.dbotthepony.kstarbound.json.builder.JsonFactory

@JsonFactory
data class PlayerConfig(
	val defaultHumanoidIdentity: JsonObject,
	val blueprintUnlock: SBPattern,
	val blueprintAlreadyKnown: SBPattern,
	val collectableUnlock: SBPattern,

	val species: ImmutableSet<Registry.Ref<Species>>,
	val nametagColor: RGBAColor,
	val ageItemsEvery: Int,
	val defaultItems: ImmutableSet<ItemDescriptor>,

	val defaultBlueprints: BlueprintLearnList,

	val defaultCodexes: ImmutableMap<String, ImmutableList<ItemDescriptor>>,
	val metaBoundBox: AABB,
	val movementParameters: ActorMovementParameters,
	val zeroGMovementParameters: ActorMovementParameters,

	val statusControllerSettings: StatusControllerConfig,

	val foodLowThreshold: Double,
	val foodLowStatusEffects: ImmutableList<String> = ImmutableList.of(),
	val foodEmptyStatusEffects: ImmutableList<String> = ImmutableList.of(),
	val inCinematicStatusEffects: ImmutableList<String> = ImmutableList.of(),

	val footstepTiming: Double,
	val footstepSensor: Vector2d,

	val vaporTrailTime: Double,
	val terminalVelocityDifference: Double,

	val initialBeamGunRadius: Double,
	val previewGlowBorder: Double,
	val objectPreviewInnerAlpha: Double,
	val objectPreviewOuterAlpha: Double,

	val beamGunConfig: MatterManipulatorConfig,

	val underwaterSensor: Vector2d = Vector2d(0.0, 0.0),
	val underwaterMinWaterLevel: Double,

	val splashConfig: SplashConfig,

	val effectsAnimator: AssetReference<AnimationDefinition>,

	val teleportInTime: Double,
	val teleportOutTime: Double,
	val deployInTime: Double,
	val deployOutTime: Double,

	val teleportInStatusEffects: ImmutableList<String>,

	val companionsConfig: CompanionsConfig,
	val deploymentConfig: DeploymentConfig,

	val genericScriptContexts: ImmutableMap<String, String>,
	val inventory: InventoryConfig,
	val inventoryFilters: ImmutableMap<String, BagFilterConfig>,
)