Documentation
¶
Index ¶
- Constants
- Variables
- func Create(e Entity) error
- func GetAll(filter model.DocumentFilter, k Kind, opts *Options) (*model.Result, error)
- func GetByIDs(ids []string, k Kind, opts *Options) (*model.Result, error)
- func GetByText(q string, opts *Options, kind Kind) (*model.Result, error)
- func Remove(id string) error
- func Replace(id string, e Entity) error
- type AmmoEffects
- type AmmoFrag
- type AmmoGrenadeProperties
- type Ammunition
- type AmmunitionFilter
- type Armor
- type ArmorComponent
- type ArmorFilter
- type ArmorMaterial
- type ArmorProps
- type Auxiliary
- type Backpack
- type Barrel
- type Barter
- type Bipod
- type Charge
- type Clothing
- type Compressor
- type Container
- type Device
- type Effect
- type EffectPenalties
- type Effects
- type Entity
- type Firearm
- type FirearmFilter
- type Food
- type Foregrip
- type GasBlock
- type Goggles
- type Grenade
- type Grid
- type GridModifier
- type GridProps
- type Handguard
- type Headphone
- type HighPass
- type Index
- type Item
- type Key
- type Kind
- type KindStats
- type Launcher
- type List
- type Magazine
- type MagazineFilter
- type MagazineModifier
- type Map
- type Medical
- type Melee
- type MeleeAttack
- type Modification
- type Money
- type Mount
- type Muzzle
- type OpticSpecial
- type Options
- type Penalties
- type PistolGrip
- type RGBA
- type Receiver
- type Sight
- type SightSpecial
- type Slot
- type Slots
- type Stock
- type TacticalRig
- type TacticalRigFilter
- type WeaponModifier
Constants ¶
const Collection = "items"
Collection indicates the MongoDB item collection
Variables ¶
var KindList = [...]Kind{ KindAmmunition, KindArmor, KindBackpack, KindBarter, KindClothing, KindCommon, KindContainer, KindFirearm, KindFood, KindGrenade, KindHeadphone, KindKey, KindMagazine, KindMap, KindMedical, KindMelee, KindModification, KindModificationBarrel, KindModificationAuxiliary, KindModificationBipod, KindModificationCharge, KindModificationDevice, KindModificationForegrip, KindModificationGasblock, KindModificationGoggles, KindModificationHandguard, KindModificationLauncher, KindModificationMount, KindModificationMuzzle, KindModificationPistolgrip, KindModificationReceiver, KindModificationSight, KindModificationSightSpecial, KindModificationStock, KindMoney, KindTacticalrig, }
KindList holds all kinds
Functions ¶
Types ¶
type AmmoEffects ¶
type AmmoEffects struct {
LightBleedingChance float64 `json:"lightBleedingChance,omitempty" bson:"lightBleedingChance,omitempty"`
HeavyBleedingChance float64 `json:"heavyBleedingChance,omitempty" bson:"heavyBleedingChance,omitempty"`
}
AmmoEffects holds the effects of Ammunition
type AmmoFrag ¶
type AmmoFrag struct {
Chance float64 `json:"chance" bson:"chance"`
Min int64 `json:"min" bson:"min"`
Max int64 `json:"max" bson:"max"`
}
AmmoFrag represents the fragmentation data of Ammunition
type AmmoGrenadeProperties ¶
type AmmoGrenadeProperties struct {
Delay float64 `json:"delay" bson:"delay"`
FragmentCount float64 `json:"fragCount" bson:"fragCount"`
MinRadius float64 `json:"minRadius" bson:"minRadius"`
MaxRadius float64 `json:"maxRadius" bson:"maxRadius"`
}
AmmoGrenadeProperties represents the grenade properties of Ammunition
type Ammunition ¶
type Ammunition struct {
Item `bson:",inline"`
Caliber string `json:"caliber" bson:"caliber"`
Type string `json:"type" bson:"type"`
Tracer bool `json:"tracer" bson:"tracer"`
TracerColor string `json:"tracerColor" bson:"tracerColor"`
Subsonic bool `json:"subsonic" bson:"subsonic"`
CasingMass float64 `json:"casingMass" bson:"casingMass"`
BulletMass float64 `json:"bulletMass" bson:"bulletMass"`
BulletDiameter float64 `json:"bulletDiameter" bson:"bulletDiameter"`
Velocity float64 `json:"velocity" bson:"velocity"`
BallisticCoeficient float64 `json:"ballisticCoef" bson:"ballisticCoef"`
Retardation float64 `json:"retardation" bson:"retardation"`
Damage float64 `json:"damage" bson:"damage"`
Penetration float64 `json:"penetration" bson:"penetration"`
ArmorDamage float64 `json:"armorDamage" bson:"armorDamage"`
Fragmentation AmmoFrag `json:"fragmentation" bson:"fragmentation"`
Effects AmmoEffects `json:"effects" bson:"effects"`
Projectiles int64 `json:"projectiles" bson:"projectiles"`
Pellets int64 `json:"pellets,omitempty" bson:"pellets,omitempty"` // Deprecated: no longer used
MisfireChance float64 `json:"misfireChance" bson:"misfireChance"`
FailureToFeedChance float64 `json:"failureToFeedChance" bson:"failureToFeedChance"`
WeaponModifier WeaponModifier `json:"weaponModifier" bson:"weaponModifier"`
GrenadeProperties *AmmoGrenadeProperties `json:"grenadeProps,omitempty" bson:"grenadeProps,omitempty"`
}
Ammunition describes the entity of an ammunition item
type AmmunitionFilter ¶
AmmunitionFilter describes the filters used for filtering Ammunition
func (*AmmunitionFilter) Filter ¶
func (f *AmmunitionFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type Armor ¶
type Armor struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Armor ArmorProps `json:"armor" bson:"armor"`
Components []ArmorComponent `json:"components" bson:"components"`
RicochetChance string `json:"ricochetChance,omitempty" bson:"ricochetChance,omitempty"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Blocking []string `json:"blocking" bson:"blocking"`
Slots Slots `json:"slots" bson:"slots"`
Compatibility List `json:"compatibility" bson:"compatibility"`
Conflicts List `json:"conflicts" bson:"conflicts"`
}
Armor describes the entity of an armor item
type ArmorComponent ¶
type ArmorComponent struct {
ArmorProps `bson:",inline"`
}
ArmorComponent describes the entity of an armor component
type ArmorFilter ¶
ArmorFilter describes the filters used for filtering Armor
func (*ArmorFilter) Filter ¶
func (f *ArmorFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type ArmorMaterial ¶
type ArmorMaterial struct {
Name string `json:"name" bson:"name"`
Destructibility float64 `json:"destructibility" bson:"destructibility"`
}
ArmorMaterial represents the armor material of ArmorProps
type ArmorProps ¶
type ArmorProps struct {
Class int64 `json:"class" bson:"class"`
Durability float64 `json:"durability" bson:"durability"`
Material ArmorMaterial `json:"material" bson:"material"`
BluntThroughput float64 `json:"bluntThroughput" bson:"bluntThroughput"`
Zones []string `json:"zones" bson:"zones"`
}
ArmorProps represents the armor properties of ArmorComponent and Armor
type Auxiliary ¶
type Auxiliary struct {
Modification `bson:",inline"`
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Auxiliary describes the entity of an auxiliary mod item
type Backpack ¶
type Backpack struct {
Item `bson:",inline"`
Capacity int64 `json:"capacity" bson:"capacity"`
Grids []Grid `json:"grids" bson:"grids"`
Penalties Penalties `json:"penalties" bson:"penalties"`
}
Backpack describes the entity of an backpack item
type Barrel ¶
type Barrel struct {
Modification `bson:",inline"`
Length float64 `json:"length" bson:"length"`
Velocity float64 `json:"velocity" bson:"velocity"`
Suppressor bool `json:"suppressor" bson:"suppressor"`
CenterOfImpact float64 `json:"centerOfImpact" bson:"centerOfImpact"`
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Barrel describes the entity of an barrel item
type Barter ¶
type Barter struct {
Item `bson:",inline"`
}
Barter describes the entity of an barter item
type Bipod ¶
type Bipod struct {
Modification `bson:",inline"`
}
Bipod describes the entity of an bipod item
type Charge ¶
type Charge struct {
Modification `bson:",inline"`
}
Charge describes the entity of an charging handle item
type Clothing ¶
type Clothing struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Blocking []string `json:"blocking" bson:"blocking"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Slots Slots `json:"slots" bson:"slots"`
}
Clothing describes the entity of an clothing item
type Compressor ¶
type Compressor struct {
Attack float64 `json:"attack" bson:"attack"`
Gain float64 `json:"gain" bson:"gain"`
Release float64 `json:"release" bson:"release"`
Treshhold float64 `json:"treshhold" bson:"treshhold"`
Volume float64 `json:"volume" bson:"volume"`
}
Compressor represents the compressor data of Headphone
type Container ¶
type Container struct {
Item `bson:",inline"`
Capacity int64 `json:"capacity" bson:"capacity"`
Grids []Grid `json:"grids" bson:"grids"`
}
Container describes the entity of an container item
type Device ¶
type Device struct {
Modification `bson:",inline"`
Type string `json:"type" bson:"type"`
Modes []string `json:"modes" bson:"modes"`
}
Device describes the entity of an tactical device item
type Effect ¶
type Effect struct {
Name string `json:"name,omitempty" bson:"name,omitempty"`
ResourceCosts int64 `json:"resourceCosts" bson:"resourceCosts"`
FadeIn float64 `json:"fadeIn" bson:"fadeIn"`
FadeOut float64 `json:"fadeOut" bson:"fadeOut"`
Chance float64 `json:"chance" bson:"chance"`
Delay float64 `json:"delay" bson:"delay"`
Duration float64 `json:"duration" bson:"duration"`
Value float64 `json:"value" bson:"value"`
IsPercent bool `json:"isPercent" bson:"isPercent"`
Removes bool `json:"removes" bson:"removes"`
Penalties EffectPenalties `json:"penalties" bson:"penalties"`
}
Effect represents the properties of an effect
type EffectPenalties ¶
type EffectPenalties struct {
HealthMin float64 `json:"healthMin,omitempty" bson:"healthMin,omitempty"`
HealthMax float64 `json:"healthMax,omitempty" bson:"healthMax,omitempty"`
}
EffectPenalties holds the effect penalties
type Effects ¶
type Effects struct {
Energy *Effect `json:"energy,omitempty" bson:"energy,omitempty"`
EnergyRate *Effect `json:"energyRate,omitempty" bson:"energyRate,omitempty"`
Hydration *Effect `json:"hydration,omitempty" bson:"hydration,omitempty"`
HydrationRate *Effect `json:"hydrationRate,omitempty" bson:"hydrationRate,omitempty"`
Stamina *Effect `json:"stamina,omitempty" bson:"stamina,omitempty"`
StaminaRate *Effect `json:"staminaRate,omitempty" bson:"staminaRate,omitempty"`
Health *Effect `json:"health,omitempty" bson:"health,omitempty"`
HealthRate *Effect `json:"healthRate,omitempty" bson:"healthRate,omitempty"`
Bloodloss *Effect `json:"bloodloss,omitempty" bson:"bloodloss,omitempty"` // Deprecated: replaced
LightBleeding *Effect `json:"lightBleeding,omitempty" bson:"lightBleeding,omitempty"`
HeavyBleeding *Effect `json:"heavyBleeding,omitempty" bson:"heavyBleeding,omitempty"`
Fracture *Effect `json:"fracture,omitempty" bson:"fracture,omitempty"`
Contusion *Effect `json:"contusion,omitempty" bson:"contusion,omitempty"`
Pain *Effect `json:"pain,omitempty" bson:"pain,omitempty"`
TunnelVision *Effect `json:"tunnelVision,omitempty" bson:"tunnelVision,omitempty"`
Tremor *Effect `json:"tremor,omitempty" bson:"tremor,omitempty"`
Toxication *Effect `json:"toxication,omitempty" bson:"toxication,omitempty"`
Antidote *Effect `json:"antidote,omitempty" bson:"antidote,omitempty"`
RadiationExposure *Effect `json:"radExposure,omitempty" bson:"radExposure,omitempty"`
BodyTemperature *Effect `json:"bodyTemperature,omitempty" bson:"bodyTemperature,omitempty"`
Mobility *Effect `json:"mobility,omitempty" bson:"mobility,omitempty"`
Recoil *Effect `json:"recoil,omitempty" bson:"recoil,omitempty"`
ReloadSpeed *Effect `json:"reloadSpeed,omitempty" bson:"reloadSpeed,omitempty"`
LootSpeed *Effect `json:"lootSpeed,omitempty" bson:"lootSpeed,omitempty"`
UnlockSpeed *Effect `json:"unlockSpeed,omitempty" bson:"unlockSpeed,omitempty"`
DestroyedPart *Effect `json:"destroyedPart,omitempty" bson:"destroyedPart,omitempty"`
WeightLimit *Effect `json:"weightLimit,omitempty" bson:"weightLimit,omitempty"`
DamageModifier *Effect `json:"damageModifier,omitempty" bson:"damageModifier,omitempty"`
Skill []Effect `json:"skill,omitempty" bson:"skill,omitempty"`
}
Effects holds all effect types
type Entity ¶
type Entity interface {
GetID() objectID
SetID(objectID)
GetKind() Kind
SetKind(Kind)
GetModified() timestamp
SetModified(timestamp)
Validate() error
}
Entity defines the methods of an item entity
type Firearm ¶
type Firearm struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Class string `json:"class" bson:"class"`
Caliber string `json:"caliber" bson:"caliber"`
Manufacturer string `json:"manufacturer" bson:"manufacturer"`
RateOfFire int64 `json:"rof" bson:"rof"`
BurstRounds int64 `json:"burstRounds,omitempty" bson:"burstRounds,omitempty"`
Action string `json:"action" bson:"action"`
Modes []string `json:"modes" bson:"modes"`
Velocity float64 `json:"velocity" bson:"velocity"`
EffectiveDistance int64 `json:"effectiveDist" bson:"effectiveDist"`
ErgonomicsFloat float64 `json:"ergonomicsFP" bson:"ergonomicsFP"`
Ergonomics int64 `json:"ergonomics" bson:"ergonomics"` // Deprecated: replaced
FoldRectractable bool `json:"foldRectractable" bson:"foldRectractable"`
RecoilVertical int64 `json:"recoilVertical" bson:"recoilVertical"`
RecoilHorizontal int64 `json:"recoilHorizontal" bson:"recoilHorizontal"`
OperatingResources float64 `json:"operatingResources" bson:"operatingResources"`
MalfunctionChance float64 `json:"malfunctionChance" bson:"malfunctionChance"`
DurabilityRatio float64 `json:"durabilityRatio" bson:"durabilityRatio"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
HeatFactorByShot float64 `json:"heatFactorByShot" bson:"heatFactorByShot"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
CoolFactorMods float64 `json:"coolFactorMods" bson:"coolFactorMods"`
CenterOfImpact float64 `json:"centerOfImpact" bson:"centerOfImpact"`
Slots Slots `json:"slots" bson:"slots"`
}
Firearm describes the entity of an firearm item
type FirearmFilter ¶
FirearmFilter describes the filters used for filtering Firearm
func (*FirearmFilter) Filter ¶
func (f *FirearmFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type Food ¶
type Food struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Resources int64 `json:"resources" bson:"resources"`
UseTime float64 `json:"useTime" bson:"useTime"`
Effects Effects `json:"effects" bson:"effects"`
}
Food describes the entity of an food item
type Foregrip ¶
type Foregrip struct {
Modification `bson:",inline"`
}
Foregrip describes the entity of an foregrip item
type GasBlock ¶
type GasBlock struct {
Modification `bson:",inline"`
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
GasBlock describes the entity of an gas block item
type Goggles ¶
type Goggles struct {
Modification `bson:",inline"`
Type string `json:"type" bson:"type"`
OpticSpecial `bson:",inline"`
}
Goggles describes the entity of an goggles item
type Grenade ¶
type Grenade struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Delay float64 `json:"delay" bson:"delay"`
FragmentCount float64 `json:"fragCount" bson:"fragCount"`
FragmentDamage float64 `json:"fragDamage,omitempty" bson:"fragDamage,omitempty"`
MinDistance float64 `json:"minDistance" bson:"minDistance"`
MaxDistance float64 `json:"maxDistance" bson:"maxDistance"`
ContusionDistance float64 `json:"contusionDistance" bson:"contusionDistance"`
Strength float64 `json:"strength" bson:"strength"`
EmitTime float64 `json:"emitTime" bson:"emitTime"`
}
Grenade describes the entity of an grenade item
type Grid ¶
type Grid struct {
ID string `json:"id" bson:"id"`
Height int64 `json:"height" bson:"height"`
Width int64 `json:"width" bson:"width"`
MaxWeight float64 `json:"maxWeight" bson:"maxWeight"`
Filter List `json:"filter" bson:"filter"`
}
Grid describes the properties of a grid
type GridModifier ¶
type GridModifier struct {
Height int64 `json:"height" bson:"height"`
Width int64 `json:"width" bson:"width"`
}
GridModifier represents the properties of an grid modifier
type GridProps ¶
type GridProps struct {
Color RGBA `json:"color" bson:"color"`
Height int64 `json:"height" bson:"height"`
Width int64 `json:"width" bson:"width"`
}
GridProps represents the grid properties of an item
type Handguard ¶
type Handguard struct {
Modification `bson:",inline"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Handguard describes the entity of an handguard item
type Headphone ¶
type Headphone struct {
Item `bson:",inline"`
AmbientVolume float64 `json:"ambientVol" bson:"ambientVol"`
DryVolume float64 `json:"dryVol" bson:"dryVol"`
Distortion float64 `json:"distortion" bson:"distortion"`
HighPassFilter HighPass `json:"hpf" bson:"hpf"`
Compressor Compressor `json:"compressor" bson:"compressor"`
}
Headphone describes the entity of an headphone item
type HighPass ¶
type HighPass struct {
CutoffFrequency float64 `json:"cutoffFreq" bson:"cutoffFreq"`
Resonance float64 `json:"resonance" bson:"resonance"`
}
HighPass represents the highpass filter data of Headphone
type Index ¶
type Index struct {
Total int64 `json:"total" bson:"total"`
Modified timestamp `json:"modified" bson:"modified"`
Kinds map[Kind]*KindStats `json:"kinds" bson:"kinds"`
}
Index describes the entity of an the item root endpoint
func (*Index) WithKinds ¶
func (i *Index) WithKinds(c *mongo.Collection) error
WithKinds fills Index with kind data
func (*Index) WithoutKinds ¶
func (i *Index) WithoutKinds(c *mongo.Collection) error
WithoutKinds fills Index without kind data
type Item ¶
type Item struct {
ID objectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
ShortName string `json:"shortName" bson:"shortName"`
Description string `json:"description" bson:"description"`
Price int64 `json:"price" bson:"price"` // Deprecated: no longer supported
Weight float64 `json:"weight" bson:"weight"`
MaxStack int64 `json:"maxStack" bson:"maxStack"`
Rarity string `json:"rarity" bson:"rarity"` // Deprecated: no longer supported
Grid GridProps `json:"grid" bson:"grid"`
Modified timestamp `json:"_modified" bson:"_modified"`
Kind Kind `json:"_kind" bson:"_kind"`
}
Item represents the basic data of item
func (*Item) GetModified ¶
func (i *Item) GetModified() timestamp
GetModified returns the modified date of the item
func (*Item) SetModified ¶
func (i *Item) SetModified(t timestamp)
SetModified sets an modified date
type Key ¶
type Key struct {
Item `bson:",inline"`
Location string `json:"location" bson:"location"`
Usages int64 `json:"usages,omitempty" bson:"usages,omitempty"`
}
Key describes the entity of an key item
type Kind ¶
type Kind string
A Kind represents an item type
const ( // KindModification represents the kind of Modification KindModification Kind = "modification" // KindModificationBarrel represents the kind of Barrel KindModificationBarrel Kind = "modificationBarrel" // KindModificationAuxiliary represents the kind of Auxiliary KindModificationAuxiliary Kind = "modificationAuxiliary" // KindModificationBipod represents the kind of Bipod KindModificationBipod Kind = "modificationBipod" // KindModificationCharge represents the kind of Charge KindModificationCharge Kind = "modificationCharge" // KindModificationDevice represents the kind of Device KindModificationDevice Kind = "modificationDevice" // KindModificationForegrip represents the kind of Foregrip KindModificationForegrip Kind = "modificationForegrip" // KindModificationGasblock represents the kind of GasBlock KindModificationGasblock Kind = "modificationGasblock" // KindModificationHandguard represents the kind of Handguard KindModificationHandguard Kind = "modificationHandguard" // KindModificationLauncher represents the kind of Launcher KindModificationLauncher Kind = "modificationLauncher" // KindModificationMount represents the kind of Mount KindModificationMount Kind = "modificationMount" // KindModificationMuzzle represents the kind of Muzzle KindModificationMuzzle Kind = "modificationMuzzle" // KindModificationGoggles represents the kind of Goggles KindModificationGoggles Kind = "modificationGoggles" // KindModificationPistolgrip represents the kind of PistolGrip KindModificationPistolgrip Kind = "modificationPistolgrip" // KindModificationReceiver represents the kind of Receiver KindModificationReceiver Kind = "modificationReceiver" // KindModificationSight represents the kind of Sight KindModificationSight Kind = "modificationSight" // KindModificationSightSpecial represents the kind of SightSpecial KindModificationSightSpecial Kind = "modificationSightSpecial" // KindModificationStock represents the kind of Stock KindModificationStock Kind = "modificationStock" )
const ( // KindAmmunition represents the kind of Ammunition KindAmmunition Kind = "ammunition" )
const ( // KindArmor represents the kind of Armor KindArmor Kind = "armor" )
const ( // KindBackpack represents the kind of Backpack KindBackpack Kind = "backpack" )
const ( // KindBarter represents the kind of Barter KindBarter Kind = "barter" )
const ( // KindClothing represents the kind of Clothing KindClothing Kind = "clothing" )
const KindCommon Kind = "common"
KindCommon represents the kind of Item
const ( // KindContainer represents the kind of Container KindContainer Kind = "container" )
const ( // KindFirearm represents the kind of Firearm KindFirearm Kind = "firearm" )
const ( // KindFood represents the kind of Food KindFood Kind = "food" )
const ( // KindGrenade represents the kind of Grenade KindGrenade Kind = "grenade" )
const ( // KindHeadphone represents the kind of Headphone KindHeadphone Kind = "headphone" )
const ( // KindKey represents the kind of Key KindKey Kind = "key" )
const ( // KindMagazine represents the kind of Magazine KindMagazine Kind = "magazine" )
const ( // KindMap represents the kind of Map KindMap Kind = "map" )
const ( // KindMedical represents the kind of Medical KindMedical Kind = "medical" )
const ( // KindMelee represents the kind of Melee KindMelee Kind = "melee" )
const ( // KindMoney represents the kind of Money KindMoney Kind = "money" )
const ( // KindTacticalrig represents the kind of TacticalRig KindTacticalrig Kind = "tacticalrig" )
func (*Kind) MarshalJSON ¶
MarshalJSON implements the JSON marshaler
func (*Kind) UnmarshalJSON ¶
UnmarshalJSON implements the JSON unmarshaler
type KindStats ¶
type KindStats struct {
Count int64 `json:"count" bson:"count"`
Modified timestamp `json:"modified" bson:"modified"`
}
KindStats describes the statistics of a kind
type Launcher ¶
type Launcher struct {
Modification `bson:",inline"`
Caliber string `json:"caliber" bson:"caliber"`
}
Launcher describes the entity of an launcher item
type Magazine ¶
type Magazine struct {
Item `bson:",inline"`
Capacity int64 `json:"capacity" bson:"capacity"`
Caliber string `json:"caliber" bson:"caliber"`
ErgonomicsFloat float64 `json:"ergonomicsFP" bson:"ergonomicsFP"`
Ergonomics int64 `json:"ergonomics" bson:"ergonomics"` // Deprecated: replaced
MalfunctionChance float64 `json:"malfunctionChance" bson:"malfunctionChance"`
Modifier MagazineModifier `json:"modifier" bson:"modifier"`
GridModifier GridModifier `json:"gridModifier" bson:"gridModifier"`
Compatibility List `json:"compatibility" bson:"compatibility"`
Conflicts List `json:"conflicts" bson:"conflicts"`
}
Magazine describes the entity of an magazine item
type MagazineFilter ¶
type MagazineFilter struct {
Caliber *string
}
MagazineFilter describes the filters used for filtering Magazine
func (*MagazineFilter) Filter ¶
func (f *MagazineFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type MagazineModifier ¶
type MagazineModifier struct {
CheckTime float64 `json:"checkTime" bson:"checkTime"`
LoadUnload float64 `json:"loadUnload" bson:"loadUnload"`
}
MagazineModifier describes the properties of Modifier in Magazine
type Medical ¶
type Medical struct {
Item `bson:",inline"`
Type string `json:"type" bson:"type"`
Resources int64 `json:"resources" bson:"resources"`
ResourceRate int64 `json:"resourceRate" bson:"resourceRate"` // Deprecated: no longer used
UseTime float64 `json:"useTime" bson:"useTime"`
Effects Effects `json:"effects" bson:"effects"`
}
Medical describes the entity of an medical item
type Melee ¶
type Melee struct {
Item `bson:",inline"`
Slash MeleeAttack `json:"slash" bson:"slash"`
Stab MeleeAttack `json:"stab" bson:"stab"`
}
Melee describes the entity of an melee item
type MeleeAttack ¶
type MeleeAttack struct {
Damage float64 `json:"damage" bson:"damage"`
Rate float64 `json:"rate" bson:"rate"`
Range float64 `json:"range" bson:"range"`
Consumption float64 `json:"consumption" bson:"consumption"`
}
MeleeAttack represents the slash and stab data of Melee
type Modification ¶
type Modification struct {
Item `bson:",inline"`
ErgonomicsFloat float64 `json:"ergonomicsFP" bson:"ergonomicsFP"`
Ergonomics int64 `json:"ergonomics" bson:"ergonomics"` // Deprecated: replaced
Accuracy float64 `json:"accuracy" bson:"accuracy"`
Recoil float64 `json:"recoil" bson:"recoil"`
RaidModdable int64 `json:"raidModdable" bson:"raidModdable"`
GridModifier GridModifier `json:"gridModifier" bson:"gridModifier"`
Slots Slots `json:"slots" bson:"slots"`
Compatibility List `json:"compatibility" bson:"compatibility"`
Conflicts List `json:"conflicts" bson:"conflicts"`
}
Modification represents the basic data of modification item
type Money ¶
type Money struct {
Item `bson:",inline"`
}
Money describes the entity of an money item
type Mount ¶
type Mount struct {
Modification `bson:",inline"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Mount describes the entity of an mount item
type Muzzle ¶
type Muzzle struct {
Modification `bson:",inline"`
Type string `json:"type" bson:"type"`
Velocity float64 `json:"velocity" bson:"velocity"`
Loudness float64 `json:"loudness" bson:"loudness"`
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Muzzle describes the entity of an muzzle item
type OpticSpecial ¶
type OpticSpecial struct {
Modes []string `json:"modes" bson:"modes"`
Color RGBA `json:"color" bson:"color"`
Noise string `json:"noise" bson:"noise"`
}
OpticSpecial represents the properties of GogglesSpecial and SightSpecial
type Penalties ¶
type Penalties struct {
Mouse float64 `json:"mouse,omitempty" bson:"mouse,omitempty"`
Speed float64 `json:"speed,omitempty" bson:"speed,omitempty"`
ErgonomicsFloat float64 `json:"ergonomicsFP,omitempty" bson:"ergonomicsFP,omitempty"`
Ergonomics int64 `json:"ergonomics,omitempty" bson:"ergonomics,omitempty"` // Deprecated: replaced
Deafness string `json:"deafness,omitempty" bson:"deafness,omitempty"`
}
Penalties holds all existing penaltie types
type PistolGrip ¶
type PistolGrip struct {
Modification `bson:",inline"`
}
PistolGrip describes the entity of an pistol grip item
type RGBA ¶
type RGBA struct {
R uint `json:"r" bson:"r"`
G uint `json:"g" bson:"g"`
B uint `json:"b" bson:"b"`
A uint `json:"a" bson:"a"`
}
RGBA represents a color in RGBA
type Receiver ¶
type Receiver struct {
Modification `bson:",inline"`
Velocity float64 `json:"velocity" bson:"velocity"`
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Receiver describes the entity of an receiver item
type Sight ¶
type Sight struct {
Modification `bson:",inline"`
Type string `json:"type" bson:"type"`
Magnification []string `json:"magnification" bson:"magnification"`
VariableZoom bool `json:"variableZoom" bson:"variableZoom"`
ZeroDistances []int64 `json:"zeroDistances" bson:"zeroDistances"`
}
Sight describes the entity of an sight item
type SightSpecial ¶
type SightSpecial struct {
Sight `bson:",inline"`
OpticSpecial `bson:",inline"`
}
SightSpecial describes the entity of an special sights item
type Slot ¶
type Slot struct {
Filter List `json:"filter" bson:"filter"`
Required bool `json:"required" bson:"required"`
}
Slot represents a mod slot of an item
type Stock ¶
type Stock struct {
Modification `bson:",inline"`
FoldRectractable bool `json:"foldRectractable" bson:"foldRectractable"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
CoolFactor float64 `json:"coolFactor" bson:"coolFactor"`
}
Stock describes the entity of an stock item
type TacticalRig ¶
type TacticalRig struct {
Item `bson:",inline"`
Capacity int64 `json:"capacity" bson:"capacity"`
Grids []Grid `json:"grids" bson:"grids"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Armor *ArmorProps `json:"armor,omitempty" bson:"armor,omitempty"` // Deprecated
ArmorComponents []ArmorComponent `json:"armorComponents,omitempty" bson:"armorComponents,omitempty"`
IsPlateCarrier bool `json:"isPlateCarrier" bson:"isPlateCarrier"`
Slots Slots `json:"slots" bson:"slots"`
}
TacticalRig describes the entity of an tactical rig item
type TacticalRigFilter ¶
type TacticalRigFilter struct {
IsPlateCarrier *bool
IsArmored *bool
ArmorClass *int64
ArmorMaterial *string
}
TacticalRigFilter describes the filters used for filtering TacticalRig
func (*TacticalRigFilter) Filter ¶
func (f *TacticalRigFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type WeaponModifier ¶
type WeaponModifier struct {
Accuracy float64 `json:"accuracy" bson:"accuracy"`
Recoil float64 `json:"recoil" bson:"recoil"`
MalfunctionChance float64 `json:"malfunctionChance" bson:"malfunctionChance"` // Deprecated: replaced
DurabilityBurn float64 `json:"durabilityBurn" bson:"durabilityBurn"`
HeatFactor float64 `json:"heatFactor" bson:"heatFactor"`
}
WeaponModifier contains the weapon modifiers of Ammunition
Source Files
¶
- index.go
- item.go
- kind.go
- kind_ammunition.go
- kind_armor.go
- kind_backpack.go
- kind_barter.go
- kind_clothing.go
- kind_common.go
- kind_container.go
- kind_firearm.go
- kind_food.go
- kind_grenade.go
- kind_headphone.go
- kind_key.go
- kind_magazine.go
- kind_map.go
- kind_medical.go
- kind_melee.go
- kind_modification.go
- kind_money.go
- kind_tacticalRig.go
- prop_effects.go
- prop_grid.go
- prop_penalties.go
- prop_slots.go