utils

package
v0.0.0-...-955a4b2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DogImgScale     = 0.1
	BorderImgScale  = 0.1
	BorderLineWidth = 3

	Fps = 60

	MaxScale  = 100
	MinScale  = 0.01
	ScaleDiff = 0.25
)

Variables

View Source
var ConvertDistanceTypeToString = map[config.DistanceType]string{
	config.Euclidean:   "Euclidean",
	config.Manhattan:   "Manhattan",
	config.Curvilinear: "Curvilinear",
}
View Source
var ConvertGeometryTypeToString = map[config.GeometryType]string{
	config.Simple: "Simple",
	config.Vector: "Vector",
}
View Source
var ConvertStringToDistanceType = map[string]config.DistanceType{
	"Euclidean":   config.Euclidean,
	"Manhattan":   config.Manhattan,
	"Curvilinear": config.Curvilinear,
}
View Source
var ConvertStringToGeometryType = map[string]config.GeometryType{
	"Simple": config.Simple,
	"Vector": config.Vector,
}

Functions

func NewBackground

func NewBackground(appConfig *config.ApplicationConfig) *ebiten.Image

func SaveError

func SaveError(buff, err error) error

func WithTicker

func WithTicker(ctx context.Context, ticker <-chan time.Time, action func())

Types

type Cursor

type Cursor struct {
	StartX, StartY int
	EndX, EndY     int
	Pressed        bool
}

func NewCursor

func NewCursor() Cursor

func (*Cursor) Reset

func (c *Cursor) Reset()

type Line

type Line struct {
	StartX, StartY, EndX, EndY float64
}

func NewLine

func NewLine(WindowX, WindowY, startX, startY, endX, endY int) Line

type Status

type Status int
const (
	Fight Status = iota
	Hiss
	Run
)

Jump to

Keyboard shortcuts

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