public bool Equals(TestInnerClass other) { return (Prop3.Equals(other.Prop3) && Arr1.SequenceEqual(other.Arr1)); }
public override string ToString() { var ptx1 = Point1X.ToString("0.00000").PadLeft(14); var pty1 = Point1Y.ToString("0.00000").PadLeft(14); var ptx2 = Point2X.ToString("0.00000").PadLeft(14); var pty2 = Point2Y.ToString("0.00000").PadLeft(14); var angle = Angle.ToString("0.00000").PadLeft(14); return $"{Color.ToString().PadLeft(6)}{Prop2.ToString().PadLeft(6)}{Prop3.ToString().PadLeft(6)}{Prop4.ToString().PadLeft(6)}{Prop5.ToString().PadLeft(6)}{Prop6.ToString().PadLeft(6)}{Type.ToString().PadLeft(6)}{Direction.ToString().PadLeft(6)}{ptx1}{pty1}{ptx2}{pty2}{angle}"; }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (Prop1 != null ? Prop1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Prop2; hashCode = (hashCode * 397) ^ Prop3.GetHashCode(); return(hashCode); } }
public bool Equals(DomainObject other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Id == other.Id && Prop1 == other.Prop1 && Prop2 == other.Prop2 && Prop3.Equals(other.Prop3)); }
public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (obj.GetType() != GetType()) { return(false); } var value = obj as AllObjectCollections; if (value == null) { return(false); } return (Prop0 != null && value.Prop0 != null && Prop0.Equals(value.Prop0) && Prop1 != null && value.Prop1 != null && Prop1.Equals(value.Prop1) && Prop2 != null && value.Prop2 != null && Prop2.Equals(value.Prop2) && Prop3 != null && value.Prop3 != null && Prop3.Equals(value.Prop3) && Prop4 != null && value.Prop4 != null && Prop4.Equals(value.Prop4) && Prop5 != null && value.Prop5 != null && Prop5.Equals(value.Prop5) && Prop6 != null && value.Prop6 != null && Prop6.Equals(value.Prop6) && Prop7 != null && value.Prop7 != null && Prop7.Equals(value.Prop7) && Prop8 != null && value.Prop8 != null && Prop8.Equals(value.Prop8) && Prop9 != null && value.Prop9 != null && Prop9.Equals(value.Prop9) && Prop10 != null && value.Prop10 != null && Prop10.Equals(value.Prop10) && Prop11 != null && value.Prop11 != null && Prop11.Equals(value.Prop11)); }
public override int GetHashCode() { unchecked { // Choose large primes to avoid hashing collisions const int HashingBase = (int)2166136261; const int HashingMultiplier = 16777619; int hash = HashingBase; hash = (hash * HashingMultiplier) ^ Prop0.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop1.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop2.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop3.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop4.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop5.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop6.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop7.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop8.GetHashCode(); hash = (hash * HashingMultiplier) ^ Prop9.GetHashCode(); return(hash); } }
public override int GetHashCode() { unchecked { // Choose large primes to avoid hashing collisions const int HashingBase = (int)2166136261; const int HashingMultiplier = 16777619; int hash = HashingBase; hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop0) ? Prop0.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop1) ? Prop1.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop2) ? Prop2.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop3) ? Prop3.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop4) ? Prop4.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop5) ? Prop5.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop6) ? Prop6.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop7) ? Prop7.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop8) ? Prop8.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop9) ? Prop9.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop10) ? Prop10.GetHashCode() : 0); hash = (hash * HashingMultiplier) ^ (!object.ReferenceEquals(null, Prop11) ? Prop11.GetHashCode() : 0); return(hash); } }
public DefensivePropertySet(Prop1 defensiveProp1, Prop2 defensiveProp2, Prop3 defensiveProp3) : base(defensiveProp1, defensiveProp2, defensiveProp3) { }
public static OffensivePropertySet ProcessAttackPropertySet(Prop1 defensiveProp1, Prop2 defensiveProp2, Prop3 defensiveProp3, Prop1 offensiveProp1, Prop2 offensiveProp2, Prop3 offensiveProp3) { double sum1 = 0; double sum2 = 0; double sum3 = 0; var possibleImmunity = false; // + means weak switch (defensiveProp1) { case Prop1.Blunt: if (offensiveProp1 == Prop1.Blade) { sum1++; } if (offensiveProp1 == Prop1.Gun) { sum1--; } if (offensiveProp2 == Prop2.Fire) { sum1--; } if (offensiveProp3 == Prop3.Magical) { sum1++; } break; case Prop1.Blade: if (offensiveProp1 == Prop1.Gun) { sum1++; } if (offensiveProp1 == Prop1.Blunt) { sum1--; } if (offensiveProp2 == Prop2.Earth) { sum1++; } if (offensiveProp3 == Prop3.Kinetical) { sum1--; } break; case Prop1.Gun: if (offensiveProp1 == Prop1.Blunt) { sum1++; } if (offensiveProp1 == Prop1.Blade) { sum1--; } if (offensiveProp2 == Prop2.Water) { sum1++; } if (offensiveProp3 == Prop3.Physical) { sum1--; } if (offensiveProp3 == Prop3.Kinetical) { possibleImmunity = true; sum1 -= ImmunityWeight; } if (offensiveProp2 == Prop2.Fire) { sum1 += BaneWeight; } break; default: break; } switch (defensiveProp2) { case Prop2.Earth: if (offensiveProp2 == Prop2.Fire) { sum2++; } if (offensiveProp2 == Prop2.Water) { sum2--; } if (offensiveProp1 == Prop1.Blade) { sum2--; } if (offensiveProp3 == Prop3.Kinetical) { sum2++; } break; case Prop2.Fire: if (offensiveProp2 == Prop2.Water) { sum2++; } if (offensiveProp2 == Prop2.Earth) { sum2--; } if (offensiveProp1 == Prop1.Blunt) { sum2++; } if (offensiveProp3 == Prop3.Magical) { sum2--; } if (offensiveProp1 == Prop1.Gun) { possibleImmunity = true; sum2 -= ImmunityWeight; } if (offensiveProp3 == Prop3.Kinetical) { sum2 += BaneWeight; } break; case Prop2.Water: if (offensiveProp2 == Prop2.Earth) { sum2++; } if (offensiveProp2 == Prop2.Fire) { sum2--; } if (offensiveProp3 == Prop3.Physical) { sum2++; } if (offensiveProp1 == Prop1.Gun) { sum2--; } break; default: break; } switch (defensiveProp3) { case Prop3.Physical: if (offensiveProp3 == Prop3.Magical) { sum3++; } if (offensiveProp3 == Prop3.Kinetical) { sum3--; } if (offensiveProp2 == Prop2.Water) { sum3--; } if (offensiveProp1 == Prop1.Gun) { sum3++; } break; case Prop3.Magical: if (offensiveProp3 == Prop3.Kinetical) { sum3++; } if (offensiveProp3 == Prop3.Physical) { sum3--; } if (offensiveProp2 == Prop2.Fire) { sum3++; } if (offensiveProp1 == Prop1.Blunt) { sum3--; } break; case Prop3.Kinetical: if (offensiveProp3 == Prop3.Physical) { sum3++; } if (offensiveProp3 == Prop3.Magical) { sum3--; } if (offensiveProp1 == Prop1.Blade) { sum3++; } if (offensiveProp2 == Prop2.Earth) { sum3--; } if (offensiveProp2 == Prop2.Fire) { possibleImmunity = true; sum3 -= ImmunityWeight; } if (offensiveProp1 == Prop1.Gun) { sum3 += BaneWeight; } break; default: break; } var sum = sum1 + sum2 + sum3; var offensivePropertySet = new OffensivePropertySet { Property1 = offensiveProp1, Property2 = offensiveProp2, Property3 = offensiveProp3, TargetPropertyKey = (defensiveProp1, defensiveProp2, defensiveProp3), TargetResistanceValue = Math.Abs(sum) < 1 ? Math.Round(sum, MidpointRounding.AwayFromZero) : sum, TargetIsImmune = possibleImmunity && sum <= -1 }; return(offensivePropertySet); }
public static DefensivePropertySet ProcessAllAttackPropertySets(Prop1 defensiveProp1, Prop2 defensiveProp2, Prop3 defensiveProp3) { var defensivePropertySet = new DefensivePropertySet(defensiveProp1, defensiveProp2, defensiveProp3); foreach (var offensiveProp1 in Prop1Values) { foreach (var offensiveProp2 in Prop2Values) { foreach (var offensiveProp3 in Prop3Values) { var offensivePropertySet = ProcessAttackPropertySet(defensiveProp1, defensiveProp2, defensiveProp3, offensiveProp1, offensiveProp2, offensiveProp3); defensivePropertySet.TargetingOffensiveProperties.Add(offensivePropertySet.GetDictionaryKey(), offensivePropertySet); } } } return(defensivePropertySet); }
public static DefensivePropertySetCollection ProcessDefensivePropertySet(Prop1 defensiveProp1, Prop2 defensiveProp2, Prop3 defensiveProp3) { var defensivePropertySet = ProcessAllAttackPropertySets(defensiveProp1, defensiveProp2, defensiveProp3); return(new DefensivePropertySetCollection(defensivePropertySet)); }
public OffensivePropertySetAverage(Prop1 offensiveProp1, Prop2 offensiveProp2, Prop3 offensiveProp3, IEnumerable <OffensivePropertySet> allOffensiveProperties, IEnumerable <(Prop1 prop1, Prop2 prop2, Prop3 prop3)> allTargetPropertyKeys)
public PropertySet(Prop1 prop1, Prop2 prop2, Prop3 prop3) { this.Property1 = prop1; this.Property2 = prop2; this.Property3 = prop3; }