common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package common contains types that are used throughout this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapGetAlternateVersion added in v1.0.0

func MapGetAlternateVersion(mapName string) string

MapGetAlternateVersion returns the filename for the alternate overview file.

func MapGetHeightThreshold added in v1.0.0

func MapGetHeightThreshold(mapName string) float64

MapGetHeightThreshold returns the corresponding field of the specified map.

func MapHasAlternateVersion added in v1.0.0

func MapHasAlternateVersion(mapName string) bool

MapHasAlternateVersion returns whether a map has an alternative overview image.

Types

type Bomb added in v1.0.0

type Bomb struct {
	Position            Point
	IsBeingCarried      bool
	IsOnNormalElevation bool
}

Bomb contains all relevant information about the C4.

type Effect added in v1.0.0

type Effect struct {
	Position            Point
	Type                demoinfo.EquipmentType
	Lifetime            int32
	IsOnNormalElevation bool
	Team                demoinfo.Team
}

Effect contains information about graphical effects from grenades, bombs, defuses

type GrenadeProjectile added in v1.0.0

type GrenadeProjectile struct {
	Position            Point
	Type                demoinfo.EquipmentType
	IsOnNormalElevation bool
}

GrenadeProjectile conains all information that is used to draw a grenade mid air on the map.

type Inferno added in v1.0.0

type Inferno struct {
	ConvexHull2D        []Point
	IsOnNormalElevation bool
}

Inferno contains the hull points of the surface area of a molotov or incendiary grenade.

type Kill added in v0.4.0

type Kill struct {
	KillerName string
	KillerTeam demoinfo.Team
	VictimName string
	VictimTeam demoinfo.Team
	Weapon     demoinfo.EquipmentType
	Headshot   bool
}

Kill contains all information that is displayed on the killfeed.

type MapInfo added in v1.0.0

type MapInfo struct {
	AlternateOverview string
	// Height threshold to determine if a player is on the normal or on the
	// alternate version of the overview map
	HeightThreshold float64
}

MapInfo contains information about maps in regards to alternate versions of the overview image (normal/lower/upper).

type OverviewState

type OverviewState struct {
	IngameTick            int
	Players               []Player
	Grenades              []GrenadeProjectile
	Infernos              []Inferno
	Bomb                  Bomb
	TeamCounterTerrorists TeamState
	TeamTerrorists        TeamState
	Timer                 Timer
}

OverviewState contains all information that will be displayed for a single tick.

type Phase added in v0.4.0

type Phase int

Phase corresponds to a phase of a round.

const (
	PhaseFreezetime Phase = iota
	PhaseRegular
	PhasePlanted
	PhaseRestart
	PhaseWarmup
	PhaseHalftime
)

Possible values for Phase type.

type Player added in v1.0.0

type Player struct {
	Name                string
	ID                  int
	Team                demoinfo.Team
	Position            Point
	LastAlivePosition   Point
	ViewDirectionX      float32
	ViewDirectionY      float32
	FlashDuration       time.Duration
	FlashTimeRemaining  time.Duration
	Inventory           []demoinfo.EquipmentType
	ActiveWeapon        demoinfo.EquipmentType
	Health              int16
	Armor               int16
	Money               int16
	Kills               int16
	Deaths              int16
	Assists             int16
	IsAlive             bool
	IsDefusing          bool
	IsOnNormalElevation bool
	HasHelmet           bool
	HasDefuseKit        bool
	HasBomb             bool
}

Player contains all relevant information about a player in the match.

func (*Player) HasAwp added in v1.1.0

func (player *Player) HasAwp() bool

HasAwp returns whether the player has an AWP in their inventory.

type Point added in v1.0.0

type Point struct {
	X float32
	Y float32
	Z float32
}

Point contains the coordinates for a point on the map.

type Shot added in v0.6.0

type Shot struct {
	Position            Point
	ViewDirectionX      float32
	IsAwpShot           bool
	IsOnNormalElevation bool
}

Shot contains information about a shot from a weapon.

type TeamState added in v1.0.0

type TeamState struct {
	ClanName string
	Score    byte
}

TeamState contains information about a team in the match.

type Timer added in v0.4.0

type Timer struct {
	TimeRemaining time.Duration
	Phase         Phase
}

Timer contains the time remaining in the current phase of the round.

Jump to

Keyboard shortcuts

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