orders

package
v0.0.0-...-0456d50 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(lexemes []*Lexeme) []any

Types

type Abandon

type Abandon struct {
	Line     int
	Location Coordinates // location to be abandoned
	Errors   []error
}

type AssembleFactoryGroup

type AssembleFactoryGroup struct {
	Line        int
	Id          int  // id of unit being ordered
	Quantity    int  // number of units to assemble
	Unit        Unit // factory units to assemble
	Manufacture Unit // product unit to be manufactured
	Errors      []error
}

type AssembleMineGroup

type AssembleMineGroup struct {
	Line      int
	Id        int    // id of unit being ordered
	DepositId string // deposit to assemble mines at
	Quantity  int    // number of units to assemble
	Unit      Unit   // mine units to assemble
	Errors    []error
}

type AssembleUnit

type AssembleUnit struct {
	Line     int
	Id       int  // id of unit being ordered
	Quantity int  // number of units to assemble
	Unit     Unit // unit to assemble
	Errors   []error
}

type Bombard

type Bombard struct {
	Line         int
	Id           int // id of unit being ordered
	PctCommitted int
	TargetId     int // id of unit being attacked
	Errors       []error
}

type Buy

type Buy struct {
	Line     int
	Id       int     // id of unit being ordered
	Quantity int     // number of units to purchase
	Unit     Unit    // unit to sell
	Bid      float64 // bid per unit
	Errors   []error
}

type CheckRebels

type CheckRebels struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	Errors   []error
}

type Claim

type Claim struct {
	Line     int
	Id       int         // id of unit being ordered
	Location Coordinates // location to be claimed
	Errors   []error
}

type ConvertRebels

type ConvertRebels struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	Errors   []error
}

type Coordinates

type Coordinates struct {
	X, Y, Z int
	System  string // suffix for multi-star system, A...Z
	Orbit   int
}

func (Coordinates) String

func (c Coordinates) String() string

type CounterAgents

type CounterAgents struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	Errors   []error
}

type Discharge

type Discharge struct {
	Line       int
	Id         int    // id of unit being ordered
	Quantity   int    // number of units to use
	Profession string // profession to discharge from
	Errors     []error
}

type Draft

type Draft struct {
	Line       int
	Id         int    // id of unit being ordered
	Quantity   int    // number of units to use
	Profession string // profession to draft into
	Errors     []error
}

type ExpandFactoryGroup

type ExpandFactoryGroup struct {
	Line         int
	Id           int    // id of unit being ordered
	FactoryGroup string // factory group to expand
	Quantity     int    // number of units to assemble
	Unit         Unit   // mine units to assemble
	Errors       []error
}

type ExpandMineGroup

type ExpandMineGroup struct {
	Line      int
	Id        int    // id of unit being ordered
	MineGroup string // mine group to expand
	Quantity  int    // number of units to assemble
	Unit      Unit   // mine units to assemble
	Errors    []error
}

type Grant

type Grant struct {
	Line     int
	Location Coordinates // coordinates of system and orbit
	Kind     string      // kind of grant
	TargetId int         // nation to grant
	Errors   []error
}

type InciteRebels

type InciteRebels struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	TargetId int // id of nation to target
	Errors   []error
}

type Invade

type Invade struct {
	Line         int
	Id           int // id of unit being ordered
	PctCommitted int
	TargetId     int // id of unit being attacked
	Errors       []error
}

type Jump

type Jump struct {
	Line     int
	Id       int         // id of unit being ordered
	Location Coordinates // coordinates to move to
	Errors   []error
}

type Kind

type Kind int

Kind is the type of lexeme.

const (
	EOF Kind = iota
	EOL
	COMMA
	DEPOSITID
	FACTGRP
	FLOAT
	INTEGER
	MINEGRP
	PARENCL
	PARENOP
	PERCENTAGE
	POPULATION
	PRODUCT
	QTEXT
	RESEARCH
	RESOURCE
	TECHLEVEL
	TEXT
	UUID
)

enums for Kind

type Lexeme

type Lexeme struct {
	Line    int
	Kind    Kind
	Float   float64
	Integer int
	Text    string
}

func Scan

func Scan(buffer []byte) ([]*Lexeme, error)

func (*Lexeme) String

func (l *Lexeme) String() string

type Move

type Move struct {
	Line   int
	Id     int // id of unit being ordered
	Orbit  int // orbit to move to
	Errors []error
}

type Name

type Name struct {
	Line     int
	Location Coordinates // coordinates of system or orbit to name
	Name     string      // new name for system or orbit
	Errors   []error
}

type NameUnit

type NameUnit struct {
	Line   int
	Id     int    // id of unit being ordered
	Name   string // new name for unit
	Errors []error
}

type News

type News struct {
	Line      int
	Location  Coordinates // location to send news to
	Article   string
	Signature string
	Errors    []error
}

type PayAll

type PayAll struct {
	Line       int
	Profession string  // profession to change pay for
	Rate       float64 // new pay rate
	Errors     []error
}

type PayLocal

type PayLocal struct {
	Line       int
	Id         int     // id of unit being ordered
	Profession string  // profession to change pay for
	Rate       float64 // new pay rate
	Errors     []error
}

type Probe

type Probe struct {
	Line   int
	Id     int // id of unit being ordered
	Orbit  int // orbit to probe
	Errors []error
}

type ProbeSystem

type ProbeSystem struct {
	Line     int
	Id       int         // id of unit being ordered
	Location Coordinates // location to probe
	Errors   []error
}

type Raid

