88a2f354b4
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
33 lines
1.0 KiB
Kotlin
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>()
|
|
}
|
|
}
|