Main.kt

Branches > main > bfb8108 > files / src / main / kotlin / net / bowmap / server / Main.kt

package net.bowmap.server

import net.bowmap.stormbow.*
import net.bowmap.server.fact.*
import net.bowmap.handlers.*

// TODO call setup() from an onEnable fact
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)
}