Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticKoko committed Nov 17, 2024
1 parent 926ea14 commit 6438298
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,6 @@ open class HybridAquaticCritterEntity(

@Suppress("UNUSED")
data class VariantCollisionRules(val variants : Set<String>, val collisionHandler: (Set<String>, Random, ServerWorldAccess) -> String, val exclusionStatus: ExclusionStatus = INCLUSIVE) {

/**
* INCLUSIVE - all other variants can exist within this selection swath
* <pre> </pre>
* EXCLUSIVE - all other variants are excluded from this selection swath
*/
enum class ExclusionStatus {
INCLUSIVE,
EXCLUSIVE
Expand All @@ -364,7 +358,6 @@ open class HybridAquaticCritterEntity(

fun weightedDistribution(weights: Set<Pair<String, Double>>, status: ExclusionStatus = EXCLUSIVE) : VariantCollisionRules {
return VariantCollisionRules(weights.map { pair -> pair.first }.toSet(), { _, random, _ ->
// sum up weights
val weightTotal = weights.sumOf { pair -> pair.second }
val randomVal = random.nextFloat() * weightTotal
var accumulatedWeight = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class NudibranchEntity(entityType: EntityType<out NudibranchEntity>, world: Worl
}
return PlayState.CONTINUE
}

override fun getMaxSize() : Int {
return 5
}
Expand Down

0 comments on commit 6438298

Please sign in to comment.