github.com/antihax/goesi@v0.0.0-20240126031043-6c54d0cb7f95/esi/model_get_universe_graphics_graphic_id_ok_easyjson.go (about) 1 // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. 2 3 package esi 4 5 import ( 6 json "encoding/json" 7 8 easyjson "github.com/mailru/easyjson" 9 jlexer "github.com/mailru/easyjson/jlexer" 10 jwriter "github.com/mailru/easyjson/jwriter" 11 ) 12 13 // suppress unused package warning 14 var ( 15 _ *json.RawMessage 16 _ *jlexer.Lexer 17 _ *jwriter.Writer 18 _ easyjson.Marshaler 19 ) 20 21 func easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi(in *jlexer.Lexer, out *GetUniverseGraphicsGraphicIdOkList) { 22 isTopLevel := in.IsStart() 23 if in.IsNull() { 24 in.Skip() 25 *out = nil 26 } else { 27 in.Delim('[') 28 if *out == nil { 29 if !in.IsDelim(']') { 30 *out = make(GetUniverseGraphicsGraphicIdOkList, 0, 0) 31 } else { 32 *out = GetUniverseGraphicsGraphicIdOkList{} 33 } 34 } else { 35 *out = (*out)[:0] 36 } 37 for !in.IsDelim(']') { 38 var v1 GetUniverseGraphicsGraphicIdOk 39 (v1).UnmarshalEasyJSON(in) 40 *out = append(*out, v1) 41 in.WantComma() 42 } 43 in.Delim(']') 44 } 45 if isTopLevel { 46 in.Consumed() 47 } 48 } 49 func easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi(out *jwriter.Writer, in GetUniverseGraphicsGraphicIdOkList) { 50 if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { 51 out.RawString("null") 52 } else { 53 out.RawByte('[') 54 for v2, v3 := range in { 55 if v2 > 0 { 56 out.RawByte(',') 57 } 58 (v3).MarshalEasyJSON(out) 59 } 60 out.RawByte(']') 61 } 62 } 63 64 // MarshalJSON supports json.Marshaler interface 65 func (v GetUniverseGraphicsGraphicIdOkList) MarshalJSON() ([]byte, error) { 66 w := jwriter.Writer{} 67 easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi(&w, v) 68 return w.Buffer.BuildBytes(), w.Error 69 } 70 71 // MarshalEasyJSON supports easyjson.Marshaler interface 72 func (v GetUniverseGraphicsGraphicIdOkList) MarshalEasyJSON(w *jwriter.Writer) { 73 easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi(w, v) 74 } 75 76 // UnmarshalJSON supports json.Unmarshaler interface 77 func (v *GetUniverseGraphicsGraphicIdOkList) UnmarshalJSON(data []byte) error { 78 r := jlexer.Lexer{Data: data} 79 easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi(&r, v) 80 return r.Error() 81 } 82 83 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 84 func (v *GetUniverseGraphicsGraphicIdOkList) UnmarshalEasyJSON(l *jlexer.Lexer) { 85 easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi(l, v) 86 } 87 func easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi1(in *jlexer.Lexer, out *GetUniverseGraphicsGraphicIdOk) { 88 isTopLevel := in.IsStart() 89 if in.IsNull() { 90 if isTopLevel { 91 in.Consumed() 92 } 93 in.Skip() 94 return 95 } 96 in.Delim('{') 97 for !in.IsDelim('}') { 98 key := in.UnsafeFieldName(false) 99 in.WantColon() 100 if in.IsNull() { 101 in.Skip() 102 in.WantComma() 103 continue 104 } 105 switch key { 106 case "collision_file": 107 out.CollisionFile = string(in.String()) 108 case "graphic_file": 109 out.GraphicFile = string(in.String()) 110 case "graphic_id": 111 out.GraphicId = int32(in.Int32()) 112 case "icon_folder": 113 out.IconFolder = string(in.String()) 114 case "sof_dna": 115 out.SofDna = string(in.String()) 116 case "sof_fation_name": 117 out.SofFationName = string(in.String()) 118 case "sof_hull_name": 119 out.SofHullName = string(in.String()) 120 case "sof_race_name": 121 out.SofRaceName = string(in.String()) 122 default: 123 in.SkipRecursive() 124 } 125 in.WantComma() 126 } 127 in.Delim('}') 128 if isTopLevel { 129 in.Consumed() 130 } 131 } 132 func easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi1(out *jwriter.Writer, in GetUniverseGraphicsGraphicIdOk) { 133 out.RawByte('{') 134 first := true 135 _ = first 136 if in.CollisionFile != "" { 137 const prefix string = ",\"collision_file\":" 138 first = false 139 out.RawString(prefix[1:]) 140 out.String(string(in.CollisionFile)) 141 } 142 if in.GraphicFile != "" { 143 const prefix string = ",\"graphic_file\":" 144 if first { 145 first = false 146 out.RawString(prefix[1:]) 147 } else { 148 out.RawString(prefix) 149 } 150 out.String(string(in.GraphicFile)) 151 } 152 if in.GraphicId != 0 { 153 const prefix string = ",\"graphic_id\":" 154 if first { 155 first = false 156 out.RawString(prefix[1:]) 157 } else { 158 out.RawString(prefix) 159 } 160 out.Int32(int32(in.GraphicId)) 161 } 162 if in.IconFolder != "" { 163 const prefix string = ",\"icon_folder\":" 164 if first { 165 first = false 166 out.RawString(prefix[1:]) 167 } else { 168 out.RawString(prefix) 169 } 170 out.String(string(in.IconFolder)) 171 } 172 if in.SofDna != "" { 173 const prefix string = ",\"sof_dna\":" 174 if first { 175 first = false 176 out.RawString(prefix[1:]) 177 } else { 178 out.RawString(prefix) 179 } 180 out.String(string(in.SofDna)) 181 } 182 if in.SofFationName != "" { 183 const prefix string = ",\"sof_fation_name\":" 184 if first { 185 first = false 186 out.RawString(prefix[1:]) 187 } else { 188 out.RawString(prefix) 189 } 190 out.String(string(in.SofFationName)) 191 } 192 if in.SofHullName != "" { 193 const prefix string = ",\"sof_hull_name\":" 194 if first { 195 first = false 196 out.RawString(prefix[1:]) 197 } else { 198 out.RawString(prefix) 199 } 200 out.String(string(in.SofHullName)) 201 } 202 if in.SofRaceName != "" { 203 const prefix string = ",\"sof_race_name\":" 204 if first { 205 first = false 206 out.RawString(prefix[1:]) 207 } else { 208 out.RawString(prefix) 209 } 210 out.String(string(in.SofRaceName)) 211 } 212 out.RawByte('}') 213 } 214 215 // MarshalJSON supports json.Marshaler interface 216 func (v GetUniverseGraphicsGraphicIdOk) MarshalJSON() ([]byte, error) { 217 w := jwriter.Writer{} 218 easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi1(&w, v) 219 return w.Buffer.BuildBytes(), w.Error 220 } 221 222 // MarshalEasyJSON supports easyjson.Marshaler interface 223 func (v GetUniverseGraphicsGraphicIdOk) MarshalEasyJSON(w *jwriter.Writer) { 224 easyjsonF7263cfaEncodeGithubComAntihaxGoesiEsi1(w, v) 225 } 226 227 // UnmarshalJSON supports json.Unmarshaler interface 228 func (v *GetUniverseGraphicsGraphicIdOk) UnmarshalJSON(data []byte) error { 229 r := jlexer.Lexer{Data: data} 230 easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi1(&r, v) 231 return r.Error() 232 } 233 234 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 235 func (v *GetUniverseGraphicsGraphicIdOk) UnmarshalEasyJSON(l *jlexer.Lexer) { 236 easyjsonF7263cfaDecodeGithubComAntihaxGoesiEsi1(l, v) 237 }