repcmd

package
v1.12.9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package repcmd models player commands.

Index

Constants

View Source
const (
	HotkeyTypeIDAssign = 0x00
	HotkeyTypeIDSelect = 0x01
	HotkeyTypeIDAdd    = 0x02
)

HotkeyType IDs

View Source
const (
	OrderIDStop                 = 0x01
	OrderIDMove                 = 0x06
	OrderIDReaverStop           = 0x07
	OrderIDAttack1              = 0x08
	OrderIDAttack2              = 0x09
	OrderIDAttackUnit           = 0x0a
	OrderIDAttackFixedRange     = 0x0b
	OrderIDAttackTile           = 0x0c
	OrderIDAttackMove           = 0x0e
	OrderIDPlaceProtossBuilding = 0x1f
	OrderIDRallyPointUnit       = 0x27
	OrderIDRallyPointTile       = 0x28
	OrderIDCarrierStop          = 0x34
	OrderIDCarrierAttack        = 0x35
	OrderIDCarrierHoldPosition  = 0x39
	OrderIDReaverHoldPosition   = 0x3e
	OrderIDReaverAttack         = 0x3b
	OrderIDBuildingLand         = 0x47
	OrderIDHoldPosition         = 0x6b
	OrderIDQueenHoldPosition    = 0x6c
	OrderIDUnload               = 0x6f
	OrderIDMoveUnload           = 0x70
	OrderIDNukeLaunch           = 0x7d
	OrderIDCastRecall           = 0x89
	OrderIDCastScannerSweep     = 0x8b
	OrderIDMedicHoldPosition    = 0xb2
)

Order IDs

View Source
const (
	TypeIDKeepAlive          byte = 0x05
	TypeIDSaveGame           byte = 0x06
	TypeIDLoadGame           byte = 0x07
	TypeIDRestartGame        byte = 0x08
	TypeIDSelect             byte = 0x09
	TypeIDSelectAdd          byte = 0x0a
	TypeIDSelectRemove       byte = 0x0b
	TypeIDBuild              byte = 0x0c
	TypeIDVision             byte = 0x0d
	TypeIDAlliance           byte = 0x0e
	TypeIDGameSpeed          byte = 0x0f
	TypeIDPause              byte = 0x10
	TypeIDResume             byte = 0x11
	TypeIDCheat              byte = 0x12
	TypeIDHotkey             byte = 0x13
	TypeIDRightClick         byte = 0x14
	TypeIDTargetedOrder      byte = 0x15
	TypeIDCancelBuild        byte = 0x18
	TypeIDCancelMorph        byte = 0x19
	TypeIDStop               byte = 0x1a
	TypeIDCarrierStop        byte = 0x1b
	TypeIDReaverStop         byte = 0x1c
	TypeIDOrderNothing       byte = 0x1d
	TypeIDReturnCargo        byte = 0x1e
	TypeIDTrain              byte = 0x1f
	TypeIDCancelTrain        byte = 0x20
	TypeIDCloack             byte = 0x21
	TypeIDDecloack           byte = 0x22
	TypeIDUnitMorph          byte = 0x23
	TypeIDUnsiege            byte = 0x25
	TypeIDSiege              byte = 0x26
	TypeIDTrainFighter       byte = 0x27 // Build interceptor / scarab
	TypeIDUnloadAll          byte = 0x28
	TypeIDUnload             byte = 0x29
	TypeIDMergeArchon        byte = 0x2a
	TypeIDHoldPosition       byte = 0x2b
	TypeIDBurrow             byte = 0x2c
	TypeIDUnburrow           byte = 0x2d
	TypeIDCancelNuke         byte = 0x2e
	TypeIDLiftOff            byte = 0x2f
	TypeIDTech               byte = 0x30
	TypeIDCancelTech         byte = 0x31
	TypeIDUpgrade            byte = 0x32
	TypeIDCancelUpgrade      byte = 0x33
	TypeIDCancelAddon        byte = 0x34
	TypeIDBuildingMorph      byte = 0x35
	TypeIDStim               byte = 0x36
	TypeIDSync               byte = 0x37
	TypeIDVoiceEnable        byte = 0x38
	TypeIDVoiceDisable       byte = 0x39
	TypeIDVoiceSquelch       byte = 0x3a
	TypeIDVoiceUnsquelch     byte = 0x3b
	TypeIDStartGame          byte = 0x3c
	TypeIDDownloadPercentage byte = 0x3d
	TypeIDChangeGameSlot     byte = 0x3e
	TypeIDNewNetPlayer       byte = 0x3f
	TypeIDJoinedGame         byte = 0x40
	TypeIDChangeRace         byte = 0x41
	TypeIDTeamGameTeam       byte = 0x42
	TypeIDUMSTeam            byte = 0x43
	TypeIDMeleeTeam          byte = 0x44
	TypeIDSwapPlayers        byte = 0x45
	TypeIDSavedData          byte = 0x48
	TypeIDBriefingStart      byte = 0x54
	TypeIDLatency            byte = 0x55
	TypeIDReplaySpeed        byte = 0x56
	TypeIDLeaveGame          byte = 0x57
	TypeIDMinimapPing        byte = 0x58
	TypeIDMergeDarkArchon    byte = 0x5a
	TypeIDMakeGamePublic     byte = 0x5b
	TypeIDChat               byte = 0x5c
	TypeIDRightClick121      byte = 0x60
	TypeIDTargetedOrder121   byte = 0x61
	TypeIDUnload121          byte = 0x62
	TypeIDSelect121          byte = 0x63
	TypeIDSelectAdd121       byte = 0x64
	TypeIDSelectRemove121    byte = 0x65
)

