// Token: 0x06001CE3 RID: 7395 RVA: 0x0008698C File Offset: 0x00084B8C private void EnforceDataType(StatDataType otherDataType) { if (this.dataType != otherDataType) { throw new InvalidOperationException(string.Format("Expected data type {0}, got data type {1}.", this.dataType, otherDataType)); } }
// Token: 0x06001CCE RID: 7374 RVA: 0x00086548 File Offset: 0x00084748 private PerEquipmentStatDef(string prefix, StatRecordType recordType, StatDataType dataType, StatDef.DisplayValueFormatterDelegate displayValueFormatter) { this.prefix = prefix; this.recordType = recordType; this.dataType = dataType; this.displayValueFormatter = (displayValueFormatter ?? new StatDef.DisplayValueFormatterDelegate(StatDef.DefaultDisplayValueFormatter)); }
// Token: 0x06001CC4 RID: 7364 RVA: 0x00086278 File Offset: 0x00084478 private PerBodyStatDef(string prefix, StatRecordType recordType, StatDataType dataType, StatDef.DisplayValueFormatterDelegate displayValueFormatter = null) { this.prefix = prefix; this.recordType = recordType; this.dataType = dataType; this.displayValueFormatter = displayValueFormatter; }
public Offset(string name, int offsetInt, StatDataType type, int startingBit = 0, int bitLength = 0) { Name = name; OffsetInt = offsetInt; Type = type; StartingBit = startingBit; BitLength = bitLength; }
// Token: 0x06001C93 RID: 7315 RVA: 0x0007A00C File Offset: 0x0007820C private StatDef(string name, StatRecordType recordType, StatDataType dataType, double pointValue, StatDef.DisplayValueFormatterDelegate displayValueFormatter) { this.name = name; this.recordType = recordType; this.dataType = dataType; this.pointValue = pointValue; this.displayValueFormatter = displayValueFormatter; this.displayToken = "STATNAME_" + name.ToUpper(CultureInfo.InvariantCulture); }
// Token: 0x06001CE9 RID: 7401 RVA: 0x00086AD4 File Offset: 0x00084CD4 public bool IsDefault() { StatDataType dataType = this.dataType; if (dataType != StatDataType.ULong) { return(dataType != StatDataType.Double || this.doubleValue == 0.0); } return(this.ulongValue == 0UL); }
// Token: 0x06001CDD RID: 7389 RVA: 0x000867A4 File Offset: 0x000849A4 public override string ToString() { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { return(TextSerialization.ToStringInvariant(this.value.ulongValue)); } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } return(TextSerialization.ToStringInvariant(this.value.doubleValue)); }
// Token: 0x06001CEB RID: 7403 RVA: 0x00086B4C File Offset: 0x00084D4C public ulong GetPointValue(double pointValue) { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { return((ulong)(this.ulongValue * pointValue)); } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } return((ulong)(this.doubleValue * pointValue)); }
// Token: 0x06001CBB RID: 7355 RVA: 0x0007AE2C File Offset: 0x0007902C public string ToLocalNumeric() { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { return(TextSerialization.ToStringNumeric(this.value.ulongValue)); } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } return(TextSerialization.ToStringNumeric(this.value.doubleValue)); }
// Token: 0x06001CEA RID: 7402 RVA: 0x00086B10 File Offset: 0x00084D10 public void SetDefault() { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { this.ulongValue = 0UL; return; } if (dataType != StatDataType.Double) { throw new NotImplementedException(); } this.doubleValue = 0.0; }
// Token: 0x06001CE2 RID: 7394 RVA: 0x00086950 File Offset: 0x00084B50 public void Read(NetworkReader reader) { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { this.ulongValue = reader.ReadPackedUInt64(); return; } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } this.doubleValue = reader.ReadDouble(); }
// Token: 0x06001CE1 RID: 7393 RVA: 0x00086914 File Offset: 0x00084B14 public void Write(NetworkWriter writer) { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { writer.WritePackedUInt64(this.ulongValue); return; } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } writer.Write(this.doubleValue); }
// Token: 0x06001CE0 RID: 7392 RVA: 0x000868D8 File Offset: 0x00084AD8 public void PushDelta(ref StatField deltaField) { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { this.PushStatValue(deltaField.ulongValue); return; } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } this.PushStatValue(deltaField.doubleValue); }
// Token: 0x06001C96 RID: 7318 RVA: 0x0007A570 File Offset: 0x00078770 public static StatDef Register(string name, StatRecordType recordType, StatDataType dataType, double pointValue, StatDef.DisplayValueFormatterDelegate displayValueFormatter = null) { if (displayValueFormatter == null) { displayValueFormatter = new StatDef.DisplayValueFormatterDelegate(StatDef.DefaultDisplayValueFormatter); } StatDef statDef = new StatDef(name, recordType, dataType, pointValue, displayValueFormatter) { index = StatDef.allStatDefs.Count }; StatDef.allStatDefs.Add(statDef); StatDef.nameToStatDef.Add(statDef.name, statDef); return(statDef); }
public static StatField GetDelta(ref StatField newerValue, ref StatField olderValue) { StatField result = new StatField { statDef = newerValue.statDef }; StatDataType dataType = newerValue.dataType; if (dataType != StatDataType.ULong) { if (dataType == StatDataType.Double) { switch (newerValue.recordType) { case StatRecordType.Sum: result.doubleValue = newerValue.doubleValue - olderValue.doubleValue; break; case StatRecordType.Max: result.doubleValue = Math.Max(newerValue.doubleValue, olderValue.doubleValue); break; case StatRecordType.Newest: result.doubleValue = newerValue.doubleValue; break; } } } else { switch (newerValue.recordType) { case StatRecordType.Sum: result.ulongValue = newerValue.ulongValue - olderValue.ulongValue; break; case StatRecordType.Max: result.ulongValue = Math.Max(newerValue.ulongValue, olderValue.ulongValue); break; case StatRecordType.Newest: result.ulongValue = newerValue.ulongValue; break; } } return(result); }
// Token: 0x06001C99 RID: 7321 RVA: 0x0007A630 File Offset: 0x00078830 public static string DistanceMarathonsDisplayValueFormatter(ref StatField statField) { StatDataType statDataType = statField.dataType; double num; if (statDataType != StatDataType.ULong) { if (statDataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } num = statField.GetDoubleValue(); } else { num = statField.GetULongValue(); } return(string.Format(Language.GetString("STAT_VALUE_MARATHONS_FORMAT"), num * 2.3699E-05)); }
// Token: 0x06001CE6 RID: 7398 RVA: 0x00086A68 File Offset: 0x00084C68 public void SetFromString(string valueString) { StatDataType dataType = this.dataType; if (dataType == StatDataType.ULong) { ulong ulongValue; TextSerialization.TryParseInvariant(valueString, out ulongValue); this.value = ulongValue; return; } if (dataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } double doubleValue; TextSerialization.TryParseInvariant(valueString, out doubleValue); this.value = doubleValue; }
// Token: 0x06001C98 RID: 7320 RVA: 0x0007A5D0 File Offset: 0x000787D0 public static string TimeMMSSDisplayValueFormatter(ref StatField statField) { StatDataType statDataType = statField.dataType; ulong num; if (statDataType != StatDataType.ULong) { if (statDataType != StatDataType.Double) { throw new ArgumentOutOfRangeException(); } num = (ulong)statField.GetDoubleValue(); } else { num = statField.GetULongValue(); } ulong num2 = num / 60UL; ulong num3 = num - num2 * 60UL; return(string.Format("{0:00}:{1:00}", num2, num3)); }
// Token: 0x06001CCA RID: 7370 RVA: 0x00086410 File Offset: 0x00084610 private static PerItemStatDef Register(string prefix, StatRecordType recordType, StatDataType dataType) { PerItemStatDef perItemStatDef = new PerItemStatDef(prefix, recordType, dataType); PerItemStatDef.instancesList.Add(perItemStatDef); return(perItemStatDef); }
// Token: 0x06001CC9 RID: 7369 RVA: 0x000863E4 File Offset: 0x000845E4 private PerItemStatDef(string prefix, StatRecordType recordType, StatDataType dataType) { this.prefix = prefix; this.recordType = recordType; this.dataType = dataType; }
// Token: 0x06001CCF RID: 7375 RVA: 0x00086598 File Offset: 0x00084798 private static PerEquipmentStatDef Register(string prefix, StatRecordType recordType, StatDataType dataType, StatDef.DisplayValueFormatterDelegate displayValueFormatter = null) { PerEquipmentStatDef perEquipmentStatDef = new PerEquipmentStatDef(prefix, recordType, dataType, displayValueFormatter); PerEquipmentStatDef.instancesList.Add(perEquipmentStatDef); return(perEquipmentStatDef); }