Documentation ¶
Index ¶
- func GetComponent[T any](gameObject any) (bool, T)
- func GetComponents[T any](gameObject any) []T
- func HasComponent[T any](gameObject any) bool
- type Awakable
- type Destroyable
- type DrawableDebug
- type DrawableQueued
- type DrawableUIQueued
- type ExcludeAwakable
- type ExcludeDestroyable
- type ExcludeDrawable
- type ExcludeDrawableUI
- type ExcludePhys2Updatable
- type ExcludePhysUpdatable
- type ExcludeStartable
- type ExcludeUpdatable
- type IComponent
- type Phys2Updatable
- type PhysUpdatable
- type Startable
- type StartableDebug
- type Updatable
- type UpdatableDebug
- type WithComponents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetComponent ¶
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 ¶
Unlike GetComponent(), this function returns all found components of this type. Returns an empty slice if there are no components found.
func HasComponent ¶
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 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
}
Click to show internal directories.
Click to hide internal directories.