cache

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityCache

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

EntityCache caches soldiers and vehicles when they are created to avoid subsequent db reads. Latency in these calls is critical to quickly process incoming data.

func NewEntityCache

func NewEntityCache() *EntityCache

func (*EntityCache) AddPlacedObject

func (c *EntityCache) AddPlacedObject(p core.PlacedObject)

func (*EntityCache) AddSoldier

func (c *EntityCache) AddSoldier(s core.Soldier)

func (*EntityCache) AddVehicle

func (c *EntityCache) AddVehicle(v core.Vehicle)

func (*EntityCache) GetPlacedObject

func (c *EntityCache) GetPlacedObject(id uint16) (core.PlacedObject, bool)

func (*EntityCache) GetSoldier

func (c *EntityCache) GetSoldier(id uint16) (core.Soldier, bool)

func (*EntityCache) GetVehicle

func (c *EntityCache) GetVehicle(id uint16) (core.Vehicle, bool)

func (*EntityCache) Reset

func (c *EntityCache) Reset()

func (*EntityCache) SoldierCount

func (c *EntityCache) SoldierCount() int

func (*EntityCache) UpdateSoldier

func (c *EntityCache) UpdateSoldier(s core.Soldier)

UpdateSoldier replaces the cached soldier entry for the given ID.

func (*EntityCache) VehicleCount

func (c *EntityCache) VehicleCount() int

type MarkerCache

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

MarkerCache maps marker names to their database IDs for the current mission

func NewMarkerCache

func NewMarkerCache() *MarkerCache

NewMarkerCache creates a new MarkerCache

func (*MarkerCache) Delete

func (c *MarkerCache) Delete(name string)

Delete removes a marker by name

func (*MarkerCache) Get

func (c *MarkerCache) Get(name string) (uint, bool)

Get retrieves a marker ID by name

func (*MarkerCache) Reset

func (c *MarkerCache) Reset()

Reset clears all markers from the cache

func (*MarkerCache) Set

func (c *MarkerCache) Set(name string, id uint)

Set stores a marker ID by name

Jump to

Keyboard shortcuts

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