Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = AbovePhreaticLevel.GetHashCode();
         hashCode = (hashCode * 397) ^ BelowPhreaticLevel.GetHashCode();
         hashCode = (hashCode * 397) ^ Cohesion.GetHashCode();
         hashCode = (hashCode * 397) ^ FrictionAngle.GetHashCode();
         hashCode = (hashCode * 397) ^ ShearStrengthRatio.GetHashCode();
         hashCode = (hashCode * 397) ^ StrengthIncreaseExponent.GetHashCode();
         hashCode = (hashCode * 397) ^ Pop.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #2
0
 private bool Equals(MacroStabilityInwardsSoilLayerData other)
 {
     return(string.Equals(materialName, other.materialName, StringComparison.InvariantCulture) &&
            IsAquifer == other.IsAquifer &&
            Color.ToArgb().Equals(other.Color.ToArgb()) &&
            UsePop == other.UsePop &&
            ShearStrengthModel == other.ShearStrengthModel &&
            AbovePhreaticLevel.Equals(other.AbovePhreaticLevel) &&
            BelowPhreaticLevel.Equals(other.BelowPhreaticLevel) &&
            Cohesion.Equals(other.Cohesion) &&
            FrictionAngle.Equals(other.FrictionAngle) &&
            ShearStrengthRatio.Equals(other.ShearStrengthRatio) &&
            StrengthIncreaseExponent.Equals(other.StrengthIncreaseExponent) &&
            Pop.Equals(other.Pop));
 }
Beispiel #3
0
        public void Save(string path)
        {
            using (DocumentWriter dw = new DocumentWriter(path))
            {
                dw.WriteLine($"{Name}", "Name of car");

                dw.WriteLine();

                dw.WriteLine("START OF DRIVABLE STUFF");
                dw.WriteLine($"{DriversHeadOffset.X},{DriversHeadOffset.Y},{DriversHeadOffset.Z}", "Offset of driver's head in 3D space");
                dw.WriteLine($"{DriversHeadTurnAngles.X},{DriversHeadTurnAngles.Y}", "Angles to turn to make head go left and right");
                dw.WriteLine($"{MirrorCamera.X},{MirrorCamera.Y},{MirrorCamera.Z},{MirrorCamera.W}", "Offset of 'mirror camera' in 3D space, viewing angle of mirror");
                dw.WriteLine($"{string.Join(",", PratcamBorders)}", "Pratcam border names (left, top, right, bottom)");
                dw.WriteLine("END OF DRIVABLE STUFF");

                dw.WriteLine();

                dw.WriteLine($"{string.Join(",", EngineNoises)}", "Engine noise (normal, enclosed space, underwater)");
                dw.WriteLine($"{(Stealworthy ? "stealworthy" : "")}", "Can be stolen");

                dw.WriteLine();

                foreach (ImpactSpec impactSpec in new List <ImpactSpec> {
                    ImpactTop, ImpactBottom, ImpactLeft, ImpactRight, ImpactFront, ImpactBack
                })
                {
                    dw.WriteLine($"// Damage info for {impactSpec.Description} impacts");
                    dw.WriteLine($"{impactSpec.Clauses.Count}", "Number of clauses");

                    foreach (ImpactSpecClause clause in impactSpec.Clauses)
                    {
                        dw.WriteLine($"{clause.Clause}", "Condition");
                        dw.WriteLine($"{clause.Systems.Count}", "Systems count");

                        foreach (ImpactSpecClauseSystem system in clause.Systems)
                        {
                            dw.WriteLine($"{system.Part},{system.Damage:F1}", "Damage");
                        }
                    }
                }

                dw.WriteLine();

                dw.WriteLine($"{string.Join(",", GridImages)}", "Grid image (opponent, frank, annie)");

                dw.WriteLine();

                dw.WriteLine($"{PixelmapsLoMem.Count}", "Number of pixelmap files for this car");
                foreach (string pixelmap in PixelmapsLoMem)
                {
                    dw.WriteLine($"{pixelmap}");
                }
                dw.WriteLine($"{PixelmapsLoRes.Count}", "Number of pixelmap files for this car");
                foreach (string pixelmap in PixelmapsLoRes)
                {
                    dw.WriteLine($"{pixelmap}");
                }
                dw.WriteLine($"{PixelmapsHiRes.Count}", "Number of pixelmap files for this car");
                foreach (string pixelmap in PixelmapsHiRes)
                {
                    dw.WriteLine($"{pixelmap}");
                }

                dw.WriteLine($"{ShadeTables.Count}", "Number of shadetable files for this car");
                foreach (string shadetable in ShadeTables)
                {
                    dw.WriteLine($"{shadetable}");
                }

                dw.WriteLine($"{MaterialsLoMem.Count}", "Number of material files for this car");
                foreach (string material in MaterialsLoMem)
                {
                    dw.WriteLine($"{material}");
                }
                dw.WriteLine($"{MaterialsLoRes.Count}", "Number of material files for this car");
                foreach (string material in MaterialsLoRes)
                {
                    dw.WriteLine($"{material}");
                }
                dw.WriteLine($"{MaterialsHiRes.Count}", "Number of material files for this car");
                foreach (string material in MaterialsHiRes)
                {
                    dw.WriteLine($"{material}");
                }

                dw.WriteLine($"{Models.Count}", "Number of model files for this car");
                foreach (string model in Models)
                {
                    dw.WriteLine($"{model}");
                }

                dw.WriteLine($"{Actors.Count}", "Number of alternative actors");
                for (int i = 0; i < Actors.Count; i++)
                {
                    dw.WriteLine($"{ActorLODs[i]},{Actors[i]}", "Minimum distance away, actor name");
                }

                dw.WriteLine();

                dw.WriteLine($"{ReflectiveScreenMaterial}", "Name of reflective screen material (or none if non-reflective)");

                dw.WriteLine();

                dw.WriteLine($"{SteerableWheels.Count}", "Number of steerable wheels");
                foreach (int steerableWheel in SteerableWheels)
                {
                    dw.WriteLine($"{steerableWheel}", "GroovyFunkRef of nth steerable wheel");
                }

                dw.WriteLine();

                dw.WriteLine($"{string.Join(",", LeftFrontSuspension)}", "Left-front suspension parts GroovyFunkRef");
                dw.WriteLine($"{string.Join(",", RightFrontSuspension)}", "Right-front suspension parts GroovyFunkRef");
                dw.WriteLine($"{string.Join(",", LeftRearSuspension)}", "Left-rear suspension parts GroovyFunkRef");
                dw.WriteLine($"{string.Join(",", RightRearSuspension)}", "Right-rear suspension parts GroovyFunkRef");

                dw.WriteLine();

                dw.WriteLine($"{string.Join(",", DrivenWheels)}", "Driven wheels GroovyFunkRefs (for spinning) - MUST BE 4 ITEMS");
                dw.WriteLine($"{string.Join(",", NonDrivenWheels)}", "Non-driven wheels GroovyFunkRefs (for spinning) - MUST BE 4 ITEMS");

                dw.WriteLine();

                dw.WriteLine($"{DrivenWheelDiameter}", "Driven wheels diameter");
                dw.WriteLine($"{NonDrivenWheelDiameter}", "Non-driven wheels diameter");

                dw.WriteLine();

                dw.WriteLine("START OF FUNK");

                for (int i = 0; i < Funks.Count; i++)
                {
                    Funk funk = Funks[i];

                    dw.WriteLine($"{funk.Material}");
                    dw.WriteLine($"{funk.Mode}");
                    dw.WriteLine($"{funk.MatrixModType}");
                    if (funk.MatrixModType != FunkMatrixMode.None)
                    {
                        dw.WriteLine($"{funk.MatrixModMode}");
                    }

                    switch (funk.MatrixModType)
                    {
                    case FunkMatrixMode.roll:
                        dw.WriteLine($"{funk.RollPeriods.X},{funk.RollPeriods.Y}");
                        break;

                    case FunkMatrixMode.slither:
                        dw.WriteLine($"{funk.SlitherSpeed.X},{funk.SlitherSpeed.Y}");
                        dw.WriteLine($"{funk.SlitherAmount.X},{funk.SlitherAmount.Y}");
                        break;

                    case FunkMatrixMode.spin:
                        dw.WriteLine($"{funk.SpinPeriod}");
                        break;
                    }

                    dw.WriteLine($"{funk.LightingMode}");
                    dw.WriteLine($"{funk.AnimationType}");

                    switch (funk.AnimationType)
                    {
                    case FunkAnimationType.frames:
                        dw.WriteLine($"{funk.Framerate}");
                        dw.WriteLine($"{funk.FrameMode}");

                        switch (funk.FrameMode)
                        {
                        case FrameType.texturebits:
                            dw.WriteLine($"{funk.TextureBitMode}");
                            break;

                        case FrameType.continuous:
                            dw.WriteLine($"{funk.FrameSpeed}");
                            break;
                        }

                        dw.WriteLine($"{funk.Frames.Count}");
                        foreach (string frame in funk.Frames)
                        {
                            dw.WriteLine($"{frame}");
                        }
                        break;
                    }

                    if (i + 1 != Funks.Count)
                    {
                        dw.WriteLine("NEXT FUNK");
                    }
                }

                dw.WriteLine("END OF FUNK");

                dw.WriteLine();

                dw.WriteLine("START OF GROOVE");

                for (int i = 0; i < Grooves.Count; i++)
                {
                    Groove groove = Grooves[i];

                    dw.WriteLine($"{groove.Part}");
                    dw.WriteLine($"{groove.LollipopMode}");
                    dw.WriteLine($"{groove.Mode}");
                    dw.WriteLine($"{groove.PathType}");
                    if (groove.PathType != GroovePathNames.None)
                    {
                        dw.WriteLine($"{groove.PathMode}");
                    }

                    switch (groove.PathType)
                    {
                    case GroovePathNames.straight:
                        dw.WriteLine($"{groove.PathCentre.X},{groove.PathCentre.Y},{groove.PathCentre.Z}");
                        dw.WriteLine($"{groove.PathPeriod}");
                        dw.WriteLine($"{groove.PathDelta.X},{groove.PathDelta.Y},{groove.PathDelta.Z}");
                        break;
                    }

                    dw.WriteLine($"{groove.AnimationType}");
                    if (groove.AnimationType != GrooveAnimation.None)
                    {
                        dw.WriteLine($"{groove.AnimationMode}");
                    }

                    switch (groove.AnimationType)
                    {
                    case GrooveAnimation.rock:
                        dw.WriteLine($"{groove.AnimationPeriod}");
                        dw.WriteLine($"{groove.AnimationCentre.X},{groove.AnimationCentre.Y},{groove.AnimationCentre.Z}");
                        dw.WriteLine($"{groove.AnimationAxis}");
                        dw.WriteLine($"{groove.RockMaxAngle}");
                        break;

                    case GrooveAnimation.shear:
                        dw.WriteLine($"{groove.ShearPeriod.X},{groove.ShearPeriod.Y},{groove.ShearPeriod.Z}");
                        dw.WriteLine($"{groove.AnimationCentre.X},{groove.AnimationCentre.Y},{groove.AnimationCentre.Z}");
                        dw.WriteLine($"{groove.ShearMagnitude.X},{groove.ShearMagnitude.Y},{groove.ShearMagnitude.Z}");
                        break;

                    case GrooveAnimation.spin:
                        dw.WriteLine($"{groove.AnimationPeriod}");
                        dw.WriteLine($"{groove.AnimationCentre.X},{groove.AnimationCentre.Y},{groove.AnimationCentre.Z}");
                        dw.WriteLine($"{groove.AnimationAxis}");
                        break;
                    }

                    if (i + 1 != Grooves.Count)
                    {
                        dw.WriteLine("NEXT GROOVE");
                    }
                }

                dw.WriteLine("END OF GROOVE");

                dw.WriteLine();

                for (int i = 0; i < Actors.Count; i++)
                {
                    Crushes[i].Write(dw);
                }

                dw.WriteLine();

                dw.WriteLine($"START OF MECHANICS STUFF version {MechanicsVersion}");

                dw.WriteLine($"{LRWheelPos.X:F3}, {LRWheelPos.Y:F3}, {LRWheelPos.Z:F3}", "left rear wheel position");
                dw.WriteLine($"{RRWheelPos.X:F3}, {RRWheelPos.Y:F3}, {RRWheelPos.Z:F3}", "right rear");
                dw.WriteLine($"{LFWheelPos.X:F3}, {LFWheelPos.Y:F3}, {LFWheelPos.Z:F3}", "left front wheel position");
                dw.WriteLine($"{RFWheelPos.X:F3}, {RFWheelPos.Y:F3}, {RFWheelPos.Z:F3}", "right front");

                dw.WriteLine($"{CentreOfMass.X}, {CentreOfMass.Y}, {CentreOfMass.Z}", "centre of mass position");

                dw.WriteLine();

                switch (MechanicsVersion)
                {
                case 2:
                    dw.WriteLine($"{BoundingBoxes.Count}", "number of bounding boxes");
                    foreach (BoundingBox box in BoundingBoxes)
                    {
                        box.Write(dw);
                    }
                    break;

                case 3:
                case 4:
                    foreach (BoundingBox box in BoundingBoxes)
                    {
                        box.Write(dw);
                    }

                    dw.WriteLine($"{AdditionalPoints.Count}", "number of extra points  	v. 3");
                    foreach (Vector3 point in AdditionalPoints)
                    {
                        dw.WriteLine($"{point.X},{point.Y},{point.Z}");
                    }
                    break;
                }

                dw.WriteLine();

                dw.WriteLine($"{MinimumTurningCircle}", "min turning circle radius");
                dw.WriteLine($"{SuspensionGive.X:F3}, {SuspensionGive.Y:F3}", "suspension give (forward, back)");
                dw.WriteLine($"{RideHeight}", "ride height (must be more than miny in bounding box )");
                dw.WriteLine($"{DampingFactor}", "damping factor");
                dw.WriteLine($"{Mass}", "mass in tonnes");
                dw.WriteLine($"{SlipFrictionReductionFraction}", "fractional reduction in friction when slipping");
                dw.WriteLine($"{FrictionAngle.X}, {FrictionAngle.Y}{(MechanicsVersion == 4 ? $", {FrictionAngle.Z}" : null)}", "friction angle ( front and rear )");
                dw.WriteLine($"{AngularMomentumProportions.X}, {AngularMomentumProportions.Y}, {AngularMomentumProportions.Z}", "width, height, length for angular momentum calculation");
                dw.WriteLine($"{TractionFractionalMultiplier:F1}", "traction fractional multiplier v. 2");
                dw.WriteLine($"{DownforceToWeightBalanceSpeed}", "speed at which down force = weight v. 2");
                dw.WriteLine($"{BrakeMultiplier:F1}", "brake multiplier, 1 = nomral brakes v. 2");
                dw.WriteLine($"{BrakingStrengthMultiplier:F1}", "increase in brakes per second 1 = normal v. 2");
                dw.WriteLine($"{RollingResistance.X}, {RollingResistance.Y}", "rolling resistance front and back");
                dw.WriteLine($"{NumberOfGears}", "number of gears");
                dw.WriteLine($"{TopGearRedlineSpeed}", "speed at red line in highest gear");
                dw.WriteLine($"{TopGearAcceleration}", "acceleration in highest gear m/s^2 (i.e. engine strength)");

                dw.WriteLine("END OF MECHANICS STUFF");

                dw.WriteLine();

                dw.WriteLine("// Materials for shrapnel");
                dw.WriteLine($"{Shrapnel.Count}", "number of materials");
                foreach (string shrapnel in Shrapnel)
                {
                    dw.WriteLine($"{shrapnel}");
                }

                if (FirePoints.Count > 0)
                {
                    dw.WriteLine();
                    dw.WriteLine("// damage vertices fire point");
                    foreach (int firepoint in FirePoints)
                    {
                        dw.WriteLine($"{firepoint}");
                    }
                }
            }
        }