Files
2009scape/Server/src/main/core/api/MapArea.kt
T
Ceikry 88a2f354b4 Added support for varying log levels configurable in the server config (see log_level in default.conf)
Error logs now properly print to stderr when possible
Colour-coded logs
Addressed a scenario in which outgoing packet writes could get hung up
Fixed interface incorrect definition message on server startup
2023-03-01 08:01:14 +00:00

33 lines
1.0 KiB
Kotlin

package core.api
import core.game.node.entity.Entity
import core.game.world.map.Location
import core.game.world.map.zone.MapZone
import core.game.world.map.zone.RegionZone
import core.game.world.map.zone.ZoneBorders
import core.game.world.map.zone.ZoneRestriction
/**
* Interface that allows a class to define a map area.
* Optionally-overridable methods include [getRestrictions], [areaEnter], [areaLeave] and [entityStep]
*/
interface MapArea : ContentInterface {
var zone: MapZone
get(){
return zoneMaps[this::class.java.simpleName + "MapArea"]!!
}
set(value) {
zoneMaps[this::class.java.simpleName + "MapArea"] = value
}
fun defineAreaBorders() : Array<ZoneBorders>
fun getRestrictions() : Array<ZoneRestriction> {return arrayOf()}
fun areaEnter(entity: Entity) {}
fun areaLeave(entity: Entity, logout: Boolean) {}
fun entityStep(entity: Entity, location: Location, lastLocation: Location) {}
companion object {
val zoneMaps = HashMap<String, MapZone>()
}
}