Type IDs of command types

View Source
const (
	// Critters
	UnitIDRhynadon  = 0x59
	UnitIDBengalaas = 0x5a
	UnitIDScantid   = 0x5d
	UnitIDKakaru    = 0x5e
	UnitIDRagnasaur = 0x5f
	UnitIDUrsadon   = 0x60

	UnitIDCommandCenter   = 0x6A
	UnitIDComSat          = 0x6B
	UnitIDNuclearSilo     = 0x6C
	UnitIDSupplyDepot     = 0x6D
	UnitIDRefinery        = 0x6E
	UnitIDBarracks        = 0x6F
	UnitIDAcademy         = 0x70
	UnitIDFactory         = 0x71
	UnitIDStarport        = 0x72
	UnitIDControlTower    = 0x73
	UnitIDScienceFacility = 0x74
	UnitIDCovertOps       = 0x75
	UnitIDPhysicsLab      = 0x76
	UnitIDMachineShop     = 0x78
	UnitIDEngineeringBay  = 0x7A
	UnitIDArmory          = 0x7B
	UnitIDMissileTurret   = 0x7C
	UnitIDBunker          = 0x7D

	UnitIDInfestedCC       = 0x82
	UnitIDHatchery         = 0x83
	UnitIDLair             = 0x84
	UnitIDHive             = 0x85
	UnitIDNydusCanal       = 0x86
	UnitIDHydraliskDen     = 0x87
	UnitIDDefilerMound     = 0x88
	UnitIDGreaterSpire     = 0x89
	UnitIDQueensNest       = 0x8A
	UnitIDEvolutionChamber = 0x8B
	UnitIDUltraliskCavern  = 0x8C
	UnitIDSpire            = 0x8D
	UnitIDSpawningPool     = 0x8E
	UnitIDCreepColony      = 0x8F
	UnitIDSporeColony      = 0x90
	UnitIDSunkenColony     = 0x92
	UnitIDExtractor        = 0x95

	UnitIDNexus              = 0x9A
	UnitIDRoboticsFacility   = 0x9B
	UnitIDPylon              = 0x9C
	UnitIDAssimilator        = 0x9D
	UnitIDObservatory        = 0x9F
	UnitIDGateway            = 0xA0
	UnitIDPhotonCannon       = 0xA2
	UnitIDCitadelOfAdun      = 0xA3
	UnitIDCyberneticsCore    = 0xA4
	UnitIDTemplarArchives    = 0xA5
	UnitIDForge              = 0xA6
	UnitIDStargate           = 0xA7
	UnitIDFleetBeacon        = 0xA9
	UnitIDArbiterTribunal    = 0xAA
	UnitIDRoboticsSupportBay = 0xAB
	UnitIDShieldBattery      = 0xAC

	UnitIDMineralField1 = 0xB0
	UnitIDMineralField2 = 0xB1
	UnitIDMineralField3 = 0xB2
	UnitIDVespeneGeyser = 0xBC
	UnitIDStartLocation = 0xD6

	UnitIDNone = 0xE4
)

Unit IDs

View Source
const (
	VirtualTypeIDLand byte = 0xfe // Recorded as TypeIDBuild but the meaning (and text) is fundamentally different
)

Virtual Type IDs of command types

Variables

