position

package
v0.0.0-...-48e53a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position int
const (
	TOP_LEFT   Position = 1 // 1 + 0 + 3(0)
	TOP_CENTER Position = 2 // 1 + 1 + 3(0)
	TOP_RIGHT  Position = 3 // 1 + 2 + 3(0)

	MIDDLE_LEFT   Position = 4 // 1 + 0 + 3(1)
	MIDDLE_CENTER Position = 5 // 1 + 1 + 3(1)
	MIDDLE_RIGHT  Position = 6 // 1 + 2 + 3(1)

	BOTTOM_LEFT   Position = 7 // 1 + 0 + 3(2)
	BOTTOM_CENTER Position = 8 // 1 + 1 + 3(2)
	BOTTOM_RIGHT  Position = 9 // 1 + 2 + 3(2)

	INVALID Position = 0
)
Les nombres sont attribués selon la formule: 1 + x + 3y
* [1][2][3]
* [4][5][6]
* [7][8][9]

noinspection GoUnusedConst,GoSnakeCaseUsage

func PositionAt

func PositionAt(x int, y int) Position

func (Position) Down

func (p Position) Down(i int) Position

func (Position) DownLeft

func (p Position) DownLeft(i int) Position

func (Position) DownRight

func (p Position) DownRight(i int) Position

func (Position) GetXY

func (p Position) GetXY() (int, int)

func (Position) GetXYFloat

func (p Position) GetXYFloat() (float64, float64)

func (Position) Left

func (p Position) Left(i int) Position

func (Position) Opposite

func (p Position) Opposite() Position

func (Position) Right

func (p Position) Right(i int) Position

func (Position) Up

func (p Position) Up(i int) Position

func (Position) UpLeft

func (p Position) UpLeft(i int) Position

func (Position) UpRight

func (p Position) UpRight(i int) Position

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL