simulation

package
v0.0.0-...-35c1c4a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerDatabase

type PlayerDatabase interface {
	GetOrCreateTwitchPlayer(twitchId string, twitchHandle string) (model.Player, error)
	GetPlayerIdByTwitchHandle(twitchHandle string) (*model.PlayerId, error)
}

type PlayerManager

type PlayerManager interface {
	GetPlayerJoinRejection(playerId model.PlayerId) *string
	PlayerJoin(playerId model.PlayerId) (model.SessionId, error)
	PlayerLeave(playerId model.PlayerId) error
	IsActivePlayer(playerId model.PlayerId) bool
	PlayerVote(playerId model.PlayerId, key string, strength *int) error
	GetPlayerTakeoverRejection(playerId model.PlayerId, tier model.TakeoverTier) string
	StartTakeover(playerId model.PlayerId, tier model.TakeoverTier) error
	CurrentTakeover() *model.Takeover
	CanReport(reporterId model.PlayerId, reportedId model.PlayerId) bool
	Report(reporterId model.PlayerId, reportedId model.PlayerId, reason string) error
}

type Simulation

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

func New

func New(environment env.Env, playerManager PlayerManager, db PlayerDatabase, stateEvents StateUpdateEventProducer) Simulation

func (*Simulation) AddBots

func (s *Simulation) AddBots(n int) error

func (*Simulation) KillAllBots

func (s *Simulation) KillAllBots() error

func (*Simulation) KillBot

func (s *Simulation) KillBot(botName string) error

func (*Simulation) Start

func (s *Simulation) Start()

func (*Simulation) Stop

func (s *Simulation) Stop()

type StateUpdateEventProducer

type StateUpdateEventProducer interface {
	SubscribeToEvents(listener func(event stateevents.UpdateEvent)) stateevents.EventConsumerId
	Unsubscribe(id stateevents.EventConsumerId)
}

Jump to

Keyboard shortcuts

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