codies/internal/protocol/protocol_easyjson.go

2462 lines
58 KiB
Go

// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package protocol
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
game "github.com/zikaeroh/codies/internal/game"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol(in *jlexer.Lexer, out *TimeResponse) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "time":
if data := in.Raw(); in.Ok() {
in.AddError((out.Time).UnmarshalJSON(data))
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol(out *jwriter.Writer, in TimeResponse) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"time\":"
out.RawString(prefix[1:])
out.Raw((in.Time).MarshalJSON())
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v TimeResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v TimeResponse) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *TimeResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *TimeResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol1(in *jlexer.Lexer, out *StatsResponse) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "rooms":
out.Rooms = int(in.Int())
case "clients":
out.Clients = int(in.Int())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol1(out *jwriter.Writer, in StatsResponse) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"rooms\":"
out.RawString(prefix[1:])
out.Int(int(in.Rooms))
}
{
const prefix string = ",\"clients\":"
out.RawString(prefix)
out.Int(int(in.Clients))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StatsResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StatsResponse) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StatsResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StatsResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol1(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol2(in *jlexer.Lexer, out *StateWordList) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "name":
out.Name = string(in.String())
case "count":
out.Count = int(in.Int())
case "custom":
out.Custom = bool(in.Bool())
case "enabled":
out.Enabled = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol2(out *jwriter.Writer, in StateWordList) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"name\":"
out.RawString(prefix[1:])
out.String(string(in.Name))
}
{
const prefix string = ",\"count\":"
out.RawString(prefix)
out.Int(int(in.Count))
}
{
const prefix string = ",\"custom\":"
out.RawString(prefix)
out.Bool(bool(in.Custom))
}
{
const prefix string = ",\"enabled\":"
out.RawString(prefix)
out.Bool(bool(in.Enabled))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StateWordList) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StateWordList) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StateWordList) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StateWordList) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol2(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol3(in *jlexer.Lexer, out *StateView) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "team":
out.Team = game.Team(in.Int())
case "neutral":
out.Neutral = bool(in.Bool())
case "bomb":
out.Bomb = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol3(out *jwriter.Writer, in StateView) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"team\":"
out.RawString(prefix[1:])
out.Int(int(in.Team))
}
{
const prefix string = ",\"neutral\":"
out.RawString(prefix)
out.Bool(bool(in.Neutral))
}
{
const prefix string = ",\"bomb\":"
out.RawString(prefix)
out.Bool(bool(in.Bomb))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StateView) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StateView) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StateView) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StateView) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol3(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol4(in *jlexer.Lexer, out *StateTimer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "turnTime":
out.TurnTime = int(in.Int())
case "turnEnd":
if data := in.Raw(); in.Ok() {
in.AddError((out.TurnEnd).UnmarshalJSON(data))
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol4(out *jwriter.Writer, in StateTimer) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"turnTime\":"
out.RawString(prefix[1:])
out.Int(int(in.TurnTime))
}
{
const prefix string = ",\"turnEnd\":"
out.RawString(prefix)
out.Raw((in.TurnEnd).MarshalJSON())
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StateTimer) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StateTimer) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StateTimer) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StateTimer) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol4(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol5(in *jlexer.Lexer, out *StateTile) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "word":
out.Word = string(in.String())
case "revealed":
out.Revealed = bool(in.Bool())
case "view":
if in.IsNull() {
in.Skip()
out.View = nil
} else {
if out.View == nil {
out.View = new(StateView)
}
(*out.View).UnmarshalEasyJSON(in)
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol5(out *jwriter.Writer, in StateTile) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"word\":"
out.RawString(prefix[1:])
out.String(string(in.Word))
}
{
const prefix string = ",\"revealed\":"
out.RawString(prefix)
out.Bool(bool(in.Revealed))
}
{
const prefix string = ",\"view\":"
out.RawString(prefix)
if in.View == nil {
out.RawString("null")
} else {
(*in.View).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StateTile) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StateTile) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StateTile) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StateTile) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol5(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol6(in *jlexer.Lexer, out *StatePlayer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "playerID":
out.PlayerID = string(in.String())
case "nickname":
out.Nickname = string(in.String())
case "spymaster":
out.Spymaster = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol6(out *jwriter.Writer, in StatePlayer) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"playerID\":"
out.RawString(prefix[1:])
out.String(string(in.PlayerID))
}
{
const prefix string = ",\"nickname\":"
out.RawString(prefix)
out.String(string(in.Nickname))
}
{
const prefix string = ",\"spymaster\":"
out.RawString(prefix)
out.Bool(bool(in.Spymaster))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v StatePlayer) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v StatePlayer) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *StatePlayer) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StatePlayer) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol6(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol7(in *jlexer.Lexer, out *State) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "playerID":
out.PlayerID = string(in.String())
case "roomState":
if in.IsNull() {
in.Skip()
out.RoomState = nil
} else {
if out.RoomState == nil {
out.RoomState = new(RoomState)
}
(*out.RoomState).UnmarshalEasyJSON(in)
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol7(out *jwriter.Writer, in State) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"playerID\":"
out.RawString(prefix[1:])
out.String(string(in.PlayerID))
}
{
const prefix string = ",\"roomState\":"
out.RawString(prefix)
if in.RoomState == nil {
out.RawString("null")
} else {
(*in.RoomState).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v State) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v State) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *State) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *State) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol7(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol8(in *jlexer.Lexer, out *ServerNote) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "method":
out.Method = ServerMethod(in.String())
case "params":
if m, ok := out.Params.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in)
} else if m, ok := out.Params.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw())
} else {
out.Params = in.Interface()
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol8(out *jwriter.Writer, in ServerNote) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"method\":"
out.RawString(prefix[1:])
out.String(string(in.Method))
}
{
const prefix string = ",\"params\":"
out.RawString(prefix)
if m, ok := in.Params.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out)
} else if m, ok := in.Params.(json.Marshaler); ok {
out.Raw(m.MarshalJSON())
} else {
out.Raw(json.Marshal(in.Params))
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ServerNote) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol8(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ServerNote) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol8(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ServerNote) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol8(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ServerNote) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol8(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol9(in *jlexer.Lexer, out *RoomState) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "version":
out.Version = int(in.Int())
case "teams":
if in.IsNull() {
in.Skip()
out.Teams = nil
} else {
in.Delim('[')
if out.Teams == nil {
if !in.IsDelim(']') {
out.Teams = make([][]*StatePlayer, 0, 2)
} else {
out.Teams = [][]*StatePlayer{}
}
} else {
out.Teams = (out.Teams)[:0]
}
for !in.IsDelim(']') {
var v1 []*StatePlayer
if in.IsNull() {
in.Skip()
v1 = nil
} else {
in.Delim('[')
if v1 == nil {
if !in.IsDelim(']') {
v1 = make([]*StatePlayer, 0, 8)
} else {
v1 = []*StatePlayer{}
}
} else {
v1 = (v1)[:0]
}
for !in.IsDelim(']') {
var v2 *StatePlayer
if in.IsNull() {
in.Skip()
v2 = nil
} else {
if v2 == nil {
v2 = new(StatePlayer)
}
(*v2).UnmarshalEasyJSON(in)
}
v1 = append(v1, v2)
in.WantComma()
}
in.Delim(']')
}
out.Teams = append(out.Teams, v1)
in.WantComma()
}
in.Delim(']')
}
case "turn":
out.Turn = game.Team(in.Int())
case "winner":
if in.IsNull() {
in.Skip()
out.Winner = nil
} else {
if out.Winner == nil {
out.Winner = new(game.Team)
}
*out.Winner = game.Team(in.Int())
}
case "board":
if in.IsNull() {
in.Skip()
out.Board = nil
} else {
in.Delim('[')
if out.Board == nil {
if !in.IsDelim(']') {
out.Board = make([][]*StateTile, 0, 2)
} else {
out.Board = [][]*StateTile{}
}
} else {
out.Board = (out.Board)[:0]
}
for !in.IsDelim(']') {
var v3 []*StateTile
if in.IsNull() {
in.Skip()
v3 = nil
} else {
in.Delim('[')
if v3 == nil {
if !in.IsDelim(']') {
v3 = make([]*StateTile, 0, 8)
} else {
v3 = []*StateTile{}
}
} else {
v3 = (v3)[:0]
}
for !in.IsDelim(']') {
var v4 *StateTile
if in.IsNull() {
in.Skip()
v4 = nil
} else {
if v4 == nil {
v4 = new(StateTile)
}
(*v4).UnmarshalEasyJSON(in)
}
v3 = append(v3, v4)
in.WantComma()
}
in.Delim(']')
}
out.Board = append(out.Board, v3)
in.WantComma()
}
in.Delim(']')
}
case "wordsLeft":
if in.IsNull() {
in.Skip()
out.WordsLeft = nil
} else {
in.Delim('[')
if out.WordsLeft == nil {
if !in.IsDelim(']') {
out.WordsLeft = make([]int, 0, 8)
} else {
out.WordsLeft = []int{}
}
} else {
out.WordsLeft = (out.WordsLeft)[:0]
}
for !in.IsDelim(']') {
var v5 int
v5 = int(in.Int())
out.WordsLeft = append(out.WordsLeft, v5)
in.WantComma()
}
in.Delim(']')
}
case "lists":
if in.IsNull() {
in.Skip()
out.Lists = nil
} else {
in.Delim('[')
if out.Lists == nil {
if !in.IsDelim(']') {
out.Lists = make([]*StateWordList, 0, 8)
} else {
out.Lists = []*StateWordList{}
}
} else {
out.Lists = (out.Lists)[:0]
}
for !in.IsDelim(']') {
var v6 *StateWordList
if in.IsNull() {
in.Skip()
v6 = nil
} else {
if v6 == nil {
v6 = new(StateWordList)
}
(*v6).UnmarshalEasyJSON(in)
}
out.Lists = append(out.Lists, v6)
in.WantComma()
}
in.Delim(']')
}
case "timer":
if in.IsNull() {
in.Skip()
out.Timer = nil
} else {
if out.Timer == nil {
out.Timer = new(StateTimer)
}
(*out.Timer).UnmarshalEasyJSON(in)
}
case "hideBomb":
out.HideBomb = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol9(out *jwriter.Writer, in RoomState) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
out.Int(int(in.Version))
}
{
const prefix string = ",\"teams\":"
out.RawString(prefix)
if in.Teams == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v7, v8 := range in.Teams {
if v7 > 0 {
out.RawByte(',')
}
if v8 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v9, v10 := range v8 {
if v9 > 0 {
out.RawByte(',')
}
if v10 == nil {
out.RawString("null")
} else {
(*v10).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte(']')
}
}
{
const prefix string = ",\"turn\":"
out.RawString(prefix)
out.Int(int(in.Turn))
}
{
const prefix string = ",\"winner\":"
out.RawString(prefix)
if in.Winner == nil {
out.RawString("null")
} else {
out.Int(int(*in.Winner))
}
}
{
const prefix string = ",\"board\":"
out.RawString(prefix)
if in.Board == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v11, v12 := range in.Board {
if v11 > 0 {
out.RawByte(',')
}
if v12 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v13, v14 := range v12 {
if v13 > 0 {
out.RawByte(',')
}
if v14 == nil {
out.RawString("null")
} else {
(*v14).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte(']')
}
}
{
const prefix string = ",\"wordsLeft\":"
out.RawString(prefix)
if in.WordsLeft == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v15, v16 := range in.WordsLeft {
if v15 > 0 {
out.RawByte(',')
}
out.Int(int(v16))
}
out.RawByte(']')
}
}
{
const prefix string = ",\"lists\":"
out.RawString(prefix)
if in.Lists == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v17, v18 := range in.Lists {
if v17 > 0 {
out.RawByte(',')
}
if v18 == nil {
out.RawString("null")
} else {
(*v18).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
{
const prefix string = ",\"timer\":"
out.RawString(prefix)
if in.Timer == nil {
out.RawString("null")
} else {
(*in.Timer).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"hideBomb\":"
out.RawString(prefix)
out.Bool(bool(in.HideBomb))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RoomState) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol9(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RoomState) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol9(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RoomState) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol9(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RoomState) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol9(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol10(in *jlexer.Lexer, out *RoomResponse) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "id":
if in.IsNull() {
in.Skip()
out.ID = nil
} else {
if out.ID == nil {
out.ID = new(string)
}
*out.ID = string(in.String())
}
case "error":
if in.IsNull() {
in.Skip()
out.Error = nil
} else {
if out.Error == nil {
out.Error = new(string)
}
*out.Error = string(in.String())
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol10(out *jwriter.Writer, in RoomResponse) {
out.RawByte('{')
first := true
_ = first
if in.ID != nil {
const prefix string = ",\"id\":"
first = false
out.RawString(prefix[1:])
out.String(string(*in.ID))
}
if in.Error != nil {
const prefix string = ",\"error\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(*in.Error))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RoomResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol10(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RoomResponse) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol10(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RoomResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol10(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RoomResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol10(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol11(in *jlexer.Lexer, out *RoomRequest) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "roomName":
out.RoomName = string(in.String())
case "roomPass":
out.RoomPass = string(in.String())
case "create":
out.Create = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol11(out *jwriter.Writer, in RoomRequest) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"roomName\":"
out.RawString(prefix[1:])
out.String(string(in.RoomName))
}
{
const prefix string = ",\"roomPass\":"
out.RawString(prefix)
out.String(string(in.RoomPass))
}
{
const prefix string = ",\"create\":"
out.RawString(prefix)
out.Bool(bool(in.Create))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RoomRequest) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol11(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RoomRequest) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol11(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RoomRequest) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol11(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RoomRequest) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol11(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol12(in *jlexer.Lexer, out *RevealParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "row":
out.Row = int(in.Int())
case "col":
out.Col = int(in.Int())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol12(out *jwriter.Writer, in RevealParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"row\":"
out.RawString(prefix[1:])
out.Int(int(in.Row))
}
{
const prefix string = ",\"col\":"
out.RawString(prefix)
out.Int(int(in.Col))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RevealParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol12(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RevealParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol12(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RevealParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol12(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RevealParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol12(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol13(in *jlexer.Lexer, out *RemovePackParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "num":
out.Num = int(in.Int())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol13(out *jwriter.Writer, in RemovePackParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"num\":"
out.RawString(prefix[1:])
out.Int(int(in.Num))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RemovePackParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol13(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemovePackParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol13(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemovePackParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol13(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemovePackParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol13(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol14(in *jlexer.Lexer, out *RandomizeTeamsParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol14(out *jwriter.Writer, in RandomizeTeamsParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RandomizeTeamsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol14(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RandomizeTeamsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol14(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RandomizeTeamsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol14(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RandomizeTeamsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol14(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol15(in *jlexer.Lexer, out *NewGameParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol15(out *jwriter.Writer, in NewGameParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v NewGameParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol15(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v NewGameParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol15(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *NewGameParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol15(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *NewGameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol15(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol16(in *jlexer.Lexer, out *EndTurnParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol16(out *jwriter.Writer, in EndTurnParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EndTurnParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol16(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EndTurnParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol16(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EndTurnParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol16(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EndTurnParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol16(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol17(in *jlexer.Lexer, out *ClientNote) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "method":
out.Method = ClientMethod(in.StringIntern())
case "version":
out.Version = int(in.Int())
case "params":
(out.Params).UnmarshalEasyJSON(in)
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol17(out *jwriter.Writer, in ClientNote) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"method\":"
out.RawString(prefix[1:])
out.String(string(in.Method))
}
{
const prefix string = ",\"version\":"
out.RawString(prefix)
out.Int(int(in.Version))
}
{
const prefix string = ",\"params\":"
out.RawString(prefix)
(in.Params).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ClientNote) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol17(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ClientNote) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol17(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ClientNote) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol17(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ClientNote) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol17(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol18(in *jlexer.Lexer, out *ChangeTurnTimeParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "seconds":
out.Seconds = int(in.Int())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol18(out *jwriter.Writer, in ChangeTurnTimeParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"seconds\":"
out.RawString(prefix[1:])
out.Int(int(in.Seconds))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeTurnTimeParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol18(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeTurnTimeParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol18(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeTurnTimeParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol18(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeTurnTimeParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol18(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol19(in *jlexer.Lexer, out *ChangeTurnModeParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "timed":
out.Timed = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol19(out *jwriter.Writer, in ChangeTurnModeParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"timed\":"
out.RawString(prefix[1:])
out.Bool(bool(in.Timed))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeTurnModeParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol19(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeTurnModeParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol19(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeTurnModeParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol19(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeTurnModeParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol19(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol20(in *jlexer.Lexer, out *ChangeTeamParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "team":
out.Team = game.Team(in.Int())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol20(out *jwriter.Writer, in ChangeTeamParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"team\":"
out.RawString(prefix[1:])
out.Int(int(in.Team))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeTeamParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol20(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeTeamParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol20(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeTeamParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol20(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeTeamParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol20(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol21(in *jlexer.Lexer, out *ChangeRoleParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "spymaster":
out.Spymaster = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol21(out *jwriter.Writer, in ChangeRoleParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"spymaster\":"
out.RawString(prefix[1:])
out.Bool(bool(in.Spymaster))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeRoleParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol21(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeRoleParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol21(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeRoleParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol21(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeRoleParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol21(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol22(in *jlexer.Lexer, out *ChangePackParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "num":
out.Num = int(in.Int())
case "enable":
out.Enable = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol22(out *jwriter.Writer, in ChangePackParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"num\":"
out.RawString(prefix[1:])
out.Int(int(in.Num))
}
{
const prefix string = ",\"enable\":"
out.RawString(prefix)
out.Bool(bool(in.Enable))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangePackParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol22(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangePackParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol22(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangePackParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol22(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangePackParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol22(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol23(in *jlexer.Lexer, out *ChangeNicknameParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "nickname":
out.Nickname = string(in.String())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol23(out *jwriter.Writer, in ChangeNicknameParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"nickname\":"
out.RawString(prefix[1:])
out.String(string(in.Nickname))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeNicknameParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol23(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeNicknameParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol23(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeNicknameParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol23(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeNicknameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol23(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol24(in *jlexer.Lexer, out *ChangeHideBombParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "hideBomb":
out.HideBomb = bool(in.Bool())
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol24(out *jwriter.Writer, in ChangeHideBombParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"hideBomb\":"
out.RawString(prefix[1:])
out.Bool(bool(in.HideBomb))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ChangeHideBombParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol24(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ChangeHideBombParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol24(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ChangeHideBombParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol24(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ChangeHideBombParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol24(l, v)
}
func easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol25(in *jlexer.Lexer, out *AddPacksParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "packs":
if in.IsNull() {
in.Skip()
out.Packs = nil
} else {
in.Delim('[')
if out.Packs == nil {
if !in.IsDelim(']') {
out.Packs = make([]struct {
Name string `json:"name"`
Words []string `json:"words"`
}, 0, 1)
} else {
out.Packs = []struct {
Name string `json:"name"`
Words []string `json:"words"`
}{}
}
} else {
out.Packs = (out.Packs)[:0]
}
for !in.IsDelim(']') {
var v19 struct {
Name string `json:"name"`
Words []string `json:"words"`
}
easyjsonE4425964Decode(in, &v19)
out.Packs = append(out.Packs, v19)
in.WantComma()
}
in.Delim(']')
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol25(out *jwriter.Writer, in AddPacksParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"packs\":"
out.RawString(prefix[1:])
if in.Packs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v20, v21 := range in.Packs {
if v20 > 0 {
out.RawByte(',')
}
easyjsonE4425964Encode(out, v21)
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v AddPacksParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol25(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AddPacksParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonE4425964EncodeGithubComZikaerohCodiesInternalProtocol25(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AddPacksParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol25(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AddPacksParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonE4425964DecodeGithubComZikaerohCodiesInternalProtocol25(l, v)
}
func easyjsonE4425964Decode(in *jlexer.Lexer, out *struct {
Name string `json:"name"`
Words []string `json:"words"`
}) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "name":
out.Name = string(in.String())
case "words":
if in.IsNull() {
in.Skip()
out.Words = nil
} else {
in.Delim('[')
if out.Words == nil {
if !in.IsDelim(']') {
out.Words = make([]string, 0, 4)
} else {
out.Words = []string{}
}
} else {
out.Words = (out.Words)[:0]
}
for !in.IsDelim(']') {
var v22 string
v22 = string(in.String())
out.Words = append(out.Words, v22)
in.WantComma()
}
in.Delim(']')
}
default:
in.AddError(&jlexer.LexerError{
Offset: in.GetPos(),
Reason: "unknown field",
Data: key,
})
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonE4425964Encode(out *jwriter.Writer, in struct {
Name string `json:"name"`
Words []string `json:"words"`
}) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"name\":"
out.RawString(prefix[1:])
out.String(string(in.Name))
}
{
const prefix string = ",\"words\":"
out.RawString(prefix)
if in.Words == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v23, v24 := range in.Words {
if v23 > 0 {
out.RawByte(',')
}
out.String(string(v24))
}
out.RawByte(']')
}
}
out.RawByte('}')
}