Documentation
¶
Index ¶
- type EntityCache
- func (c *EntityCache) AddPlacedObject(p core.PlacedObject)
- func (c *EntityCache) AddSoldier(s core.Soldier)
- func (c *EntityCache) AddVehicle(v core.Vehicle)
- func (c *EntityCache) GetPlacedObject(id uint16) (core.PlacedObject, bool)
- func (c *EntityCache) GetSoldier(id uint16) (core.Soldier, bool)
- func (c *EntityCache) GetVehicle(id uint16) (core.Vehicle, bool)
- func (c *EntityCache) Reset()
- func (c *EntityCache) SoldierCount() int
- func (c *EntityCache) UpdateSoldier(s core.Soldier)
- func (c *EntityCache) VehicleCount() int
- type MarkerCache
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 (*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) Set ¶
func (c *MarkerCache) Set(name string, id uint)
Set stores a marker ID by name
Click to show internal directories.
Click to hide internal directories.