goi

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetComponent

func GetComponent[T any](gameObject any) (bool, T)

Returns a component of the given type. Keep in mind that this function returns first component found. Game object can have multiple components of the same type. Use GetComponents() if you want to get all components of this type.

func GetComponents

func GetComponents[T any](gameObject any) []T

Unlike GetComponent(), this function returns all found components of this type. Returns an empty slice if there are no components found.

func HasComponent

func HasComponent[T any](gameObject any) bool

Lets you know if a game object contains this component type. Returns false if potential game object not implemented WithComponents interface or does not contain this component type.

Types

type Awakable

type Awakable interface {
	Awake() error
}

type Destroyable

type Destroyable interface {
	Destroy() error
}

type DrawableDebug

type DrawableDebug interface {
	DrawDebug(gameBase interfaces.IGameBase, screen *ebiten.Image)
	DrawDebugPriority() float64
}

type DrawableQueued

type DrawableQueued interface {
	Draw(gameBase interfaces.IGameBase, screen *ebiten.Image)
	DrawPriority() float64
}

type DrawableUIQueued

type DrawableUIQueued interface {
	DrawUI(gameBase interfaces.IGameBase, screen *ebiten.Image)
	DrawUIPriority() float64
}

type ExcludeAwakable

type ExcludeAwakable interface {
	ExcludeAwakable()
}

type ExcludeDestroyable

type ExcludeDestroyable interface {
	ExcludeDestroyable()
}

type ExcludeDrawable

type ExcludeDrawable interface {
	ExcludeDrawable()
}

type ExcludeDrawableUI

type ExcludeDrawableUI interface {
	ExcludeDrawableUI()
}

type ExcludePhys2Updatable

type ExcludePhys2Updatable interface {
	ExcludePhys2Updatable()
}

type ExcludePhysUpdatable

type ExcludePhysUpdatable interface {
	ExcludePhysUpdatable()
}

type ExcludeStartable

type ExcludeStartable interface {
	ExcludeStartable()
}

type ExcludeUpdatable

type ExcludeUpdatable interface {
	ExcludeUpdatable()
}

type IComponent

type IComponent interface {
	GetID() string
}

type Phys2Updatable

type Phys2Updatable interface {
	Phys2Update(gameBase interfaces.IGameBase) error
}

type PhysUpdatable

type PhysUpdatable interface {
	PhysUpdate(gameBase interfaces.IGameBase) error
}

type Startable

type Startable interface {
	Start(gameBase interfaces.IGameBase) error
	StartPriority() float64
}

type StartableDebug

type StartableDebug interface {
	StartDebug(gameBase interfaces.IGameBase) error
	StartDebugPriority() float64
}

type Updatable

type Updatable interface {
	Update(gameBase interfaces.IGameBase) error
}

type UpdatableDebug

type UpdatableDebug interface {
	UpdateDebug(gameBase interfaces.IGameBase) error
}

type WithComponents

type WithComponents interface {
	WithComponents() []IComponent
}

Jump to

Keyboard shortcuts

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