target

package
v1.0.79 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayTarget

type DelayTarget struct {
	World  *engine.World
	Entity *engine.Entity

	DelayFrames int

	Events []delayEvent

	Target     mixins.TargetSelection
	Originator *engine.Entity
}

DelayTarget delays all state changes by the given amount.

func (*DelayTarget) Despawn

func (d *DelayTarget) Despawn()

func (*DelayTarget) SetState

func (d *DelayTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*DelayTarget) Spawn

func (d *DelayTarget) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*DelayTarget) Touch

func (d *DelayTarget) Touch(other *engine.Entity)

func (*DelayTarget) Update

func (d *DelayTarget) Update()

type LogicalGate

type LogicalGate struct {
	World  *engine.World
	Entity *engine.Entity

	Target        mixins.TargetSelection
	Invert        bool
	CountRequired int
	IgnoreOff     bool

	IncomingState map[engine.EntityIncarnation]struct{}
	State         bool
	Originator    *engine.Entity
}

LogicalGate sends a signal along if ANY incoming target triggers.

func (*LogicalGate) Despawn

func (g *LogicalGate) Despawn()

func (*LogicalGate) MaybeSendEvent

func (g *LogicalGate) MaybeSendEvent(sendEveryFrame bool)

func (*LogicalGate) SetState

func (g *LogicalGate) SetState(originator, predecessor *engine.Entity, state bool)

func (*LogicalGate) Spawn

func (g *LogicalGate) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*LogicalGate) Touch

func (g *LogicalGate) Touch(other *engine.Entity)

func (*LogicalGate) Update

func (g *LogicalGate) Update()

type PrintToConsoleTarget

type PrintToConsoleTarget struct {
	World *engine.World

	Text string

	PrintFrames int
	PrevText    string
}

PrintToConsoleTarget prints the given text to console when activated. Setting state to ON saves the current text, setting state to OFF dumps it.

func (*PrintToConsoleTarget) Despawn

func (p *PrintToConsoleTarget) Despawn()

func (*PrintToConsoleTarget) SetState

func (p *PrintToConsoleTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*PrintToConsoleTarget) Spawn

func (*PrintToConsoleTarget) Touch

func (p *PrintToConsoleTarget) Touch(other *engine.Entity)

func (*PrintToConsoleTarget) Update

func (p *PrintToConsoleTarget) Update()

type SequenceCollector

type SequenceCollector struct {
	World  *engine.World
	Entity *engine.Entity

	Sequence string
	Target   mixins.TargetSelection
	State    bool

	Current string
}

SequenceCollector waits for receiving strings, and sends a trigger event when the correct string was received.

func (*SequenceCollector) Append

func (s *SequenceCollector) Append(originator *engine.Entity, str string)

func (*SequenceCollector) Despawn

func (s *SequenceCollector) Despawn()

func (*SequenceCollector) Spawn

func (*SequenceCollector) Touch

func (s *SequenceCollector) Touch(other *engine.Entity)

func (*SequenceCollector) Update

func (s *SequenceCollector) Update()

type SequenceTarget

type SequenceTarget struct {
	World  *engine.World
	Entity *engine.Entity

	Target   string
	Sequence string

	State bool
}

SequenceTarget sends a given string to a SequenceCollector when triggered.

func (*SequenceTarget) Despawn

func (s *SequenceTarget) Despawn()

func (*SequenceTarget) SetState

func (s *SequenceTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*SequenceTarget) Spawn

func (s *SequenceTarget) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*SequenceTarget) Touch

func (s *SequenceTarget) Touch(other *engine.Entity)

func (*SequenceTarget) Update

func (s *SequenceTarget) Update()

type SetStateTarget

type SetStateTarget struct {
	World  *engine.World
	Entity *engine.Entity

	Target mixins.TargetSelection
	State  bool
}

SetStateTarget overrides the boolean state of a warpzone or entity.

func (*SetStateTarget) Despawn

func (s *SetStateTarget) Despawn()

func (*SetStateTarget) SetState

func (s *SetStateTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*SetStateTarget) Spawn

func (s *SetStateTarget) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*SetStateTarget) Touch

func (s *SetStateTarget) Touch(other *engine.Entity)

func (*SetStateTarget) Update

func (s *SetStateTarget) Update()

type SoundTarget

type SoundTarget struct {
	World  *engine.World
	Entity *engine.Entity

	Sound  *sound.Sound
	Player *audiowrap.Player

	Target      mixins.TargetSelection
	StopWhenOff bool
	State       bool
	Originator  *engine.Entity

	Active bool
	Frames int
	Frame  int
}

SoundTarget just changes the music track to the given one.

func (*SoundTarget) Despawn

func (s *SoundTarget) Despawn()

func (*SoundTarget) SetState

func (s *SoundTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*SoundTarget) Spawn

func (s *SoundTarget) Spawn(w *engine.World, sp *level.Spawnable, e *engine.Entity) error

func (*SoundTarget) Touch

func (s *SoundTarget) Touch(other *engine.Entity)

func (*SoundTarget) Update

func (s *SoundTarget) Update()

type SwitchMusicTarget

type SwitchMusicTarget struct {
	Music string
}

SwitchMusicTarget just changes the music track to the given one.

func (*SwitchMusicTarget) Despawn

func (s *SwitchMusicTarget) Despawn()

func (*SwitchMusicTarget) SetState

func (s *SwitchMusicTarget) SetState(originator, predecessor *engine.Entity, state bool)

func (*SwitchMusicTarget) Spawn

func (*SwitchMusicTarget) Touch

func (s *SwitchMusicTarget) Touch(other *engine.Entity)

func (*SwitchMusicTarget) Update

func (s *SwitchMusicTarget) Update()

Jump to

Keyboard shortcuts

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