Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMetrics ¶
type ClientMetrics struct {
}
type Collection ¶
type Collection[T any] struct { Items map[uint64]T ToAppend []T ToRemove []uint64 Lock sync.RWMutex }
func NewCollection ¶
func NewCollection[T any]() (collection *Collection[T])
NewCollection creates and initializes a new Collection instance for a given type T, setting up the internal map and slices for managing items, additions, and removals.
func (*Collection[T]) Add ¶
func (c *Collection[T]) Add(item T)
Add adds an item to the ToAppend slice of the Collection, marking it for addition to the main Items map during the next simulation tick.
func (*Collection[T]) Remove ¶
func (c *Collection[T]) Remove(id uint64)
Remove adds an item's ID to the ToRemove slice of the Collection, marking it for removal from the main Items map during the next simulation tick.
type GameMetrics ¶
type GameWrapper ¶
type GameWrapper struct {
Game Game
MaximumDelta float64
Metrics *GameMetrics
// contains filtered or unexported fields
}
func New ¶
func New(game Game, ticksPerSecond float64) (gw *GameWrapper)
func (*GameWrapper) Start ¶
func (gw *GameWrapper) Start()
func (*GameWrapper) Stop ¶
func (gw *GameWrapper) Stop()
func (*GameWrapper) Wait ¶
func (gw *GameWrapper) Wait()
Click to show internal directories.
Click to hide internal directories.