View Source
var (
	TypeKeepAlive          = Types[0]
	TypeSaveGame           = Types[1]
	TypeLoadGame           = Types[2]
	TypeRestartGame        = Types[3]
	TypeSelect             = Types[4]
	TypeSelectAdd          = Types[5]
	TypeSelectRemove       = Types[6]
	TypeBuild              = Types[7]
	TypeVision             = Types[8]
	TypeAlliance           = Types[9]
	TypeGameSpeed          = Types[10]
	TypePause              = Types[11]
	TypeResume             = Types[12]
	TypeCheat              = Types[13]
	TypeHotkey             = Types[14]
	TypeRightClick         = Types[15]
	TypeTargetedOrder      = Types[16]
	TypeCancelBuild        = Types[17]
	TypeCancelMorph        = Types[18]
	TypeStop               = Types[19]
	TypeCarrierStop        = Types[20]
	TypeReaverStop         = Types[21]
	TypeOrderNothing       = Types[22]
	TypeReturnCargo        = Types[23]
	TypeTrain              = Types[24]
	TypeCancelTrain        = Types[25]
	TypeCloack             = Types[26]
	TypeDecloack           = Types[27]
	TypeUnitMorph          = Types[28]
	TypeUnsiege            = Types[29]
	TypeSiege              = Types[30]
	TypeTrainFighter       = Types[31] // Build interceptor / scarab
	TypeUnloadAll          = Types[32]
	TypeUnload             = Types[33]
	TypeMergeArchon        = Types[34]
	TypeHoldPosition       = Types[35]
	TypeBurrow             = Types[36]
	TypeUnburrow           = Types[37]
	TypeCancelNuke         = Types[38]
	TypeLiftOff            = Types[39]
	TypeTech               = Types[40]
	TypeCancelTech         = Types[41]
	TypeUpgrade            = Types[42]
	TypeCancelUpgrade      = Types[43]
	TypeCancelAddon        = Types[44]
	TypeBuildingMorph      = Types[45]
	TypeStim               = Types[46]
	TypeSync               = Types[47]
	TypeVoiceEnable        = Types[48]
	TypeVoiceDisable       = Types[49]
	TypeVoiceSquelch       = Types[50]
	TypeVoiceUnsquelch     = Types[51]
	TypeStartGame          = Types[52]
	TypeDownloadPercentage = Types[53]
	TypeChangeGameSlot     = Types[54]
	TypeNewNetPlayer       = Types[55]
	TypeJoinedGame         = Types[56]
	TypeChangeRace         = Types[57]
	TypeTeamGameTeam       = Types[58]
	TypeUMSTeam            = Types[59]
	TypeMeleeTeam          = Types[60]
	TypeSwapPlayers        = Types[61]
	TypeSavedData          = Types[62]
	TypeBriefingStart      = Types[63]
	TypeLatency            = Types[64]
	TypeReplaySpeed        = Types[65]
	TypeLeaveGame          = Types[66]
	TypeMinimapPing        = Types[67]
	TypeMergeDarkArchon    = Types[68]
	TypeMakeGamePublic     = Types[69]
	TypeChat               = Types[70]
	TypeRightClick121      = Types[71]
	TypeTargetedOrder121   = Types[72]
	TypeUnload121          = Types[73]
	TypeSelect121          = Types[74]
	TypeSelectAdd121       = Types[75]
	TypeSelectRemove121    = Types[76]

	TypeLand = Types[77]
)

Named command types

View Source
var HotkeyTypes = []*HotkeyType{
	{e("Assign"), 0x00},
	{e("Select"), 0x01},
	{e("Add"), 0x02},
}

HotkeyTypes is an enumeration of the possible hotkey types.

View Source
var Latencies = []*Latency{
	{e("Low"), 0x00},
	{e("High"), 0x01},
	{e("Extra High"), 0x02},
}

Latencies is an enumeration of the possible latencies.

View Source
var LeaveReasons = []*LeaveReason{
	{e("Quit"), 0x01},
	{e("Defeat"), 0x02},
	{e("Victory"), 0x03},
	{e("Finished"), 0x04},
	{e("Draw"), 0x05},
	{e("Dropped"), 0x06},
}

LeaveReasons is an enumeration of the possible leave reasons.

View Source
var Orders = []*Order{}/* 190 elements not displayed */

Orders is an enumeration of the possible unit orders.

