Documentation ¶
Index ¶
- Constants
- func DecodeRequest(dec Decoder) (interface{}, int, error)
- func DecodeResponse(dec Decoder) (interface{}, int, error)
- func EncodeRequest(enc Encoder, obj interface{}, id int) error
- func EncodeResponse(enc Encoder, obj interface{}, id int) error
- func Register(req, resp interface{})
- func RegisterHandler(reqName string, req interface{}, respName string, resp interface{})
- type Allegiance
- type Any
- type AttackUnitsRequest
- type AttackUnitsResponse
- type BuildRequest
- type BuildResponse
- type BuildingType
- type CloseRequest
- type CollectItemsRequest
- type CollectItemsResponse
- type CreateViewRequest
- type CreateViewResponse
- type CutTreesRequest
- type CutTreesResponse
- type DebugCommandRequest
- type DebugCommandResponse
- type Decoder
- type DesignateRequest
- type DesignateResponse
- type DestroyViewRequest
- type DestroyViewResponse
- type Empty
- type Encoder
- type ExploreLocationRequest
- type ExploreLocationResponse
- type GameType
- type GatherSeedsRequest
- type GatherSeedsResponse
- type Header
- type HighlightRequest
- type HighlightResponse
- type ItemClass
- type ItemViewData
- type JobQueueRequest
- type JobQueueResponse
- type MineLocationRequest
- type MineLocationResponse
- type Point
- type ReadViewBase
- type ReadViewData
- type ReadViewRequest
- type ReadViewResponse
- type Rect
- type SeedFarmRequest
- type SeedFarmResponse
- type StructureType
- type TileFlag
- type UnitClass
- type UnitRace
- type UnitStatsRequest
- type UnitStatsResponse
- type UnitViewData
- type UpdateViewRequest
- type UpdateViewResponse
- type UserFlag
- type ViewHomeRequest
- type ViewHomeResponse
Constants ¶
View Source
const InvalidID uint64 = 0
View Source
const VersionString = "0.0.1"
Variables ¶
This section is empty.
Functions ¶
func DecodeRequest ¶
func DecodeResponse ¶
func EncodeRequest ¶
func EncodeResponse ¶
func RegisterHandler ¶
Types ¶
type AttackUnitsRequest ¶
type AttackUnitsRequest struct {
Units []uint64 `json:"units"`
}
type AttackUnitsResponse ¶
type AttackUnitsResponse Empty
type BuildRequest ¶
type BuildRequest struct { Structure StructureType `json:"structure"` Material ItemClass `json:"material"` Location Rect `json:"location"` }
type BuildResponse ¶
type BuildResponse Empty
type BuildingType ¶
type BuildingType uint8
const ( NoBuilding BuildingType = iota StockpileBuilding SawmillBuilding ButcherShoppBuilding FarmBuilding )
func (BuildingType) String ¶
func (b BuildingType) String() string
type CloseRequest ¶
type CloseRequest Empty
type CollectItemsRequest ¶
type CollectItemsRequest struct {
Items []Point `json:"items"`
}
type CollectItemsResponse ¶
type CollectItemsResponse Empty
type CreateViewRequest ¶
type CreateViewResponse ¶
type CreateViewResponse struct {
ViewID int `json:"view_id"`
}
type CutTreesRequest ¶
type CutTreesRequest struct {
Trees []Point `json:"trees"`
}
type CutTreesResponse ¶
type CutTreesResponse Empty
type DebugCommandRequest ¶
type DebugCommandRequest struct {
Command string `json:"command"`
}
type DebugCommandResponse ¶
type DebugCommandResponse struct {
Error string `json:"error"`
}
type DesignateRequest ¶
type DesignateRequest struct { Building BuildingType `json:"building"` Location Rect `json:"location"` }
type DesignateResponse ¶
type DesignateResponse struct {
Error string `json:"error"`
}
type DestroyViewRequest ¶
type DestroyViewRequest struct {
ViewID int `json:"view_id"`
}
type DestroyViewResponse ¶
type DestroyViewResponse Empty
type ExploreLocationRequest ¶
type ExploreLocationResponse ¶
type ExploreLocationResponse Empty
type GatherSeedsRequest ¶
type GatherSeedsRequest struct {
Seeds []Point `json:"seeds"`
}
type GatherSeedsResponse ¶
type GatherSeedsResponse Empty
type HighlightRequest ¶
type HighlightRequest Empty
type HighlightResponse ¶
type HighlightResponse struct {
Highlight []Point `json:"highlight"`
}
type ItemViewData ¶
type JobQueueRequest ¶
type JobQueueRequest Empty
type JobQueueResponse ¶
type JobQueueResponse struct {
Jobs []string `json:"jobs"`
}
type MineLocationRequest ¶
type MineLocationRequest struct {
Location Point `json:"location"`
}
type MineLocationResponse ¶
type MineLocationResponse struct {
Error string `json:"error"`
}
type ReadViewBase ¶
type ReadViewBase struct { Flags TileFlag `json:"flags"` UserFlags UserFlag `json:"usrflags"` Height uint8 `json:"height"` BuildingType BuildingType `json:"building_type"` StructureType StructureType `json:"structure_type"` StructureMaterial ItemClass `json:"structure_material"` Building uint64 `json:"building"` }
type ReadViewData ¶
type ReadViewData struct { ReadViewBase Units []UnitViewData `json:"units"` Items []ItemViewData `json:"items"` RLE uint8 `json:"rle"` }
type ReadViewRequest ¶
type ReadViewResponse ¶
type ReadViewResponse struct { W uint16 `json:"w"` H uint16 `json:"h"` RLESize uint32 `json:"rle_size"` Data []ReadViewData `json:"data"` }
func (*ReadViewResponse) MarshalBinary ¶
func (rvr *ReadViewResponse) MarshalBinary() ([]byte, error)
func (*ReadViewResponse) UnmarshalBinary ¶
func (rvr *ReadViewResponse) UnmarshalBinary(data []byte) error
func (*ReadViewResponse) UnmarshalJSON ¶
func (rvr *ReadViewResponse) UnmarshalJSON(data []byte) error
type SeedFarmRequest ¶
type SeedFarmRequest struct {
BuildingID uint64 `json:"building_id"`
}
type SeedFarmResponse ¶
type SeedFarmResponse Empty
type StructureType ¶
type StructureType uint8
const ( NoStructure StructureType = iota WallStructure )
func (StructureType) String ¶
func (s StructureType) String() string
type UnitStatsRequest ¶
type UnitStatsRequest struct {
UnitID int `json:"unit_id"`
}
type UnitStatsResponse ¶
type UnitViewData ¶
type UnitViewData struct { ID uint64 `json:"unit_id"` Allegiance Allegiance `json:"allegiance"` Race UnitRace `json:"race"` Class UnitClass `json:"class"` }
type UpdateViewRequest ¶
type UpdateViewResponse ¶
type UpdateViewResponse Empty
type ViewHomeRequest ¶
type ViewHomeRequest struct {
ViewID int `json:"view_id"`
}
type ViewHomeResponse ¶
Click to show internal directories.
Click to hide internal directories.