gadget

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

gadget provides a skeleton implementation for gadgets and is basically a thin wrapper around target.Target and adds some helper functionalities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gadget

type Gadget struct {
	*target.Target

	OnKill          func()
	OnExpiry        func() // only called if gadget dies from expiry
	ThinkInterval   int    //should be > 0
	OnThinkInterval func()
	Duration        int //how long gadget should live for; use -1 for infinite
	// contains filtered or unexported fields
}

func New

func New(core *core.Core, p geometry.Point, r float64, typ combat.GadgetTyp) *Gadget

func (*Gadget) GadgetTyp

func (g *Gadget) GadgetTyp() combat.GadgetTyp

func (*Gadget) Kill

func (g *Gadget) Kill()

func (*Gadget) Src

func (g *Gadget) Src() int

func (*Gadget) Tick

func (g *Gadget) Tick()

func (*Gadget) Type

func (g *Gadget) Type() targets.TargettableType

Jump to

Keyboard shortcuts

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