spawnreap

package
v0.0.0-...-8d7dea8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFile  = "spawnsCfg.yaml"
	DefaultTickLengthS = 5
	DefaultReapTicks   = 60 // 5 minutes @ 5-second ticks
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorPrototype

type ActorPrototype struct {
	Name                 string
	BrainType            string
	Attributes           core.AttributeSet
	Skills               core.Skillset
	InventoryConstraints core.ActorInventoryConstraints
}

func (ActorPrototype) ToActor

func (ap ActorPrototype) ToActor(loc *core.Location) *core.Actor

type Service

type Service struct {
	World    *core.World
	BrainSvc *brain.Service
	// How often, in seconds, to check for objects that need reaping, and
	// actors that need spawning
	TickLengthS int
	// How many ticks to leave an object in-place before reaping it
	ReapTicks int
	// Full path to config file for Actor spawns
	ConfigFile string
	// contains filtered or unexported fields
}

func (*Service) GetSpawnConfigForZone

func (s *Service) GetSpawnConfigForZone(zone *core.Zone) []SpawnSpecification

func (*Service) PutSpawnConfigForZone

func (s *Service) PutSpawnConfigForZone(specList []SpawnSpecification, zone *core.Zone) error

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop()

type SpawnSpecification

type SpawnSpecification struct {
	ActorProto         ActorPrototype
	MaxCount           int
	MaxSpawnAtOneTime  int
	SpawnChancePerTick float64
}

Jump to

Keyboard shortcuts

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