Documentation
¶
Index ¶
- Constants
- Variables
- type Attributes
- type Barrel
- type Base
- type Basic
- type Boost
- type Box
- type Bullets
- type Carrot
- type Cartridges
- type Color16
- type Decodable
- type Default
- type Defaultable
- type Direction
- type Elevator
- type Encodable
- type Entity
- type EntityInfo
- type EnvMap
- type Fire
- type Fireball
- type Flag
- type Flame
- type Fountain
- type GreenArmour
- type Grenades
- type Health
- type JumpPad
- type LensFlare
- type LensFlareSparkle
- type LensFlareSparkleSun
- type LensFlareSun
- type Light
- type Lightning
- type MapModel
- type Meter
- type MeterVS
- type Monster
- type ParticleInfo
- type ParticleType
- type Particles
- type Platform
- type PlayerStart
- type Powerup
- type Quad
- type RespawnPoint
- type Rockets
- type Rounds
- type Shape
- type Shells
- type SmokePlume
- type Snow
- type Sound
- type Spotlight
- type Steam
- type SteamVent
- type Tape
- type Teledest
- type Teleport
- type Vector
- type Water
- type YellowArmour
Constants ¶
View Source
const ( ParticleTypeFire ParticleType = iota ParticleTypeSteamVent = 1 ParticleTypeFountain = 2 ParticleTypeFireball = 3 ParticleTypeTape = 4 ParticleTypeLightning = 7 ParticleTypeSteam = 9 ParticleTypeWater = 10 ParticleTypeSnow = 13 // your guess is as good as mine ParticleTypeMeter = 5 ParticleTypeMeterVS = 6 ParticleTypeFlame = 11 ParticleTypeSmoke = 12 // i'm dying ParticleTypeLensFlare = 32 ParticleTypeLensFlareSparkle = 33 ParticleTypeLensFlareSun = 34 ParticleTypeLensFlareSparkleSun = 35 )
Variables ¶
View Source
var ENTITY_TYPES = []EntityInfo{ &Light{}, &MapModel{}, &PlayerStart{}, &EnvMap{}, &Particles{}, &Sound{}, &Spotlight{}, &Shells{}, &Bullets{}, &Rockets{}, &Rounds{}, &Grenades{}, &Cartridges{}, &Health{}, &Boost{}, &GreenArmour{}, &YellowArmour{}, &Quad{}, &Teleport{}, &Teledest{}, &Carrot{}, &JumpPad{}, &Base{}, &RespawnPoint{}, &Box{}, &Barrel{}, &Platform{}, &Elevator{}, &Flag{}, }
View Source
var ENTITY_TYPE_MAP = map[C.EntityType]EntityInfo{}
View Source
var Empty = fmt.Errorf("value was missing, check default")
View Source
var PARTICLE_TYPES = []ParticleInfo{ &Fire{}, &SteamVent{}, &Fountain{}, &Fireball{}, &Tape{}, &Lightning{}, &Steam{}, &Water{}, &Snow{}, &Meter{}, &MeterVS{}, &Flame{}, &SmokePlume{}, &LensFlareSparkleSun{}, &LensFlareSparkle{}, &LensFlareSun{}, &LensFlare{}, }
View Source
var PARTICLE_TYPE_MAP = map[ParticleType]ParticleInfo{}
View Source
var PARTICLE_TYPE_STRINGS = map[ParticleType]string{ ParticleTypeFire: "fire", ParticleTypeSteamVent: "steamVent", ParticleTypeFountain: "fountain", ParticleTypeFireball: "fireball", ParticleTypeTape: "tape", ParticleTypeLightning: "lightning", ParticleTypeSteam: "steam", ParticleTypeWater: "water", ParticleTypeSnow: "snow", ParticleTypeMeter: "meter", ParticleTypeMeterVS: "meterVs", ParticleTypeFlame: "flame", ParticleTypeSmoke: "smoke", ParticleTypeLensFlare: "lensFlare", ParticleTypeLensFlareSparkle: "lensFlareSparkle", ParticleTypeLensFlareSun: "lensFlareSun", ParticleTypeLensFlareSparkleSun: "lensFlareSparkleSun", }
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes []int16
func Encode ¶
func Encode(info EntityInfo) (*Attributes, error)
func (*Attributes) Get ¶
func (a *Attributes) Get() (int16, error)
func (*Attributes) Put ¶
func (a *Attributes) Put(value int16)
type Barrel ¶
type Barrel struct {
Angle int16 `json:"angle"`
Model int16 `json:"model"`
Weight int16 `json:"weight"`
Health int16 `json:"health"`
}
func (*Barrel) Type ¶
func (e *Barrel) Type() C.EntityType
type Box ¶
type Box struct {
Angle int16 `json:"angle"`
Model int16 `json:"model"`
Weight int16 `json:"weight"`
}
func (*Box) Type ¶
func (e *Box) Type() C.EntityType
type Cartridges ¶
type Cartridges Powerup
func (*Cartridges) Type ¶
func (e *Cartridges) Type() C.EntityType
type Color16 ¶
Particles can have colors with a weird encoding scheme. Each element corresponds to the upper four bits in the corresponding element of a 24-bit RGBA color. Instead of messing with this, the Go API treats this as a normal 24-bit color and cuts off the 0x0F bits on encode.
func (*Color16) Decode ¶
func (c *Color16) Decode(a *Attributes) error
func (Color16) Encode ¶
func (c Color16) Encode(a *Attributes) error
func (Color16) MarshalJSON ¶
func (*Color16) UnmarshalJSON ¶
type Decodable ¶
type Decodable interface {
Decode(*Attributes) error
}
type Default ¶
type Default[T any] struct { // contains filtered or unexported fields }
just like banks
func NewDefault ¶
type Defaultable ¶
type Defaultable interface {
Defaults() Defaultable
}
type Direction ¶
type Direction byte
func (*Direction) Decode ¶
func (d *Direction) Decode(a *Attributes) error
func (*Direction) Encode ¶
func (d *Direction) Encode(a *Attributes) error
type Elevator ¶
type Elevator struct {
Angle int16 `json:"angle"`
Model int16 `json:"model"`
Tag int16 `json:"tag"`
Speed int16 `json:"speed"`
}
func (*Elevator) Type ¶
func (e *Elevator) Type() C.EntityType
type Encodable ¶
type Encodable interface {
Encode(*Attributes) error
}
type Entity ¶
type Entity struct {
Position Vector
Info EntityInfo
}
func (*Entity) MarshalJSON ¶
func (*Entity) UnmarshalJSON ¶
type EntityInfo ¶
type EntityInfo interface {
Type() C.EntityType
}
func Decode ¶
func Decode(entityType C.EntityType, a *Attributes) (EntityInfo, error)
type EnvMap ¶
type EnvMap struct {
Radius int16 `json:"radius"`
Size int16 `json:"size"`
Blur int16 `json:"blur"`
}
func (*EnvMap) Type ¶
func (e *EnvMap) Type() C.EntityType
type Fire ¶
type Fire Basic
func (Fire) Defaults ¶
func (p Fire) Defaults() Defaultable
func (*Fire) Type ¶
func (p *Fire) Type() ParticleType
type Flame ¶
type Flame Basic
how is this different from Fire?
func (*Flame) Type ¶
func (p *Flame) Type() ParticleType
type GreenArmour ¶
type GreenArmour Powerup
func (*GreenArmour) Type ¶
func (e *GreenArmour) Type() C.EntityType
type Grenades ¶
type Grenades Powerup
func (*Grenades) Type ¶
func (e *Grenades) Type() C.EntityType
type JumpPad ¶
type JumpPad struct {
PushZ int16 `json:"pushZ"`
PushX int16 `json:"pushX"`
PushY int16 `json:"pushY"`
Sound int16 `json:"sound"`
}
func (*JumpPad) Type ¶
func (e *JumpPad) Type() C.EntityType
type LensFlareSparkle ¶
type LensFlareSparkle LensFlare
func (*LensFlareSparkle) Type ¶
func (p *LensFlareSparkle) Type() ParticleType
type LensFlareSparkleSun ¶
type LensFlareSparkleSun LensFlare
func (*LensFlareSparkleSun) Type ¶
func (p *LensFlareSparkleSun) Type() ParticleType
type LensFlareSun ¶
type LensFlareSun LensFlare
func (*LensFlareSun) Type ¶
func (p *LensFlareSun) Type() ParticleType
type Lightning ¶
type Lightning Shape
func (*Lightning) Type ¶
func (p *Lightning) Type() ParticleType
type Meter ¶
type Meter struct {
Progress int16 `json:"progress"`
ColorA Color16 `json:"colorA"`
ColorB Color16 `json:"colorB"`
}
func (*Meter) Type ¶
func (p *Meter) Type() ParticleType
type ParticleInfo ¶
type ParticleInfo interface {
Type() ParticleType
}
type ParticleType ¶
type ParticleType byte
func (ParticleType) FromString ¶
func (e ParticleType) FromString(value string)
func (ParticleType) String ¶
func (e ParticleType) String() string
type Particles ¶
type Particles struct {
Particle ParticleType
Info ParticleInfo
}
func (*Particles) Decode ¶
func (p *Particles) Decode(a *Attributes) error
func (*Particles) Encode ¶
func (p *Particles) Encode(a *Attributes) error
func (*Particles) MarshalJSON ¶
func (*Particles) Type ¶
func (p *Particles) Type() C.EntityType
func (*Particles) UnmarshalJSON ¶
type Platform ¶
type Platform struct {
Angle int16 `json:"angle"`
Model int16 `json:"model"`
Tag int16 `json:"tag"`
Speed int16 `json:"speed"`
}
func (*Platform) Type ¶
func (e *Platform) Type() C.EntityType
type PlayerStart ¶
func (*PlayerStart) Type ¶
func (e *PlayerStart) Type() C.EntityType
type RespawnPoint ¶
func (*RespawnPoint) Type ¶
func (e *RespawnPoint) Type() C.EntityType
type SmokePlume ¶
type SmokePlume Basic
func (*SmokePlume) Type ¶
func (p *SmokePlume) Type() ParticleType
type Sound ¶
type Sound struct {
Index int16 `json:"index"`
}
func (*Sound) Type ¶
func (e *Sound) Type() C.EntityType
type SteamVent ¶
type SteamVent struct {
Direction Direction
}
func (*SteamVent) Type ¶
func (p *SteamVent) Type() ParticleType
type Teleport ¶
type Teleport struct {
Index int16 `json:"index"`
Model int16 `json:"model"`
Tag int16 `json:"tag"`
Sound int16 `json:"sound"`
}
func (*Teleport) Type ¶
func (e *Teleport) Type() C.EntityType
type YellowArmour ¶
type YellowArmour Powerup
func (*YellowArmour) Type ¶
func (e *YellowArmour) Type() C.EntityType
Click to show internal directories.
Click to hide internal directories.