Update.kt

Branches > main > a68f328 > files / src / main / kotlin / net / bowmap / server / Update.kt

package net.bowmap.server

import net.bowmap.stormbow.*
import kotlinx.collections.immutable.*
import net.bowmap.handlers.*

fun update(fact: Fact): Effects = when(fact) {
  is PlayerSentChatMessage -> sendUpdatedChatMessage(fact)
  is PlayerBrokeBlock -> handleBlockBreak(fact)
  is PlayerDied -> handlePlayerDeath(fact)
  is PlayerKilledEntity -> handlePlayerKill(fact)
  is PlayerJoined -> handlePlayerJoin(fact)
  is PlayerQuit -> handlePlayerQuit(fact)
  is PlayerStartedFishing -> handlePlayerFishing(fact)
  is PlayerCaughtFish -> handlePlayerCatchingFish(fact)
  is ItemLostDurability -> handleItemLosingDurability(fact)
}