View Source
var Techs = []*Tech{
	{e("Stim Packs"), 0x00},
	{e("Lockdown"), 0x01},
	{e("EMP Shockwave"), 0x02},
	{e("Spider Mines"), 0x03},
	{e("Scanner Sweep"), 0x04},
	{e("Tank Siege Mode"), 0x05},
	{e("Defensive Matrix"), 0x06},
	{e("Irradiate"), 0x07},
	{e("Yamato Gun"), 0x08},
	{e("Cloaking Field"), 0x09},
	{e("Personnel Cloaking"), 0x0a},
	{e("Burrowing"), 0x0b},
	{e("Infestation"), 0x0c},
	{e("Spawn Broodlings"), 0x0d},
	{e("Dark Swarm"), 0x0e},
	{e("Plague"), 0x0f},
	{e("Consume"), 0x10},
	{e("Ensnare"), 0x11},
	{e("Parasite"), 0x12},
	{e("Psionic Storm"), 0x13},
	{e("Hallucination"), 0x14},
	{e("Recall"), 0x15},
	{e("Stasis Field"), 0x16},
	{e("Archon Warp"), 0x17},
	{e("Restoration"), 0x18},
	{e("Disruption Web"), 0x19},
	{e("Unused 26"), 0x1a},
	{e("Mind Control"), 0x1b},
	{e("Dark Archon Meld"), 0x1c},
	{e("Feedback"), 0x1d},
	{e("Optical Flare"), 0x1e},
	{e("Maelstrom"), 0x1f},
	{e("Lurker Aspect"), 0x20},
	{e("Unused 33"), 0x21},
	{e("Healing"), 0x22},
}

Techs is an enumeration of the possible techs.

View Source
var Types = []*Type{
	{e("Keep Alive"), TypeIDKeepAlive},
	{e("Save Game"), TypeIDSaveGame},
	{e("Load Game"), TypeIDLoadGame},
	{e("Restart Game"), TypeIDRestartGame},
	{e("Select"), TypeIDSelect},
	{e("Select Add"), TypeIDSelectAdd},
	{e("Select Remove"), TypeIDSelectRemove},
	{e("Build"), TypeIDBuild},
	{e("Vision"), TypeIDVision},
	{e("Alliance"), TypeIDAlliance},
	{e("Game Speed"), TypeIDGameSpeed},
	{e("Pause"), TypeIDPause},
	{e("Resume"), TypeIDResume},
	{e("Cheat"), TypeIDCheat},
	{e("Hotkey"), TypeIDHotkey},
	{e("Right Click"), TypeIDRightClick},
	{e("Targeted Order"), TypeIDTargetedOrder},
	{e("Cancel Build"), TypeIDCancelBuild},
	{e("Cancel Morph"), TypeIDCancelMorph},
	{e("Stop"), TypeIDStop},
	{e("Carrier Stop"), TypeIDCarrierStop},
	{e("Reaver Stop"), TypeIDReaverStop},
	{e("Order Nothing"), TypeIDOrderNothing},
	{e("Return Cargo"), TypeIDReturnCargo},
	{e("Train"), TypeIDTrain},
	{e("Cancel Train"), TypeIDCancelTrain},
	{e("Cloack"), TypeIDCloack},
	{e("Decloack"), TypeIDDecloack},
	{e("Unit Morph"), TypeIDUnitMorph},
	{e("Unsiege"), TypeIDUnsiege},
	{e("Siege"), TypeIDSiege},
	{e("Train Fighter"), TypeIDTrainFighter},
	{e("Unload All"), TypeIDUnloadAll},
	{e("Unload"), TypeIDUnload},
	{e("Merge Archon"), TypeIDMergeArchon},
	{e("Hold Position"), TypeIDHoldPosition},
	{e("Burrow"), TypeIDBurrow},
	{e("Unburrow"), TypeIDUnburrow},
	{e("Cancel Nuke"), TypeIDCancelNuke},
	{e("Lift Off"), TypeIDLiftOff},
	{e("Tech"), TypeIDTech},
	{e("Cancel Tech"), TypeIDCancelTech},
	{e("Upgrade"), TypeIDUpgrade},
	{e("Cancel Upgrade"), TypeIDCancelUpgrade},
	{e("Cancel Addon"), TypeIDCancelAddon},
	{e("Building Morph"), TypeIDBuildingMorph},
	{e("Stim"), TypeIDStim},
	{e("Sync"), TypeIDSync},
	{e("Voice Enable"), TypeIDVoiceEnable},
	{e("Voice Disable"), TypeIDVoiceDisable},
	{e("Voice Squelch"), TypeIDVoiceSquelch},
	{e("Voice Unsquelch"), TypeIDVoiceUnsquelch},
	{e("[Lobby] Start Game"), TypeIDStartGame},
	{e("[Lobby] Download Percentage"), TypeIDDownloadPercentage},
	{e("[Lobby] Change Game Slot"), TypeIDChangeGameSlot},
	{e("[Lobby] New Net Player"), TypeIDNewNetPlayer},
	{e("[Lobby] Joined Game"), TypeIDJoinedGame},
	{e("[Lobby] Change Race"), TypeIDChangeRace},
	{e("[Lobby] Team Game Team"), TypeIDTeamGameTeam},
	{e("[Lobby] UMS Team"), TypeIDUMSTeam},
	{e("[Lobby] Melee Team"), TypeIDMeleeTeam},
	{e("[Lobby] Swap Players"), TypeIDSwapPlayers},
	{e("[Lobby] Saved Data"), TypeIDSavedData},
	{e("Briefing Start"), TypeIDBriefingStart},
	{e("Latency"), TypeIDLatency},
	{e("Replay Speed"), TypeIDReplaySpeed},
	{e("Leave Game"), TypeIDLeaveGame},
	{e("Minimap Ping"), TypeIDMinimapPing},
	{e("Merge Dark Archon"), TypeIDMergeDarkArchon},
	{e("Make Game Public"), TypeIDMakeGamePublic},
	{e("Chat"), TypeIDChat},
	{e("Right Click"), TypeIDRightClick121},
	{e("Targeted Order"), TypeIDTargetedOrder121},
	{e("Unload"), TypeIDUnload121},
	{e("Select"), TypeIDSelect121},
	{e("Select Add"), TypeIDSelectAdd121},
	{e("Select Remove"), TypeIDSelectRemove121},

	{e("Land"), VirtualTypeIDLand},
}

