Remove all json tags, simply not needed
This commit is contained in:
parent
075a502103
commit
c94ac68f44
8 changed files with 37 additions and 37 deletions
|
@ -21,8 +21,8 @@ type Accountant interface {
|
||||||
// Account represents a registered user
|
// Account represents a registered user
|
||||||
type Account struct {
|
type Account struct {
|
||||||
// Name simply describes the account and must be unique
|
// Name simply describes the account and must be unique
|
||||||
Name string `json:"name"`
|
Name string
|
||||||
|
|
||||||
// Data represents internal account data
|
// Data represents internal account data
|
||||||
Data map[string]string `json:"data"`
|
Data map[string]string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
|
|
||||||
// SimpleAccountant manages a set of accounts
|
// SimpleAccountant manages a set of accounts
|
||||||
type SimpleAccountant struct {
|
type SimpleAccountant struct {
|
||||||
Accounts map[string]Account `json:"accounts"`
|
Accounts map[string]Account
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSimpleAccountant creates a new accountant
|
// NewSimpleAccountant creates a new accountant
|
||||||
|
|
|
@ -45,14 +45,14 @@ const gRPCport = 9090
|
||||||
|
|
||||||
// Account stores data for an account
|
// Account stores data for an account
|
||||||
type Account struct {
|
type Account struct {
|
||||||
Name string `json:"name"`
|
Name string
|
||||||
Secret string `json:"secret"`
|
Secret string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config is used to store internal data
|
// Config is used to store internal data
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Host string `json:"host,omitempty"`
|
Host string
|
||||||
Account Account `json:"account,omitempty"`
|
Account Account
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigPath returns the configuration path
|
// ConfigPath returns the configuration path
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
// Vector desribes a 3D vector
|
// Vector desribes a 3D vector
|
||||||
type Vector struct {
|
type Vector struct {
|
||||||
X int `json:"x"`
|
X int
|
||||||
Y int `json:"y"`
|
Y int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add adds one vector to another
|
// Add adds one vector to another
|
||||||
|
|
|
@ -11,27 +11,27 @@ import (
|
||||||
// chunk represents a fixed square grid of tiles
|
// chunk represents a fixed square grid of tiles
|
||||||
type chunk struct {
|
type chunk struct {
|
||||||
// Tiles represents the tiles within the chunk
|
// Tiles represents the tiles within the chunk
|
||||||
Tiles []byte `json:"tiles"`
|
Tiles []byte
|
||||||
|
|
||||||
// Objects represents the objects within the chunk
|
// Objects represents the objects within the chunk
|
||||||
// only one possible object per tile for now
|
// only one possible object per tile for now
|
||||||
Objects map[int]Object `json:"objects"`
|
Objects map[int]Object
|
||||||
}
|
}
|
||||||
|
|
||||||
// chunkBasedAtlas represents a grid of Chunks
|
// chunkBasedAtlas represents a grid of Chunks
|
||||||
type chunkBasedAtlas struct {
|
type chunkBasedAtlas struct {
|
||||||
// Chunks represents all chunks in the world
|
// Chunks represents all chunks in the world
|
||||||
// This is intentionally not a 2D array so it can be expanded in all directions
|
// This is intentionally not a 2D array so it can be expanded in all directions
|
||||||
Chunks []chunk `json:"chunks"`
|
Chunks []chunk
|
||||||
|
|
||||||
// LowerBound is the origin of the bottom left corner of the current chunks in world space (current chunks cover >= this value)
|
// LowerBound is the origin of the bottom left corner of the current chunks in world space (current chunks cover >= this value)
|
||||||
LowerBound maths.Vector `json:"lowerBound"`
|
LowerBound maths.Vector
|
||||||
|
|
||||||
// UpperBound is the top left corner of the current chunks (curent chunks cover < this value)
|
// UpperBound is the top left corner of the current chunks (curent chunks cover < this value)
|
||||||
UpperBound maths.Vector `json:"upperBound"`
|
UpperBound maths.Vector
|
||||||
|
|
||||||
// ChunkSize is the x/y dimensions of each square chunk
|
// ChunkSize is the x/y dimensions of each square chunk
|
||||||
ChunkSize int `json:"chunksize"`
|
ChunkSize int
|
||||||
|
|
||||||
// worldGen is the internal world generator
|
// worldGen is the internal world generator
|
||||||
worldGen WorldGen
|
worldGen WorldGen
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
// Object represents an object in the world
|
// Object represents an object in the world
|
||||||
type Object struct {
|
type Object struct {
|
||||||
// The type of the object
|
// The type of the object
|
||||||
Type roveapi.Object `json:"type"`
|
Type roveapi.Object
|
||||||
|
|
||||||
// Data is an internal type used for certain types of object
|
// Data is an internal type used for certain types of object
|
||||||
Data []byte `json:"data"`
|
Data []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsBlocking checks if an object is a blocking object
|
// IsBlocking checks if an object is a blocking object
|
||||||
|
|
|
@ -16,49 +16,49 @@ import (
|
||||||
// RoverLogEntry describes a single log entry for the rover
|
// RoverLogEntry describes a single log entry for the rover
|
||||||
type RoverLogEntry struct {
|
type RoverLogEntry struct {
|
||||||
// Time is the timestamp of the entry
|
// Time is the timestamp of the entry
|
||||||
Time time.Time `json:"time"`
|
Time time.Time
|
||||||
|
|
||||||
// Text contains the information in this log entry
|
// Text contains the information in this log entry
|
||||||
Text string `json:"text"`
|
Text string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rover describes a single rover in the world
|
// Rover describes a single rover in the world
|
||||||
type Rover struct {
|
type Rover struct {
|
||||||
// Unique name of this rover
|
// Unique name of this rover
|
||||||
Name string `json:"name"`
|
Name string
|
||||||
|
|
||||||
// Pos represents where this rover is in the world
|
// Pos represents where this rover is in the world
|
||||||
Pos maths.Vector `json:"pos"`
|
Pos maths.Vector
|
||||||
|
|
||||||
// Bearing is the current direction the rover is facing
|
// Bearing is the current direction the rover is facing
|
||||||
Bearing roveapi.Bearing `json:"bearing"`
|
Bearing roveapi.Bearing
|
||||||
|
|
||||||
// Range represents the distance the unit's radar can see
|
// Range represents the distance the unit's radar can see
|
||||||
Range int `json:"range"`
|
Range int
|
||||||
|
|
||||||
// Inventory represents any items the rover is carrying
|
// Inventory represents any items the rover is carrying
|
||||||
Inventory []Object `json:"inventory"`
|
Inventory []Object
|
||||||
|
|
||||||
// Capacity is the maximum number of inventory items
|
// Capacity is the maximum number of inventory items
|
||||||
Capacity int `json:"capacity"`
|
Capacity int
|
||||||
|
|
||||||
// Integrity represents current rover health
|
// Integrity represents current rover health
|
||||||
Integrity int `json:"integrity"`
|
Integrity int
|
||||||
|
|
||||||
// MaximumIntegrity is the full integrity of the rover
|
// MaximumIntegrity is the full integrity of the rover
|
||||||
MaximumIntegrity int `json:"maximum-integrity"`
|
MaximumIntegrity int
|
||||||
|
|
||||||
// Charge is the amount of energy the rover has
|
// Charge is the amount of energy the rover has
|
||||||
Charge int `json:"charge"`
|
Charge int
|
||||||
|
|
||||||
// MaximumCharge is the maximum charge able to be stored
|
// MaximumCharge is the maximum charge able to be stored
|
||||||
MaximumCharge int `json:"maximum-charge"`
|
MaximumCharge int
|
||||||
|
|
||||||
// SailPosition is the current position of the sails
|
// SailPosition is the current position of the sails
|
||||||
SailPosition roveapi.SailPosition `json:"sail-position"`
|
SailPosition roveapi.SailPosition
|
||||||
|
|
||||||
// Logs Stores log of information
|
// Logs Stores log of information
|
||||||
Logs []RoverLogEntry `json:"logs"`
|
Logs []RoverLogEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultRover returns a default rover object with default settings
|
// DefaultRover returns a default rover object with default settings
|
||||||
|
|
|
@ -16,21 +16,21 @@ type CommandStream []*roveapi.Command
|
||||||
// World describes a self contained universe and everything in it
|
// World describes a self contained universe and everything in it
|
||||||
type World struct {
|
type World struct {
|
||||||
// TicksPerDay is the amount of ticks in a single day
|
// TicksPerDay is the amount of ticks in a single day
|
||||||
TicksPerDay int `json:"ticks-per-day"`
|
TicksPerDay int
|
||||||
|
|
||||||
// Current number of ticks from the start
|
// Current number of ticks from the start
|
||||||
CurrentTicks int `json:"current-ticks"`
|
CurrentTicks int
|
||||||
|
|
||||||
// Rovers is a id->data map of all the rovers in the game
|
// Rovers is a id->data map of all the rovers in the game
|
||||||
Rovers map[string]*Rover `json:"rovers"`
|
Rovers map[string]*Rover
|
||||||
|
|
||||||
// Atlas represends the world map of chunks and tiles
|
// Atlas represends the world map of chunks and tiles
|
||||||
Atlas Atlas `json:"atlas"`
|
Atlas Atlas
|
||||||
|
|
||||||
// Commands is the set of currently executing command streams per rover
|
// Commands is the set of currently executing command streams per rover
|
||||||
CommandQueue map[string]CommandStream `json:"commands"`
|
CommandQueue map[string]CommandStream
|
||||||
// Incoming represents the set of commands to add to the queue at the end of the current tick
|
// Incoming represents the set of commands to add to the queue at the end of the current tick
|
||||||
CommandIncoming map[string]CommandStream `json:"incoming"`
|
CommandIncoming map[string]CommandStream
|
||||||
|
|
||||||
// Mutex to lock around all world operations
|
// Mutex to lock around all world operations
|
||||||
worldMutex sync.RWMutex
|
worldMutex sync.RWMutex
|
||||||
|
|
Loading…
Add table
Reference in a new issue