events

package
Version: v0.0.0-...-5062497 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventDispatcher

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

func NewEventDispatcher

func NewEventDispatcher() *EventDispatcher

func (*EventDispatcher) FireObjectDestroyed

func (dispatcher *EventDispatcher) FireObjectDestroyed(event *ObjectDestroyed)

func (*EventDispatcher) FirePhysicsReady

func (dispatcher *EventDispatcher) FirePhysicsReady(event *PhysicsReady)

func (*EventDispatcher) FireProjectileFired

func (dispatcher *EventDispatcher) FireProjectileFired(event *ProjectileFired)

func (*EventDispatcher) FireProjectileHit

func (dispatcher *EventDispatcher) FireProjectileHit(event *ProjectileHit)

func (*EventDispatcher) FireScoreSent

func (dispatcher *EventDispatcher) FireScoreSent(event *ScoreSent)

func (*EventDispatcher) FireTargetAngle

func (dispatcher *EventDispatcher) FireTargetAngle(event *TargetAngle)

func (*EventDispatcher) FireTimeTick

func (dispatcher *EventDispatcher) FireTimeTick(event *TimeTick)

func (*EventDispatcher) FireUserConnected

func (dispatcher *EventDispatcher) FireUserConnected(event *UserConnected)

func (*EventDispatcher) FireUserInput

func (dispatcher *EventDispatcher) FireUserInput(event *UserInput)

func (*EventDispatcher) FireUserJoined

func (dispatcher *EventDispatcher) FireUserJoined(event *UserJoined)

func (*EventDispatcher) FireUserLeft

func (dispatcher *EventDispatcher) FireUserLeft(event *UserLeft)

func (*EventDispatcher) QueuesFilling

func (dispatcher *EventDispatcher) QueuesFilling() map[int]QueueFilling

func (*EventDispatcher) RegisterObjectDestroyedListener

func (dispatcher *EventDispatcher) RegisterObjectDestroyedListener(listener ObjectDestroyedListener)

func (*EventDispatcher) RegisterPhysicsReadyListener

func (dispatcher *EventDispatcher) RegisterPhysicsReadyListener(listener PhysicsReadyListener)

func (*EventDispatcher) RegisterProjectileFiredListener

func (dispatcher *EventDispatcher) RegisterProjectileFiredListener(listener ProjectileFiredListener)

func (*EventDispatcher) RegisterProjectileHitListener

func (dispatcher *EventDispatcher) RegisterProjectileHitListener(listener ProjectileHitListener)

func (*EventDispatcher) RegisterScoreSentListener

func (dispatcher *EventDispatcher) RegisterScoreSentListener(listener ScoreSentListener)

func (*EventDispatcher) RegisterTargetAngleListener

func (dispatcher *EventDispatcher) RegisterTargetAngleListener(listener TargetAngleListener)

func (*EventDispatcher) RegisterTimeTickListener

func (dispatcher *EventDispatcher) RegisterTimeTickListener(listener TimeTickListener)

func (*EventDispatcher) RegisterUserConnectedListener

func (dispatcher *EventDispatcher) RegisterUserConnectedListener(listener UserConnectedListener)

func (*EventDispatcher) RegisterUserInputListener

func (dispatcher *EventDispatcher) RegisterUserInputListener(listener UserInputListener)

func (*EventDispatcher) RegisterUserJoinedListener

func (dispatcher *EventDispatcher) RegisterUserJoinedListener(listener UserJoinedListener)

func (*EventDispatcher) RegisterUserLeftListener

func (dispatcher *EventDispatcher) RegisterUserLeftListener(listener UserLeftListener)

func (*EventDispatcher) RunEventLoop

func (dispatcher *EventDispatcher) RunEventLoop()

type ObjectDestroyed

type ObjectDestroyed struct {
	//Id uint32
	DestroyedObject state.Object
	DestroyedBy     state.Object
	//DestroyedBy uint32
	//ShotSpaceship *state.Spaceship
	Timestamp time.Time
}

type ObjectDestroyedListener

type ObjectDestroyedListener interface {
	HandleObjectDestroyed(*ObjectDestroyed)
}

type PhysicsReady

type PhysicsReady struct {
}

type PhysicsReadyListener

type PhysicsReadyListener interface {
	HandlePhysicsReady(*PhysicsReady)
}

type ProjectileFired

type ProjectileFired struct {
	Projectile *state.Projectile
}

type ProjectileFiredListener

type ProjectileFiredListener interface {
	HandleProjectileFired(*ProjectileFired)
}

type ProjectileHit

type ProjectileHit struct {
	Projectile *state.Projectile
}

type ProjectileHitListener

type ProjectileHitListener interface {
	HandleProjectileHit(*ProjectileHit)
}

type QueueFilling

type QueueFilling struct {
	CurrentLength int
	Capacity      int
}

type ScoreSent

type ScoreSent struct {
	Score uint32
}

type ScoreSentListener

type ScoreSentListener interface {
	HandleScoreSent(*ScoreSent)
}

type TargetAngle

type TargetAngle struct {
	ClientID uint32
	Angle    float64
}

TargetAngle struct describes client's spaceship angle steering input.

func NewTargetAngle

func NewTargetAngle(clientID uint32) *TargetAngle

NewTargetAngle returns new instance of TargetAngle.

func TargetAngleFromProto

func TargetAngleFromProto(targetAngle *pb.TargetAngle, clientID uint32) *TargetAngle

TargetAngleFromProto returns new instance of TargetAngle basing on proto object.

type TargetAngleListener

type TargetAngleListener interface {
	HandleTargetAngle(*TargetAngle)
}

type TimeTick

type TimeTick struct {
	FrameId uint32
}

type TimeTickListener

type TimeTickListener interface {
	HandleTimeTick(*TimeTick)
}

type UserConnected

type UserConnected struct {
	ClientID uint32
}

type UserConnectedListener

type UserConnectedListener interface {
	HandleUserConnected(*UserConnected)
}

type UserInput

type UserInput struct {
	ClientID  uint32
	UserInput pb.UserInput
}

UserInput struct describes client's spaceship input.

func NewUserInput

func NewUserInput(clientID uint32) *UserInput

NewUserInput returns new instance of UserInput

func UserInputFromProto

func UserInputFromProto(userAction *pb.UserAction, clientID uint32) *UserInput

UserInputFromProto returns new instance of UserInput basing on proto object.

type UserInputListener

type UserInputListener interface {
	HandleUserInput(*UserInput)
}

type UserJoined

type UserJoined struct {
	ClientID uint32
	UserName string
}

type UserJoinedListener

type UserJoinedListener interface {
	HandleUserJoined(*UserJoined)
}

type UserLeft

type UserLeft struct {
	ClientID uint32
}

type UserLeftListener

type UserLeftListener interface {
	HandleUserLeft(*UserLeft)
}

Jump to

Keyboard shortcuts

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