Types is an enumeration of the possible command types

View Source
var Units = []*Unit{}/* 227 elements not displayed */

Units is an enumeration of the possible units

View Source
var Upgrades = []*Upgrade{
	{e("Terran Infantry Armor"), 0x00},
	{e("Terran Vehicle Plating"), 0x01},
	{e("Terran Ship Plating"), 0x02},
	{e("Zerg Carapace"), 0x03},
	{e("Zerg Flyer Carapace"), 0x04},
	{e("Protoss Ground Armor"), 0x05},
	{e("Protoss Air Armor"), 0x06},
	{e("Terran Infantry Weapons"), 0x07},
	{e("Terran Vehicle Weapons"), 0x08},
	{e("Terran Ship Weapons"), 0x09},
	{e("Zerg Melee Attacks"), 0x0A},
	{e("Zerg Missile Attacks"), 0x0B},
	{e("Zerg Flyer Attacks"), 0x0C},
	{e("Protoss Ground Weapons"), 0x0D},
	{e("Protoss Air Weapons"), 0x0E},
	{e("Protoss Plasma Shields"), 0x0F},
	{e("U-238 Shells (Marine Range)"), 0x10},
	{e("Ion Thrusters (Vulture Speed)"), 0x11},
	{e("Titan Reactor (Science Vessel Energy)"), 0x13},
	{e("Ocular Implants (Ghost Sight)"), 0x14},
	{e("Moebius Reactor (Ghost Energy)"), 0x15},
	{e("Apollo Reactor (Wraith Energy)"), 0x16},
	{e("Colossus Reactor (Battle Cruiser Energy)"), 0x17},
	{e("Ventral Sacs (Overlord Transport)"), 0x18},
	{e("Antennae (Overlord Sight)"), 0x19},
	{e("Pneumatized Carapace (Overlord Speed)"), 0x1A},
	{e("Metabolic Boost (Zergling Speed)"), 0x1B},
	{e("Adrenal Glands (Zergling Attack)"), 0x1C},
	{e("Muscular Augments (Hydralisk Speed)"), 0x1D},
	{e("Grooved Spines (Hydralisk Range)"), 0x1E},
	{e("Gamete Meiosis (Queen Energy)"), 0x1F},
	{e("Defiler Energy"), 0x20},
	{e("Singularity Charge (Dragoon Range)"), 0x21},
	{e("Leg Enhancement (Zealot Speed)"), 0x22},
	{e("Scarab Damage"), 0x23},
	{e("Reaver Capacity"), 0x24},
	{e("Gravitic Drive (Shuttle Speed)"), 0x25},
	{e("Sensor Array (Observer Sight)"), 0x26},
	{e("Gravitic Booster (Observer Speed)"), 0x27},
	{e("Khaydarin Amulet (Templar Energy)"), 0x28},
	{e("Apial Sensors (Scout Sight)"), 0x29},
	{e("Gravitic Thrusters (Scout Speed)"), 0x2A},
	{e("Carrier Capacity"), 0x2B},
	{e("Khaydarin Core (Arbiter Energy)"), 0x2C},
	{e("Argus Jewel (Corsair Energy)"), 0x2F},
	{e("Argus Talisman (Dark Archon Energy)"), 0x31},
	{e("Caduceus Reactor (Medic Energy)"), 0x33},
	{e("Chitinous Plating (Ultralisk Armor)"), 0x34},
	{e("Anabolic Synthesis (Ultralisk Speed)"), 0x35},
	{e("Charon Boosters (Goliath Range)"), 0x36},
}

