Documentation ¶
Index ¶
- Constants
- type AttackFinishedEvent
- type AttackInitiatedEvent
- type Bus
- type BusEvent
- func (be BusEvent) DecodeAttackFinishedEvent() (*AttackFinishedEvent, error)
- func (be BusEvent) DecodeAttackInitiatedEvent() (*AttackInitiatedEvent, error)
- func (be BusEvent) DecodeDefenseFailedEvent() (*DefenseFailedEvent, error)
- func (be BusEvent) DecodeDefenseModuleInstalledEvent() (*DefenseModuleInstalledEvent, error)
- func (be BusEvent) DecodePlayerJoinedEvent() (*PlayerJoinedEvent, error)
- func (be BusEvent) DecodeRegistrationEvent() (*RegistrationEvent, error)
- type DefenseFailedEvent
- type DefenseModuleInstalledEvent
- type IBus
- type PlayerJoinedEvent
- type RegistrationEvent
Constants ¶
View Source
const EventTypeAttackFinished = "attack_finished"
View Source
const EventTypeAttackInitiated = "attack_initiated"
View Source
const EventTypeDefenseFailed = "defense_failed"
View Source
const EventTypeDefenseModuleInstalled = "defense_module_installed"
View Source
const EventTypePanic = "panic"
View Source
const EventTypePlayerJoined = "player_joined"
View Source
const EventTypeRegistration = "registration"
Enums
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttackFinishedEvent ¶
Describes a success or a fail for an attack
type AttackInitiatedEvent ¶
Happens when a new attack is started
type BusEvent ¶
type BusEvent struct { Type string Information interface{} }
Describes a message sent to the bus
func (BusEvent) DecodeAttackFinishedEvent ¶
func (be BusEvent) DecodeAttackFinishedEvent() (*AttackFinishedEvent, error)
Decodes an attack finished event
func (BusEvent) DecodeAttackInitiatedEvent ¶
func (be BusEvent) DecodeAttackInitiatedEvent() (*AttackInitiatedEvent, error)
Decodes an attack initiated event
func (BusEvent) DecodeDefenseFailedEvent ¶
func (be BusEvent) DecodeDefenseFailedEvent() (*DefenseFailedEvent, error)
Decodes a defense failed event
func (BusEvent) DecodeDefenseModuleInstalledEvent ¶
func (be BusEvent) DecodeDefenseModuleInstalledEvent() (*DefenseModuleInstalledEvent, error)
Decodes a defense module installed event
func (BusEvent) DecodePlayerJoinedEvent ¶
func (be BusEvent) DecodePlayerJoinedEvent() (*PlayerJoinedEvent, error)
Decodes a player joined event
func (BusEvent) DecodeRegistrationEvent ¶
func (be BusEvent) DecodeRegistrationEvent() (*RegistrationEvent, error)
Decodes a registration event
type DefenseFailedEvent ¶
Happens when a defender fails to defend their module
type DefenseModuleInstalledEvent ¶
Happens when a new defense module is added to the system
type IBus ¶
type IBus interface { // Provides a channel that can be listened for a given topic Listen(topic string) <-chan *BusEvent // Send a new event to the event bus Send(event *BusEvent) // Graceful shutdown Stop() }
Describes the interface of the common event bus
type PlayerJoinedEvent ¶
Player joined the live game event
type RegistrationEvent ¶
Describes a registration event
Click to show internal directories.
Click to hide internal directories.