Skip to content

Commit e6f76a9

Browse files
committed
docs(sdk): document directions
1 parent aa10af5 commit e6f76a9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sdk/src/main/server-api/sc/api/plugins/Direction.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package sc.api.plugins
33
import com.thoughtworks.xstream.annotations.XStreamAlias
44
import kotlin.random.Random
55

6+
/** Directions for a field of squares.
7+
* Coordinates increment upwards. */
68
@XStreamAlias(value = "direction")
79
enum class Direction(val vector: Vector): IVector by vector {
810
UP(Vector(0, 1)),
@@ -23,6 +25,12 @@ enum class Direction(val vector: Vector): IVector by vector {
2325
get() = Vector(-vector.dx, -vector.dy)
2426
}
2527

28+
/**
29+
* Double-width Directions for a field made of hexagons.
30+
* https://www.redblobgames.com/grids/hexagons/#coordinates-doubled
31+
*
32+
* Coordinates increment downwards.
33+
*/
2634
enum class HexDirection(val vector: Vector): IVector by vector {
2735
RIGHT(Vector(+2, 0)),
2836
DOWN_RIGHT(Vector(+1, +1)),

0 commit comments

Comments
 (0)