Upgrades is an enumeration of the possible upgrades.

Functions

func IsOrderIDKindAttack added in v1.3.0

func IsOrderIDKindAttack(orderID byte) bool

IsOrderIDKindAttack tells if the given order ID is one of the attack orders.

func IsOrderIDKindHold added in v1.3.0

func IsOrderIDKindHold(orderID byte) bool

IsOrderIDKindHold tells if the given order ID is one of the hold orders.

func IsOrderIDKindStop added in v1.3.0

func IsOrderIDKindStop(orderID byte) bool

IsOrderIDKindStop tells if the given order ID is one of the stop orders.

func RaceOfUnitID added in v1.3.0

func RaceOfUnitID(ID uint16) *repcore.Race

RaceOfUnitID returns the owner race of the unit given by its ID. Returns nil if owner is unknown. Currently only building units are recognized.

Types

type AllianceCmd added in v1.4.0

type AllianceCmd struct {
	*Base

	// SlotIDs lists slot IDs the owner is allied to.
	// It contains slot IDs in increasing order.
	SlotIDs Bytes

	// AlliedVictory tells if Allied Victory is set.
	AlliedVictory bool
}

AllianceCmd describes the set alliance command. Type: TypeIDAlliance

func (*AllianceCmd) Params added in v1.4.0

