public override int GetHashCode() { unchecked { return(((StringProp != null ? StringProp.GetHashCode() : 0) * 397) ^ IntProp); } }
public override int GetHashCode() { unchecked { var hashCode = (StringProp != null ? StringProp.GetHashCode() : 0); hashCode = (hashCode * 397) ^ LongProp.GetHashCode(); hashCode = (hashCode * 397) ^ (RefProp != null ? RefProp.GetHashCode() : 0); return(hashCode); } }
public string AddString(string str) { if (!StringMap.TryGetValue(str, out var prop)) { prop = new StringProp(); prop.ConstIndex = ++CurrConstIndex; StringMap.Add(str, prop); } return(GetConstName(prop.ConstIndex)); }
public override int GetHashCode() { unchecked { var hashCode = (StringProp != null ? StringProp.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Int32Prop; hashCode = (hashCode * 397) ^ BoolProp.GetHashCode(); hashCode = (hashCode * 397) ^ NullableInt32PropNoValue.GetHashCode(); hashCode = (hashCode * 397) ^ NullableInt32PropHasValue.GetHashCode(); hashCode = (hashCode * 397) ^ (Else != null ? Else.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked { int result = (StringProp != null ? StringProp.GetHashCode() : 0); result = (result * 397) ^ IntProp; result = (result * 397) ^ DoubleProp.GetHashCode(); result = (result * 397) ^ BoolProp.GetHashCode(); result = (result * 397) ^ (ReadOnlyProp != null ? ReadOnlyProp.GetHashCode() : 0); result = (result * 397) ^ (WriteOnlyProp != null ? WriteOnlyProp.GetHashCode() : 0); result = (result * 397) ^ (IgnoreProp != null ? IgnoreProp.GetHashCode() : 0); result = (result * 397) ^ EnumProp.GetHashCode(); result = (result * 397) ^ MappedProp; result = (result * 397) ^ Field?.GetHashCode() ?? 0; return(result); } }
private string StringToUnitName(string str) { StringProp prop = StringMap[str]; if (prop.UnitIndex == 0) { prop.UnitIndex = CurrUnitIndex; CurrAccLength += str.Length; if (CurrAccLength > 3000) { CurrAccLength = 0; ++CurrUnitIndex; } } return(GetUnitName(prop.UnitIndex)); }
private string GenStringCode(List <string> strList, uint strTypeID) { CodePrinter prt = new CodePrinter(); foreach (string str in strList) { StringProp prop = StringMap[str]; string strAry = StringToArrayOrRaw(str, out bool isRaw); prt.AppendFormatLine("// {0}", EscapeString(str)); prt.AppendFormatLine("static const struct {{ cls_Object obj; int32_t len; {5} str[{0}]; }} {1} {{ {{{2}}}, {3}, {4} }};", str.Length + 1, GetConstName(prop.ConstIndex), strTypeID, str.Length, strAry, isRaw ? "char16_t" : "uint16_t"); } return(prt.ToString()); }