engine

package
v0.0.0-...-bccbc35 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(value, min, max float64) float64

func FindChildrenWithComponent

func FindChildrenWithComponent(e *donburi.Entry, c component.IComponentType) []*donburi.Entry

func FindWithComponent

func FindWithComponent(w donburi.World, componentType component.IComponentType) (*donburi.Entry, bool)

func MustFindChildWithComponent

func MustFindChildWithComponent(parent *donburi.Entry, componentType component.IComponentType) *donburi.Entry

func MustFindComponent

func MustFindComponent[T any](w donburi.World, c Component[T]) *T

func MustFindWithComponent

func MustFindWithComponent(w donburi.World, componentType component.IComponentType) *donburi.Entry

func MustGetParent

func MustGetParent(entry *donburi.Entry) *donburi.Entry

func RandomFloatRange

func RandomFloatRange(min, max float64) float64

func RandomFrom

func RandomFrom[T comparable](list []T) T

func RandomFromOrEmpty

func RandomFromOrEmpty[T comparable](list []T) *T

func RandomIntRange

func RandomIntRange(min, max int) int

Types

type Component

type Component[T any] interface {
	donburi.IComponentType
	Get(entry *donburi.Entry) *T
}

type DurationRange

type DurationRange struct {
	Min time.Duration
	Max time.Duration
}

func (DurationRange) Random

func (r DurationRange) Random() time.Duration

type FloatRange

type FloatRange struct {
	Min float64
	Max float64
}

func (FloatRange) Random

func (r FloatRange) Random() float64

type IntRange

type IntRange struct {
	Min int
	Max int
}

func (IntRange) Random

func (r IntRange) Random() int

type Rect

type Rect struct {
	X      float64
	Y      float64
	Width  float64
	Height float64
}

func NewRect

func NewRect(x, y, width, height float64) Rect

func (Rect) Intersects

func (r Rect) Intersects(other Rect) bool

func (Rect) MaxX

func (r Rect) MaxX() float64

func (Rect) MaxY

func (r Rect) MaxY() float64

func (Rect) ToImageRectangle

func (r Rect) ToImageRectangle() image.Rectangle

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer(d time.Duration) *Timer

func (*Timer) IsReady

func (t *Timer) IsReady() bool

func (*Timer) PercentDone

func (t *Timer) PercentDone() float64

func (*Timer) Reset

func (t *Timer) Reset()

func (*Timer) Update

func (t *Timer) Update()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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