package ru.dbotthepony.kstarbound.defs.dungeon

import ru.dbotthepony.kommons.vector.Vector2i
import ru.dbotthepony.kstarbound.json.builder.IStringSerializable

enum class DungeonDirection(override val jsonName: String, val positionAdjustment: Vector2i) : IStringSerializable {
	LEFT("left", Vector2i.NEGATIVE_X) {
		override val opposite: DungeonDirection
			get() = RIGHT
	},
	RIGHT("right", Vector2i.POSITIVE_X) {
		override val opposite: DungeonDirection
			get() = LEFT
	},
	UP("up", Vector2i.POSITIVE_Y) {
		override val opposite: DungeonDirection
			get() = DOWN
	},
	DOWN("down", Vector2i.NEGATIVE_Y) {
		override val opposite: DungeonDirection
			get() = UP
	},
	UNKNOWN("unknown", Vector2i.ZERO) {
		override val opposite: DungeonDirection
			get() = throw NoSuchElementException()
	},
	ANY("any", Vector2i.ZERO) {
		override val opposite: DungeonDirection
			get() = this
	};

	abstract val opposite: DungeonDirection
}