func (ac *AllianceCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Base

type Base struct {
	// Frame at which the command was issued
	Frame repcore.Frame

	// PlayerID this command was issued by
	PlayerID byte

	// Type of the command
	Type *Type

	// IneffKind classification of the command
	IneffKind repcore.IneffKind `json:",omitempty"`
}

Base is the base of all player commands.

func (*Base) BaseCmd

func (b *Base) BaseCmd() *Base

BaseCmd implements Cmd.BaseCmd().

func (*Base) Params added in v1.2.0

func (b *Base) Params(verbose bool) string

Params implements Cmd.Params().

type BuildCmd

type BuildCmd struct {
	*Base

	// Order type
	Order *Order

	// Pos tells the point where the building is placed.
	Pos repcore.Point

	// Unit is the building issued to be built.
	Unit *Unit
}

BuildCmd describes a build command. Type: TypeBuild

func (*BuildCmd) Params added in v1.2.0

func (bc *BuildCmd) Params(verbose bool) string

Params implements Cmd.Params().

type BuildingMorphCmd

type BuildingMorphCmd struct {
	*Base

	// Unit is the unit to morph into (e.g. Lair from Hatchery).
	Unit *Unit
}

BuildingMorphCmd describes a building morph command. Type: TypeBuildingMorph

func (*BuildingMorphCmd) Params added in v1.2.0

func (bmc *BuildingMorphCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Bytes added in v1.8.1

type Bytes []byte

Bytes is a []byte that JSON-marshals itself as a number array.

func (Bytes) MarshalJSON added in v1.8.1

func (bs Bytes) MarshalJSON() ([]byte, error)

MarshalJSON marshals the byte slice as a number array.

type CancelTrainCmd

type CancelTrainCmd struct {
	*Base

	// UnitTag is the cancelled unit tag.
	UnitTag UnitTag
}

CancelTrainCmd describes a cancel train command. Type: TypeCancelTrain

func (*CancelTrainCmd) Params added in v1.2.0

func (ctc *CancelTrainCmd) Params(verbose bool) string

Params implements Cmd.Params().

type ChatCmd

type ChatCmd struct {
	*Base

	// SenderSlotID tells the slot ID of the message sender.
	SenderSlotID byte

	// Message sent.
	Message string
}

ChatCmd describes an in-game receive chat command. Type: TypeChat Owner of the command receives the message sent by the user identified by SenderSlotID.

func (*ChatCmd) Params added in v1.2.0

func (cc *ChatCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Cmd

type Cmd interface {
	// Base returns the base command.
	BaseCmd() *Base

	// Params returns human-readable concrete command-specific parameters.
	Params(verbose bool) string
}

Cmd is the command interface.

type GameSpeedCmd

type GameSpeedCmd struct {
	*Base

	// Speed is the new game speed.
	Speed *repcore.Speed
}

GameSpeedCmd describes a set game speed command. Type: TypeGameSpeed

func (*GameSpeedCmd) Params added in v1.2.0

func (gc *GameSpeedCmd) Params(verbose bool) string

Params implements Cmd.Params().

type GeneralCmd

type GeneralCmd struct {
	*Base

	// Data is the "raw" parameters of the command.
	Data []byte
}

GeneralCmd represents a general command whose parameters are not handled / cared for.

func (*GeneralCmd) Params added in v1.2.0

func (gc *GeneralCmd) Params(verbose bool) string

Params implements Cmd.Params().

type HotkeyCmd

type HotkeyCmd struct {
	*Base

	// HotkeyType is the type of the hotkey command
	// (named like this to avoid same name from Base.Type).
	HotkeyType *HotkeyType

	// Group (the "number"): 0..9.
	Group byte
}

HotkeyCmd describes a hotkey command. Type: TypeHotkey

func (*HotkeyCmd) Params added in v1.2.0

func (hc *HotkeyCmd) Params(verbose bool) string

Params implements Cmd.Params().

type HotkeyType

type HotkeyType struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

HotkeyType describes the hotkey type.

func HotkeyTypeByID

func HotkeyTypeByID(ID byte) *HotkeyType

HotkeyTypeByID returns the HotkeyType for a given ID. A new HotkeyType with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type LandCmd added in v1.8.2

type LandCmd struct {
	*Base

	// Order type
	Order *Order

	// Pos tells the point where the building is landed.
	Pos repcore.Point

	// Unit is the building issued to be landed.
	Unit *Unit
}

LandCmd describes a land command. Type: TypeBuild

func (*LandCmd) Params added in v1.8.2

func (bc *LandCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Latency

type Latency struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

Latency describes the latency.

func LatencyTypeByID

func LatencyTypeByID(ID byte) *Latency

LatencyTypeByID returns the Latency for a given ID. A new Latency with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type LatencyCmd

type LatencyCmd struct {
	*Base

	// Latency is the new latency.
	Latency *Latency
}

LatencyCmd describes a latency change command. Type: TypeLatency

func (*LatencyCmd) Params added in v1.2.0

func (lc *LatencyCmd) Params(verbose bool) string

Params implements Cmd.Params().

type LeaveGameCmd

type LeaveGameCmd struct {
	*Base

	// Reasom why the player left.
	Reason *LeaveReason
}

LeaveGameCmd describes a leave game command. Type: TypeLeaveGame

func (*LeaveGameCmd) Params added in v1.2.0

func (lgc *LeaveGameCmd) Params(verbose bool) string

Params implements Cmd.Params().

type LeaveReason

type LeaveReason struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

LeaveReason describes the leave reason.

func LeaveReasonByID

func LeaveReasonByID(ID byte) *LeaveReason

LeaveReasonByID returns the LeaveReason for a given ID. A new LeaveReason with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type LiftOffCmd

type LiftOffCmd struct {
	*Base

	// Pos tells the location of the lift off.
	Pos repcore.Point
}

LiftOffCmd describes a lift off command. Type: TypeLiftOff

func (*LiftOffCmd) Params added in v1.2.0

func (loc *LiftOffCmd) Params(verbose bool) string

Params implements Cmd.Params().

type MinimapPingCmd

type MinimapPingCmd struct {
	*Base

	// Pos tells the pinged location.
	Pos repcore.Point
}

MinimapPingCmd describes a minimap ping command. Type: TypeMinimapPing

func (*MinimapPingCmd) Params added in v1.2.0

func (mpc *MinimapPingCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Order

type Order struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

Order describes the unit order.

func OrderByID

func OrderByID(ID byte) *Order

OrderByID returns the Order for a given ID. A new Order with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type ParseErrCmd

type ParseErrCmd struct {
	*Base

	// PrevCmd is the command preceding the parse error command.
	PrevCmd Cmd
}

ParseErrCmd represents a command where parsing error encountered. It stores a reference to the preceding command for debugging purposes (often a parse error is the result of improperly parsing the preceding command).

func (*ParseErrCmd) Params added in v1.2.0

func (pec *ParseErrCmd) Params(verbose bool) string

Params implements Cmd.Params().

type QueueableCmd

type QueueableCmd struct {
	*Base

	// Queued tells if the command is queued. If not, it's instant.
	Queued bool
}

QueueableCmd describes a generic command that holds whether it is queued. Types: TypeStop, TypeReturnCargo, TypeUnloadAll, TypeHoldPosition, TypeBurrow, TypeUnburrow, TypeSiege, TypeUnsiege, TypeCloack, TypeDecloack

func (*QueueableCmd) Params added in v1.2.0

func (qc *QueueableCmd) Params(verbose bool) string

Params implements Cmd.Params().

type RightClickCmd

type RightClickCmd struct {
	*Base

	// Pos tells the right-clicked target point.
	Pos repcore.Point

	// UnitTag is the right-clicked unit's unit tag if it's valid.
	UnitTag UnitTag

	// Unit is the right-clicked unit (if UnitTag is valid).
	Unit *Unit

	// Queued tells if the command is queued. If not, it's instant.
	Queued bool
}

RightClickCmd represents a right click command. Type: TypeRightClick

func (*RightClickCmd) Params added in v1.2.0

func (rcc *RightClickCmd) Params(verbose bool) string

Params implements Cmd.Params().

type SelectCmd

type SelectCmd struct {
	*Base

	// UnitTags contains the unit tags involved in the select command.
	UnitTags []UnitTag
}

SelectCmd describes commands of types: TypeSelect, TypeSelectAdd, TypeSelectRemove

func (*SelectCmd) Params added in v1.2.0

func (sc *SelectCmd) Params(verbose bool) string

Params implements Cmd.Params().

type TargetedOrderCmd

type TargetedOrderCmd struct {
	*Base

	// Pos tells the targeted order's target point.
	Pos repcore.Point

	// UnitTag is the targeted order's unit tag if it's valid.
	UnitTag UnitTag

	// Unit is the targeted order's unit (if UnitTag is valid).
	Unit *Unit

	// Order type
	Order *Order

	// Queued tells if the command is queued. If not, it's instant.
	Queued bool
}

TargetedOrderCmd describes a targeted order command. Type: TypeTargetedOrder

func (*TargetedOrderCmd) Params added in v1.2.0

func (toc *TargetedOrderCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Tech

type Tech struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

Tech describes the tech (research).

func TechByID

func TechByID(ID byte) *Tech

TechByID returns the Tech for a given ID. A new Tech with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type TechCmd

type TechCmd struct {
	*Base

	// Tech that was started.
	Tech *Tech
}

TechCmd describes a tech (research) command. Type: TypeTech

func (*TechCmd) Params added in v1.2.0

func (tc *TechCmd) Params(verbose bool) string

Params implements Cmd.Params().

type TrainCmd

type TrainCmd struct {
	*Base

	// Unit is the trained unit.
	Unit *Unit
}

TrainCmd describes a train command. Type: TypeTrain, TypeUnitMorph

func (*TrainCmd) Params added in v1.2.0

func (tc *TrainCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Type

type Type struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

Type describes the command type.

func TypeByID

func TypeByID(ID byte) *Type

TypeByID returns the Type for a given ID. A new Type with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type Unit

type Unit struct {
	repcore.Enum

	// ID as it appears in replays
	ID uint16
}

Unit describes the unit.

func UnitByID

func UnitByID(ID uint16) *Unit

UnitByID returns the Unit for a given ID. A new Unit with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type UnitTag

type UnitTag uint16

UnitTag itentifies a unit in the game (engine). Contains its in-game ID and a recycle counter.

func (UnitTag) Index

func (ut UnitTag) Index() uint16

Index returns the unit's tag index (in-game ID).

func (UnitTag) Recycle

func (ut UnitTag) Recycle() byte

Recycle returns the tag resycle.

func (UnitTag) Valid

func (ut UnitTag) Valid() bool

Valid tells if this is a valid unit tag.

type UnloadCmd added in v1.1.2

type UnloadCmd struct {
	*Base

	// UnitTag is the unloaded unit's tag if it's valid.
	UnitTag UnitTag
}

UnloadCmd describes an unload command.

func (*UnloadCmd) Params added in v1.2.0

func (uc *UnloadCmd) Params(verbose bool) string

Params implements Cmd.Params().

type Upgrade

type Upgrade struct {
	repcore.Enum

	// ID as it appears in replays
	ID byte
}

Upgrade describes the upgrade.

func UpgradeByID

func UpgradeByID(ID byte) *Upgrade

UpgradeByID returns the Upgrade for a given ID. A new Upgrade with Unknown name is returned if one is not found for the given ID (preserving the unknown ID).

type UpgradeCmd

type UpgradeCmd struct {
	*Base

	// Upgrade that was started.
	Upgrade *Upgrade
}

UpgradeCmd describes an upgrade command. Type: TypeUpgrade

func (*UpgradeCmd) Params added in v1.2.0

func (uc *UpgradeCmd) Params(verbose bool) string

Params implements Cmd.Params().

type VisionCmd added in v1.4.0

type VisionCmd struct {
	*Base

	// SlotIDs lists slot IDs the owner shared shared vision with
	SlotIDs Bytes
}

VisionCmd describes the share vision command. Type: TypeIDVision

func (*VisionCmd) Params added in v1.4.0

func (vc *VisionCmd) Params(verbose bool) string

Params implements Cmd.Params().

Jump to

Keyboard shortcuts

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