github.com/antihax/goesi@v0.0.0-20240126031043-6c54d0cb7f95/esi/model_get_dogma_effects_effect_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 easyjson315d323dDecodeGithubComAntihaxGoesiEsi(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdOkList) {
    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(GetDogmaEffectsEffectIdOkList, 0, 0)
    31  			} else {
    32  				*out = GetDogmaEffectsEffectIdOkList{}
    33  			}
    34  		} else {
    35  			*out = (*out)[:0]
    36  		}
    37  		for !in.IsDelim(']') {
    38  			var v1 GetDogmaEffectsEffectIdOk
    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 easyjson315d323dEncodeGithubComAntihaxGoesiEsi(out *jwriter.Writer, in GetDogmaEffectsEffectIdOkList) {
    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 GetDogmaEffectsEffectIdOkList) MarshalJSON() ([]byte, error) {
    66  	w := jwriter.Writer{}
    67  	easyjson315d323dEncodeGithubComAntihaxGoesiEsi(&w, v)
    68  	return w.Buffer.BuildBytes(), w.Error
    69  }
    70  
    71  // MarshalEasyJSON supports easyjson.Marshaler interface
    72  func (v GetDogmaEffectsEffectIdOkList) MarshalEasyJSON(w *jwriter.Writer) {
    73  	easyjson315d323dEncodeGithubComAntihaxGoesiEsi(w, v)
    74  }
    75  
    76  // UnmarshalJSON supports json.Unmarshaler interface
    77  func (v *GetDogmaEffectsEffectIdOkList) UnmarshalJSON(data []byte) error {
    78  	r := jlexer.Lexer{Data: data}
    79  	easyjson315d323dDecodeGithubComAntihaxGoesiEsi(&r, v)
    80  	return r.Error()
    81  }
    82  
    83  // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
    84  func (v *GetDogmaEffectsEffectIdOkList) UnmarshalEasyJSON(l *jlexer.Lexer) {
    85  	easyjson315d323dDecodeGithubComAntihaxGoesiEsi(l, v)
    86  }
    87  func easyjson315d323dDecodeGithubComAntihaxGoesiEsi1(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdOk) {
    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 "description":
   107  			out.Description = string(in.String())
   108  		case "disallow_auto_repeat":
   109  			out.DisallowAutoRepeat = bool(in.Bool())
   110  		case "discharge_attribute_id":
   111  			out.DischargeAttributeId = int32(in.Int32())
   112  		case "display_name":
   113  			out.DisplayName = string(in.String())
   114  		case "duration_attribute_id":
   115  			out.DurationAttributeId = int32(in.Int32())
   116  		case "effect_category":
   117  			out.EffectCategory = int32(in.Int32())
   118  		case "effect_id":
   119  			out.EffectId = int32(in.Int32())
   120  		case "electronic_chance":
   121  			out.ElectronicChance = bool(in.Bool())
   122  		case "falloff_attribute_id":
   123  			out.FalloffAttributeId = int32(in.Int32())
   124  		case "icon_id":
   125  			out.IconId = int32(in.Int32())
   126  		case "is_assistance":
   127  			out.IsAssistance = bool(in.Bool())
   128  		case "is_offensive":
   129  			out.IsOffensive = bool(in.Bool())
   130  		case "is_warp_safe":
   131  			out.IsWarpSafe = bool(in.Bool())
   132  		case "modifiers":
   133  			if in.IsNull() {
   134  				in.Skip()
   135  				out.Modifiers = nil
   136  			} else {
   137  				in.Delim('[')
   138  				if out.Modifiers == nil {
   139  					if !in.IsDelim(']') {
   140  						out.Modifiers = make([]GetDogmaEffectsEffectIdModifier, 0, 1)
   141  					} else {
   142  						out.Modifiers = []GetDogmaEffectsEffectIdModifier{}
   143  					}
   144  				} else {
   145  					out.Modifiers = (out.Modifiers)[:0]
   146  				}
   147  				for !in.IsDelim(']') {
   148  					var v4 GetDogmaEffectsEffectIdModifier
   149  					easyjson315d323dDecodeGithubComAntihaxGoesiEsi2(in, &v4)
   150  					out.Modifiers = append(out.Modifiers, v4)
   151  					in.WantComma()
   152  				}
   153  				in.Delim(']')
   154  			}
   155  		case "name":
   156  			out.Name = string(in.String())
   157  		case "post_expression":
   158  			out.PostExpression = int32(in.Int32())
   159  		case "pre_expression":
   160  			out.PreExpression = int32(in.Int32())
   161  		case "published":
   162  			out.Published = bool(in.Bool())
   163  		case "range_attribute_id":
   164  			out.RangeAttributeId = int32(in.Int32())
   165  		case "range_chance":
   166  			out.RangeChance = bool(in.Bool())
   167  		case "tracking_speed_attribute_id":
   168  			out.TrackingSpeedAttributeId = int32(in.Int32())
   169  		default:
   170  			in.SkipRecursive()
   171  		}
   172  		in.WantComma()
   173  	}
   174  	in.Delim('}')
   175  	if isTopLevel {
   176  		in.Consumed()
   177  	}
   178  }
   179  func easyjson315d323dEncodeGithubComAntihaxGoesiEsi1(out *jwriter.Writer, in GetDogmaEffectsEffectIdOk) {
   180  	out.RawByte('{')
   181  	first := true
   182  	_ = first
   183  	if in.Description != "" {
   184  		const prefix string = ",\"description\":"
   185  		first = false
   186  		out.RawString(prefix[1:])
   187  		out.String(string(in.Description))
   188  	}
   189  	if in.DisallowAutoRepeat {
   190  		const prefix string = ",\"disallow_auto_repeat\":"
   191  		if first {
   192  			first = false
   193  			out.RawString(prefix[1:])
   194  		} else {
   195  			out.RawString(prefix)
   196  		}
   197  		out.Bool(bool(in.DisallowAutoRepeat))
   198  	}
   199  	if in.DischargeAttributeId != 0 {
   200  		const prefix string = ",\"discharge_attribute_id\":"
   201  		if first {
   202  			first = false
   203  			out.RawString(prefix[1:])
   204  		} else {
   205  			out.RawString(prefix)
   206  		}
   207  		out.Int32(int32(in.DischargeAttributeId))
   208  	}
   209  	if in.DisplayName != "" {
   210  		const prefix string = ",\"display_name\":"
   211  		if first {
   212  			first = false
   213  			out.RawString(prefix[1:])
   214  		} else {
   215  			out.RawString(prefix)
   216  		}
   217  		out.String(string(in.DisplayName))
   218  	}
   219  	if in.DurationAttributeId != 0 {
   220  		const prefix string = ",\"duration_attribute_id\":"
   221  		if first {
   222  			first = false
   223  			out.RawString(prefix[1:])
   224  		} else {
   225  			out.RawString(prefix)
   226  		}
   227  		out.Int32(int32(in.DurationAttributeId))
   228  	}
   229  	if in.EffectCategory != 0 {
   230  		const prefix string = ",\"effect_category\":"
   231  		if first {
   232  			first = false
   233  			out.RawString(prefix[1:])
   234  		} else {
   235  			out.RawString(prefix)
   236  		}
   237  		out.Int32(int32(in.EffectCategory))
   238  	}
   239  	if in.EffectId != 0 {
   240  		const prefix string = ",\"effect_id\":"
   241  		if first {
   242  			first = false
   243  			out.RawString(prefix[1:])
   244  		} else {
   245  			out.RawString(prefix)
   246  		}
   247  		out.Int32(int32(in.EffectId))
   248  	}
   249  	if in.ElectronicChance {
   250  		const prefix string = ",\"electronic_chance\":"
   251  		if first {
   252  			first = false
   253  			out.RawString(prefix[1:])
   254  		} else {
   255  			out.RawString(prefix)
   256  		}
   257  		out.Bool(bool(in.ElectronicChance))
   258  	}
   259  	if in.FalloffAttributeId != 0 {
   260  		const prefix string = ",\"falloff_attribute_id\":"
   261  		if first {
   262  			first = false
   263  			out.RawString(prefix[1:])
   264  		} else {
   265  			out.RawString(prefix)
   266  		}
   267  		out.Int32(int32(in.FalloffAttributeId))
   268  	}
   269  	if in.IconId != 0 {
   270  		const prefix string = ",\"icon_id\":"
   271  		if first {
   272  			first = false
   273  			out.RawString(prefix[1:])
   274  		} else {
   275  			out.RawString(prefix)
   276  		}
   277  		out.Int32(int32(in.IconId))
   278  	}
   279  	if in.IsAssistance {
   280  		const prefix string = ",\"is_assistance\":"
   281  		if first {
   282  			first = false
   283  			out.RawString(prefix[1:])
   284  		} else {
   285  			out.RawString(prefix)
   286  		}
   287  		out.Bool(bool(in.IsAssistance))
   288  	}
   289  	if in.IsOffensive {
   290  		const prefix string = ",\"is_offensive\":"
   291  		if first {
   292  			first = false
   293  			out.RawString(prefix[1:])
   294  		} else {
   295  			out.RawString(prefix)
   296  		}
   297  		out.Bool(bool(in.IsOffensive))
   298  	}
   299  	if in.IsWarpSafe {
   300  		const prefix string = ",\"is_warp_safe\":"
   301  		if first {
   302  			first = false
   303  			out.RawString(prefix[1:])
   304  		} else {
   305  			out.RawString(prefix)
   306  		}
   307  		out.Bool(bool(in.IsWarpSafe))
   308  	}
   309  	if len(in.Modifiers) != 0 {
   310  		const prefix string = ",\"modifiers\":"
   311  		if first {
   312  			first = false
   313  			out.RawString(prefix[1:])
   314  		} else {
   315  			out.RawString(prefix)
   316  		}
   317  		{
   318  			out.RawByte('[')
   319  			for v5, v6 := range in.Modifiers {
   320  				if v5 > 0 {
   321  					out.RawByte(',')
   322  				}
   323  				easyjson315d323dEncodeGithubComAntihaxGoesiEsi2(out, v6)
   324  			}
   325  			out.RawByte(']')
   326  		}
   327  	}
   328  	if in.Name != "" {
   329  		const prefix string = ",\"name\":"
   330  		if first {
   331  			first = false
   332  			out.RawString(prefix[1:])
   333  		} else {
   334  			out.RawString(prefix)
   335  		}
   336  		out.String(string(in.Name))
   337  	}
   338  	if in.PostExpression != 0 {
   339  		const prefix string = ",\"post_expression\":"
   340  		if first {
   341  			first = false
   342  			out.RawString(prefix[1:])
   343  		} else {
   344  			out.RawString(prefix)
   345  		}
   346  		out.Int32(int32(in.PostExpression))
   347  	}
   348  	if in.PreExpression != 0 {
   349  		const prefix string = ",\"pre_expression\":"
   350  		if first {
   351  			first = false
   352  			out.RawString(prefix[1:])
   353  		} else {
   354  			out.RawString(prefix)
   355  		}
   356  		out.Int32(int32(in.PreExpression))
   357  	}
   358  	if in.Published {
   359  		const prefix string = ",\"published\":"
   360  		if first {
   361  			first = false
   362  			out.RawString(prefix[1:])
   363  		} else {
   364  			out.RawString(prefix)
   365  		}
   366  		out.Bool(bool(in.Published))
   367  	}
   368  	if in.RangeAttributeId != 0 {
   369  		const prefix string = ",\"range_attribute_id\":"
   370  		if first {
   371  			first = false
   372  			out.RawString(prefix[1:])
   373  		} else {
   374  			out.RawString(prefix)
   375  		}
   376  		out.Int32(int32(in.RangeAttributeId))
   377  	}
   378  	if in.RangeChance {
   379  		const prefix string = ",\"range_chance\":"
   380  		if first {
   381  			first = false
   382  			out.RawString(prefix[1:])
   383  		} else {
   384  			out.RawString(prefix)
   385  		}
   386  		out.Bool(bool(in.RangeChance))
   387  	}
   388  	if in.TrackingSpeedAttributeId != 0 {
   389  		const prefix string = ",\"tracking_speed_attribute_id\":"
   390  		if first {
   391  			first = false
   392  			out.RawString(prefix[1:])
   393  		} else {
   394  			out.RawString(prefix)
   395  		}
   396  		out.Int32(int32(in.TrackingSpeedAttributeId))
   397  	}
   398  	out.RawByte('}')
   399  }
   400  
   401  // MarshalJSON supports json.Marshaler interface
   402  func (v GetDogmaEffectsEffectIdOk) MarshalJSON() ([]byte, error) {
   403  	w := jwriter.Writer{}
   404  	easyjson315d323dEncodeGithubComAntihaxGoesiEsi1(&w, v)
   405  	return w.Buffer.BuildBytes(), w.Error
   406  }
   407  
   408  // MarshalEasyJSON supports easyjson.Marshaler interface
   409  func (v GetDogmaEffectsEffectIdOk) MarshalEasyJSON(w *jwriter.Writer) {
   410  	easyjson315d323dEncodeGithubComAntihaxGoesiEsi1(w, v)
   411  }
   412  
   413  // UnmarshalJSON supports json.Unmarshaler interface
   414  func (v *GetDogmaEffectsEffectIdOk) UnmarshalJSON(data []byte) error {
   415  	r := jlexer.Lexer{Data: data}
   416  	easyjson315d323dDecodeGithubComAntihaxGoesiEsi1(&r, v)
   417  	return r.Error()
   418  }
   419  
   420  // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
   421  func (v *GetDogmaEffectsEffectIdOk) UnmarshalEasyJSON(l *jlexer.Lexer) {
   422  	easyjson315d323dDecodeGithubComAntihaxGoesiEsi1(l, v)
   423  }
   424  func easyjson315d323dDecodeGithubComAntihaxGoesiEsi2(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdModifier) {
   425  	isTopLevel := in.IsStart()
   426  	if in.IsNull() {
   427  		if isTopLevel {
   428  			in.Consumed()
   429  		}
   430  		in.Skip()
   431  		return
   432  	}
   433  	in.Delim('{')
   434  	for !in.IsDelim('}') {
   435  		key := in.UnsafeFieldName(false)
   436  		in.WantColon()
   437  		if in.IsNull() {
   438  			in.Skip()
   439  			in.WantComma()
   440  			continue
   441  		}
   442  		switch key {
   443  		case "domain":
   444  			out.Domain = string(in.String())
   445  		case "effect_id":
   446  			out.EffectId = int32(in.Int32())
   447  		case "func":
   448  			out.Func_ = string(in.String())
   449  		case "modified_attribute_id":
   450  			out.ModifiedAttributeId = int32(in.Int32())
   451  		case "modifying_attribute_id":
   452  			out.ModifyingAttributeId = int32(in.Int32())
   453  		case "operator":
   454  			out.Operator = int32(in.Int32())
   455  		default:
   456  			in.SkipRecursive()
   457  		}
   458  		in.WantComma()
   459  	}
   460  	in.Delim('}')
   461  	if isTopLevel {
   462  		in.Consumed()
   463  	}
   464  }
   465  func easyjson315d323dEncodeGithubComAntihaxGoesiEsi2(out *jwriter.Writer, in GetDogmaEffectsEffectIdModifier) {
   466  	out.RawByte('{')
   467  	first := true
   468  	_ = first
   469  	if in.Domain != "" {
   470  		const prefix string = ",\"domain\":"
   471  		first = false
   472  		out.RawString(prefix[1:])
   473  		out.String(string(in.Domain))
   474  	}
   475  	if in.EffectId != 0 {
   476  		const prefix string = ",\"effect_id\":"
   477  		if first {
   478  			first = false
   479  			out.RawString(prefix[1:])
   480  		} else {
   481  			out.RawString(prefix)
   482  		}
   483  		out.Int32(int32(in.EffectId))
   484  	}
   485  	if in.Func_ != "" {
   486  		const prefix string = ",\"func\":"
   487  		if first {
   488  			first = false
   489  			out.RawString(prefix[1:])
   490  		} else {
   491  			out.RawString(prefix)
   492  		}
   493  		out.String(string(in.Func_))
   494  	}
   495  	if in.ModifiedAttributeId != 0 {
   496  		const prefix string = ",\"modified_attribute_id\":"
   497  		if first {
   498  			first = false
   499  			out.RawString(prefix[1:])
   500  		} else {
   501  			out.RawString(prefix)
   502  		}
   503  		out.Int32(int32(in.ModifiedAttributeId))
   504  	}
   505  	if in.ModifyingAttributeId != 0 {
   506  		const prefix string = ",\"modifying_attribute_id\":"
   507  		if first {
   508  			first = false
   509  			out.RawString(prefix[1:])
   510  		} else {
   511  			out.RawString(prefix)
   512  		}
   513  		out.Int32(int32(in.ModifyingAttributeId))
   514  	}
   515  	if in.Operator != 0 {
   516  		const prefix string = ",\"operator\":"
   517  		if first {
   518  			first = false
   519  			out.RawString(prefix[1:])
   520  		} else {
   521  			out.RawString(prefix)
   522  		}
   523  		out.Int32(int32(in.Operator))
   524  	}
   525  	out.RawByte('}')
   526  }