ints

package
v0.0.0-...-e95280a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Create() Builder
	WithPosition(pos Vec2) Builder
	WithDimension(dim Vec2) Builder
	Now() (Rectangle, error)
}

Builder represents a rectangle builder

func NewBuilder

func NewBuilder() Builder

NewBuilder creates a new builder instance

type Rectangle

type Rectangle interface {
	Position() Vec2
	Dimension() Vec2
	String() string
}

Rectangle represents a rectangle of integers

type Vec2

type Vec2 [2]int

Vec2 represents a vector with 2 elements

func (*Vec2) Compare

func (obj *Vec2) Compare(input Vec2) bool

Compare returns true if the two vectors are the same, false otehrwise

func (Vec2) String

func (obj Vec2) String() string

String returns the string representation of the vector

func (Vec2) X

func (obj Vec2) X() int

X returns the value at index 0

func (Vec2) Y

func (obj Vec2) Y() int

Y returns the value at index 1

Jump to

Keyboard shortcuts

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