You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
511 B
Kotlin
23 lines
511 B
Kotlin
package com.last.commit.map
|
|
|
|
import com.badlogic.gdx.math.Vector2
|
|
|
|
public data class Position(
|
|
public val pos: Vector2,
|
|
public val gridPos: Vector2,
|
|
) {
|
|
|
|
public val x: Float
|
|
get() = pos.x
|
|
|
|
public val y: Float
|
|
get() = pos.y
|
|
|
|
public val gridX: Int
|
|
get() = gridPos.x.toInt()
|
|
|
|
public val gridY: Int
|
|
get() = gridPos.y.toInt()
|
|
|
|
constructor(x: Float, y: Float, gridX: Int, gridY: Int): this(Vector2(x, y), Vector2(gridX.toFloat(), gridY.toFloat()))
|
|
} |