You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
549 B
20 lines
549 B
3 years ago
|
package state
|
||
|
|
||
3 years ago
|
import (
|
||
|
"go.uber.org/zap/zapcore"
|
||
|
)
|
||
3 years ago
|
|
||
3 years ago
|
// StorageCoordinates gives the coordinates of a cell in a form optimized for storage.
|
||
|
type StorageCoordinates struct {
|
||
|
// Line is the index from 0 to Lines - 1 of the HexLine in the HexLayer.
|
||
|
Line uint8 `json:"line"`
|
||
|
// Cell is the index from 0 to CellsPerLine - 1 of the HexCell in the HexLine.
|
||
|
Cell uint8 `json:"cell"`
|
||
|
}
|
||
3 years ago
|
|
||
|
func (s StorageCoordinates) MarshalLogObject(encoder zapcore.ObjectEncoder) error {
|
||
|
encoder.AddUint8("line", s.Line)
|
||
|
encoder.AddUint8("cell", s.Cell)
|
||
|
return nil
|
||
|
}
|