type Raid struct {
	Line         int
	Id           int // id of unit being ordered
	PctCommitted int
	TargetId     int  // id of unit being raided
	TargetUnit   Unit // material to raid
	Errors       []error
}

type RationAll

type RationAll struct {
	Line   int
	Rate   int // new ration percentage
	Errors []error
}

type RationLocal

type RationLocal struct {
	Line   int
	Id     int // id of unit being ordered
	Rate   int // new ration percentage
	Errors []error
}

type RecycleFactoryGroup

type RecycleFactoryGroup struct {
	Line         int
	Id           int    // id of unit being ordered
	FactoryGroup string // factory group to recycle units from
	Quantity     int    // number of units to recycle
	Unit         Unit   // unit to recycle
	Errors       []error
}

type RecycleMineGroup

type RecycleMineGroup struct {
	Line      int
	Id        int    // id of unit being ordered
	MineGroup string // mine group to recycle units from
	Quantity  int    // number of units to recycle
	Unit      Unit   // unit to recycle
	Errors    []error
}

type RecycleUnit

type RecycleUnit struct {
	Line     int
	Id       int  // id of unit being ordered
	Quantity int  // number of units to recycle
	Unit     Unit // unit to recycle
	Errors   []error
}

type RetoolFactoryGroup

type RetoolFactoryGroup struct {
	Line         int
	Id           int    // id of unit being ordered
	FactoryGroup string // factory group to retool
	Unit         Unit   // new unit to manufacture
	Errors       []error
}

type Revoke

type Revoke struct {
	Line     int
	Location Coordinates // coordinates of system and orbit
	Kind     string      // kind of grant
	TargetId int         // nation to grant
	Errors   []error
}

type ScrapFactoryGroup

type ScrapFactoryGroup struct {
	Line         int
	Id           int    // id of unit being ordered
	FactoryGroup string // factory group to scrap units from
	Quantity     int    // number of units to scrap
	Unit         Unit   // unit to scrap
	Errors       []error
}

type ScrapMineGroup

type ScrapMineGroup struct {
	Line      int
	Id        int    // id of unit being ordered
	MineGroup string // mine group to scrap units from
	Quantity  int    // number of units to scrap
	Unit      Unit   // unit to scrap
	Errors    []error
}

type ScrapUnit

type ScrapUnit struct {
	Line     int
	Id       int  // id of unit being ordered
	Quantity int  // number of units to scrap
	Unit     Unit // unit to scrap
	Errors   []error
}

type Secret

type Secret struct {
	Line   int
	Handle string
	Game   string
	Turn   int
	Token  string
	Errors []error
}

type Sell

type Sell struct {
	Line     int
	Id       int     // id of unit being ordered
	Quantity int     // number of units to sell
	Unit     Unit    // unit to sell
	Ask      float64 // ask per unit
	Errors   []error
}

type Setup

type Setup struct {
	Line     int
	Id       int         // id of unit establishing ship or colony
	Location Coordinates // location being set up
	Kind     string      // must be 'colony' or 'ship'
	Action   string      // must be 'transfer'
	Items    []*TransferDetail
	Errors   []error
}

type StealSecrets

type StealSecrets struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	TargetId int // id of nation to target
	Errors   []error
}

type StoreFactoryGroup

type StoreFactoryGroup struct {
	Line         int
	Id           int    // id of unit being ordered
	FactoryGroup string // factory group to store units from
	Quantity     int    // number of units to store
	Unit         Unit   // unit to store
	Errors       []error
}

type StoreMineGroup

type StoreMineGroup struct {
	Line      int
	Id        int    // id of unit being ordered
	MineGroup string // mine group to store units from
	Quantity  int    // number of units to store
	Unit      Unit   // unit to store
	Errors    []error
}

type StoreUnit

type StoreUnit struct {
	Line     int
	Id       int  // id of unit being ordered
	Quantity int  // number of units to store
	Unit     Unit // unit to store
	Errors   []error
}

type SupportAttack

type SupportAttack struct {
	Line         int
	Id           int // id of unit being ordered
	PctCommitted int
	SupportId    int // id of unit being supported
	TargetId     int // id of unit being attacked
	Errors       []error
}

type SupportDefend

type SupportDefend struct {
	Line         int
	Id           int // id of unit being ordered
	SupportId    int // id of unit being supported
	PctCommitted int
	Errors       []error
}

type SuppressAgents

type SuppressAgents struct {
	Line     int
	Id       int // id of unit being ordered
	Quantity int // number of units to use
	TargetId int // id of nation to target
	Errors   []error
}

type Survey

type Survey struct {
	Line   int
	Id     int // id of unit being ordered
	Orbit  int // orbit to survey
	Errors []error
}

type SurveySystem

type SurveySystem struct {
	Line     int
	Id       int         // id of unit being ordered
	Location Coordinates // location to survey
	Errors   []error
}

type Transfer

type Transfer struct {
	Line     int
	Id       int  // id of unit being ordered
	Quantity int  // number of units to transfer
	Unit     Unit // unit to transfer
	TargetId int  // id of unit receiving units
	Errors   []error
}

type TransferDetail

type TransferDetail struct {
	Unit     Unit
	Quantity int
}

func (*TransferDetail) String

func (td *TransferDetail) String() string

type Unit

type Unit struct {
	Name      string // name
	TechLevel int    // optional tech level
}

func (Unit) String

func (u Unit) String() string

type Unknown

type Unknown struct {
	Line    int
	Command string
	Errors  []error
}

Jump to

Keyboard shortcuts

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