intelligence

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorIDTyp

type ActorIDTyp uuid.UUID

func (ActorIDTyp) MarshalJSON

func (a ActorIDTyp) MarshalJSON() ([]byte, error)

type CombatAction

type CombatAction interface {
	CloneForAllValidTargets(startingState combatState, memory *Memory) []CombatAction
	FinalState() combatState
	TimeToExecute() float64
	String() string
	Estimate(memory *Memory) float64
	Execute(msgSender MessageSender, intellect *Intellect) error
}

type Intellect

type Intellect struct {
	// contains filtered or unexported fields
}

func LoadIntellect

func LoadIntellect(brainType string, msgSender MessageSender, actorID uuid.UUID) *Intellect

func (*Intellect) BlockUntilStopped

func (i *Intellect) BlockUntilStopped()

func (*Intellect) ErrorChan

func (i *Intellect) ErrorChan() <-chan error

func (*Intellect) HandleMessage

func (i *Intellect) HandleMessage(msg wsapi.Message)

func (*Intellect) Start

func (i *Intellect) Start()

func (*Intellect) Stop

func (i *Intellect) Stop()

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

func NewMemory

func NewMemory(msgSender MessageSender, intellect *Intellect) *Memory

func (*Memory) AddActorToLocation

func (m *Memory) AddActorToLocation(zoneID, locID, actorID uuid.UUID)

func (*Memory) AddObjectToLocation

func (m *Memory) AddObjectToLocation(zoneID, locID, objectID uuid.UUID)

func (*Memory) AddObjectToObject

func (m *Memory) AddObjectToObject(objectID, toObjID uuid.UUID)

func (*Memory) ClearLocationInfo

func (m *Memory) ClearLocationInfo()

func (*Memory) GetActorInfo

func (m *Memory) GetActorInfo(actorID uuid.UUID) (commands.ActorVisibleInfo, error)

func (*Memory) GetCurrentZoneAndLocationID

func (m *Memory) GetCurrentZoneAndLocationID() (uuid.UUID, uuid.UUID)

func (*Memory) GetLastAttacker

func (m *Memory) GetLastAttacker() ActorIDTyp

func (*Memory) GetLocationInfo

func (m *Memory) GetLocationInfo(zoneID, locID uuid.UUID) (commands.LocationInfo, error)

func (*Memory) GetNumActorsInLocation

func (m *Memory) GetNumActorsInLocation(zoneID, locID uuid.UUID) float64

func (*Memory) GetObjectInfo

func (m *Memory) GetObjectInfo(objectID uuid.UUID) (commands.ObjectVisibleInfo, error)

func (*Memory) GetSecondsSinceLastAttacked

func (m *Memory) GetSecondsSinceLastAttacked() float64

func (*Memory) GetSecondsSinceLastMove

func (m *Memory) GetSecondsSinceLastMove() float64

func (*Memory) IsWeaponOnGround

func (m *Memory) IsWeaponOnGround() bool

func (*Memory) RemoveActorFromLocation

func (m *Memory) RemoveActorFromLocation(zoneID, locID, actorID uuid.UUID)

func (*Memory) RemoveObjectFromLocation

func (m *Memory) RemoveObjectFromLocation(zoneID, locID, objectID uuid.UUID)

func (*Memory) RemoveObjectFromObject

func (m *Memory) RemoveObjectFromObject(objectID, fromObjID uuid.UUID)

func (*Memory) SetActorInfo

func (m *Memory) SetActorInfo(info commands.ActorVisibleInfo)

func (*Memory) SetCurrentZoneAndLocationID

func (m *Memory) SetCurrentZoneAndLocationID(zoneID, locID uuid.UUID)

func (*Memory) SetLastAttackedTime

func (m *Memory) SetLastAttackedTime(t time.Time)

func (*Memory) SetLastAttacker

func (m *Memory) SetLastAttacker(attackerID ActorIDTyp)

func (*Memory) SetLastMovementTime

func (m *Memory) SetLastMovementTime(t time.Time)

func (*Memory) SetLocationInfo

func (m *Memory) SetLocationInfo(info commands.LocationInfo)

func (*Memory) SetObjectInfo

func (m *Memory) SetObjectInfo(info commands.ObjectVisibleInfo)

type MessageSender

type MessageSender interface {
	SendMessage(msg wsapi.Message) error
}

type UtilityConsideration

type UtilityConsideration struct {
	Name        string
	CurveXParam string
	XParamRange [2]float64
	CurveType   string // currently only linear
	// y = M * (x-C)^K + B
	// so for a linear / exponential curve:
	//   M = slope
	//   K = exponent
	//   B = y-intercept
	//   C = x-intercept
	M, K, B, C float64
}

type UtilitySelection

type UtilitySelection struct {
	Name           string
	Weight         float64
	Considerations []UtilityConsideration
}

type UtilitySelector

type UtilitySelector struct {
	Selections []UtilitySelection
}

Jump to

Keyboard shortcuts

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