traits

package
v0.0.0-...-7483609 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package traits base.go Defines interfaces that define traits.

Package traits notify.go Defines interfaces that define traits that get notified.

Package traits render.go Defines interfaces that define traits that are used for rendering.

Package traits worldmap.go Defines interfaces that define traits that are used for worldmap interaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MoveNotifier

type MoveNotifier interface {
	munfall.Trait
	NotifyMove(old, new *munfall.WPos)
}

MoveNotifier is called when an Actor is moved on the map.

type OccupySpace

type OccupySpace interface {
	munfall.Trait
	Intersects(OccupySpace, *munfall.WPos) bool
	Space() []munfall.Space
	OutOfBounds(*munfall.WPos) bool
}

OccupySpace defines a trait that occupies space and should collide with other actors that have an OccupySpace trait.

type SpaceCell

type SpaceCell struct {
	LocalOffset *munfall.WPos
	// contains filtered or unexported fields
}

SpaceCell defines a Space that is a full cell.

func (*SpaceCell) Initialize

func (s *SpaceCell) Initialize(trait munfall.Trait)

Initialize called when this space is created.

func (*SpaceCell) Intersects

func (s *SpaceCell) Intersects(other munfall.Space, offset *munfall.WPos) bool

Intersects returns if the two spaces intersect.

func (*SpaceCell) Offset

func (s *SpaceCell) Offset() *munfall.WPos

Offset returns the centered offset of this space relative to the actor position.

func (*SpaceCell) Trait

func (s *SpaceCell) Trait() munfall.Trait

Trait returns the trait the owns this Space

type TraitAddedToWorldNotifier

type TraitAddedToWorldNotifier interface {
	munfall.Trait
	NotifyAddedToWorld()
}

TraitAddedToWorldNotifier is a trait that gets notified when it is added to the world.

type TraitOrderResolver

type TraitOrderResolver interface {
	munfall.Trait
	ResolveOrder(order *munfall.Order)
}

TraitOrderResolver used by traits to resolve orders sent by an order generator.

type TraitRemovedFromWorldNotifier

type TraitRemovedFromWorldNotifier interface {
	munfall.Trait
	NotifyRemovedFromWorld()
}

TraitRemovedFromWorldNotifier is a trait that gets notified when it is removed from the world.

type TraitRender2D

type TraitRender2D interface {
	munfall.Trait
	Render2D() []munfall.Renderable
}

TraitRender2D called by TraitRenderManager to get renderables for rendering (2D implementation).

type TraitTicker

type TraitTicker interface {
	munfall.Trait
	Tick(deltaUnit float32)
}

TraitTicker is a trait that gets called every time the world ticks.

Jump to

Keyboard shortcuts

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