code tidy up
This commit is contained in:
parent
e32e2a0311
commit
e3954c184a
2 changed files with 15 additions and 8 deletions
|
|
@ -15,6 +15,7 @@ description = """
|
|||
|
||||
val projectId: String by project.extra
|
||||
|
||||
val kafkaStateDir = layout.projectDirectory.dir("kafka-state")
|
||||
|
||||
dependencies {
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ tasks.withType<KotlinCompile> {
|
|||
val kafkaStateDirDelete by tasks.registering(Delete::class) {
|
||||
group = project.name
|
||||
mustRunAfter(kafkaConsumersDelete)
|
||||
delete(layout.projectDirectory.dir("kafka-state"))
|
||||
delete(kafkaStateDir)
|
||||
}
|
||||
|
||||
val kafkaConsumersDelete by tasks.registering(KafkaConsumerGroupsTask.DeleteAll::class) {
|
||||
|
|
@ -76,3 +77,9 @@ val kafkaConsumersDelete by tasks.registering(KafkaConsumerGroupsTask.DeleteAll:
|
|||
//tasks.run.configure {
|
||||
// dependsOn(kafkatorioEventsServerKafkaForceReset)
|
||||
//}
|
||||
|
||||
idea {
|
||||
module {
|
||||
excludeDirs = excludeDirs + kafkaStateDir.asFile
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,21 +16,21 @@ value class FactorioServerId(val id: String) {
|
|||
enum class ChunkSize(
|
||||
val zoomLevel: Int,
|
||||
) : Comparable<ChunkSize> {
|
||||
CHUNK_512(-1), // 512
|
||||
CHUNK_256(0), // 256
|
||||
CHUNK_128(1), // 128
|
||||
CHUNK_064(2), // 64
|
||||
CHUNK_032(3), // 32
|
||||
CHUNK_512(-1),
|
||||
CHUNK_256(0),
|
||||
CHUNK_128(1),
|
||||
CHUNK_064(2),
|
||||
CHUNK_032(3),
|
||||
;
|
||||
|
||||
val tilesPerChunk: Int = 2f.pow(8 - zoomLevel).roundToInt()
|
||||
|
||||
init {
|
||||
require(tilesPerChunk > 0) { "chunkSize must be positive" }
|
||||
require(tilesPerChunk > 0) { "tilesPerChunk $tilesPerChunk must be positive" }
|
||||
// 1000 & 0111 = 0000 => pow^2
|
||||
// 1001 & 1000 = 1000 => !pow^2
|
||||
require(tilesPerChunk and (tilesPerChunk - 1) == 0) {
|
||||
"tilesPerChunk must be a power-of-two number"
|
||||
"tilesPerChunk $tilesPerChunk must be a power-of-two number"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue