public CritterJointLink(int thisID)
 {
     //Debug.Log("CritterJointLink Constructor( " + thisID.ToString() + " )!");
     this.thisNodeID = thisID;
     jointType       = JointType.HingeX; // Default!
     symmetryType    = SymmetryType.None;
 }
Exemple #2
0
 public NiPSBombForce()
 {
     decay        = 0.0f;
     deltaV       = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
     bombObject   = null;
 }
Exemple #3
0
 public NiPSysBombModifier()
 {
     bombObject   = null;
     decay        = 0.0f;
     deltaV       = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
 }
Exemple #4
0
 public NiParticleBomb()
 {
     decay        = 0.0f;
     duration     = 0.0f;
     deltav       = 0.0f;
     start        = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
 }
 public SymmetryTransform(
     string name,
     SymmetryType type,
     Func <Coordinates, Coordinates> transform)
 {
     Name         = name;
     SymmetryType = type;
     _transform   = transform;
 }
Exemple #6
0
 public NiParticleBomb(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Decay        = reader.ReadSingle();
     Duration     = reader.ReadSingle();
     DeltaV       = reader.ReadSingle();
     Start        = reader.ReadSingle();
     DecayType    = (DecayType)reader.ReadUInt32();
     SymmetryType = (SymmetryType)reader.ReadUInt32();
     Position     = reader.Read <Vector3>();
     Direction    = reader.Read <Vector3>();
 }
    public void CopySettingsFromJointLink(CritterJointLink sourceJointLink) {

        this.parentNodeID = sourceJointLink.parentNodeID;
        this.attachDir = sourceJointLink.attachDir;
        this.restAngleDir = sourceJointLink.restAngleDir;
        this.jointLimitPrimary = sourceJointLink.jointLimitPrimary;
        this.jointLimitSecondary = sourceJointLink.jointLimitSecondary;
        this.numberOfRecursions = sourceJointLink.numberOfRecursions;
        this.recursionScalingFactor = sourceJointLink.recursionScalingFactor;
        this.recursionForward = sourceJointLink.recursionForward;
        this.onlyAttachToTailNode = sourceJointLink.onlyAttachToTailNode;
        this.jointType = sourceJointLink.jointType;
        this.symmetryType = sourceJointLink.symmetryType;
    }
 public void CopySettingsFromJointLink(CritterJointLink sourceJointLink)
 {
     this.parentNodeID           = sourceJointLink.parentNodeID;
     this.attachDir              = sourceJointLink.attachDir;
     this.restAngleDir           = sourceJointLink.restAngleDir;
     this.jointLimitPrimary      = sourceJointLink.jointLimitPrimary;
     this.jointLimitSecondary    = sourceJointLink.jointLimitSecondary;
     this.numberOfRecursions     = sourceJointLink.numberOfRecursions;
     this.recursionScalingFactor = sourceJointLink.recursionScalingFactor;
     this.recursionForward       = sourceJointLink.recursionForward;
     this.onlyAttachToTailNode   = sourceJointLink.onlyAttachToTailNode;
     this.jointType              = sourceJointLink.jointType;
     this.symmetryType           = sourceJointLink.symmetryType;
 }
Exemple #9
0
        /// <summary>
        /// Generate a puzzle with the specified information.
        /// </summary>
        /// <param name="max">The maximum hints of the puzzle.</param>
        /// <param name="symmetricalType">
        /// The symmetry type flags. The <see cref="SymmetryType"/> is
        /// a flag type, you can use bit operators to accumulate multiple
        /// symmetrical types such as <c><see cref="AntiDiagonal"/> | <see cref="Diagonal"/></c>,
        /// which means that the solver will generate anti-diagonal type or
        /// diagonal type puzzles.
        /// </param>
        /// <returns>The grid.</returns>
        /// <seealso cref="SymmetryType"/>
        public IReadOnlyGrid Generate(int max, SymmetryType symmetricalType)
        {
            var puzzle   = new StringBuilder(Grid.EmptyString);
            var solution = new StringBuilder(Grid.EmptyString);

            GenerateAnswerGrid(puzzle, solution);

            // Now we remove some digits from the grid.
            var allTypes = from st in EnumEx.GetValues <SymmetryType>()
                           where st != None && symmetricalType.HasFlag(st)
                           select st;
            int count = allTypes.Count();

            if (count == 0)
            {
                allTypes = new[] { None };
            }

            var    tempSb = new StringBuilder(solution.ToString());
            string result;

            do
            {
                var selectedType = allTypes.ElementAt(Rng.Next(count));
                for (int i = 0; i < 81; i++)
                {
                    solution[i] = tempSb[i];
                }

                var totalMap = GridMap.Empty;
                do
                {
                    int cell;
                    do
                    {
                        cell = Rng.Next(0, 81);
                    } while (totalMap[cell]);

                    int r = cell / 9, c = cell % 9;

                    // Get new value of 'last'.
                    var tempMap = GridMap.Empty;
                    foreach (int tCell in selectedType switch
                    {
                        Central => new[] { r * 9 + c, (8 - r) * 9 + 8 - c },
                        Diagonal => new[] { r * 9 + c, c * 9 + r },
                        AntiDiagonal => new[] { r * 9 + c, (8 - c) * 9 + 8 - r },
                        XAxis => new[] { r * 9 + c, (8 - r) * 9 + c },
                        YAxis => new[] { r * 9 + c, r * 9 + 8 - c },
                        DiagonalBoth => new[]
                        {
                            r * 9 + c, c * 9 + r, (8 - c) * 9 + 8 - r, (8 - r) * 9 + 8 - c
                        },
                        AxisBoth => new[]
                        {
                            r * 9 + c, (8 - r) * 9 + c, r * 9 + 8 - c, (8 - r) * 9 + 8 - c
                        },
                        All => new[]
                        {
                            r * 9 + c, r * 9 + (8 - c), (8 - r) * 9 + c, (8 - r) * 9 + (8 - c),
                            c * 9 + r, c * 9 + (8 - r), (8 - c) * 9 + r, (8 - c) * 9 + (8 - r)
                        },
                        None => new[] { r * 9 + c },
                        _ => throw Throwings.ImpossibleCaseWithMessage("You should not add an option that does not contain in the table of symmetrical types.")
                    })
                    {
                        solution[tCell] = '0';
                        totalMap.Add(tCell);
                        tempMap.Add(tCell);
                    }
                } while (81 - totalMap.Count > max);
            } while (!FastSolver.CheckValidity(result = solution.ToString(), out _));
 public CritterJointLink(int thisID) {
     //Debug.Log("CritterJointLink Constructor( " + thisID.ToString() + " )!");
     this.thisNodeID = thisID;
     jointType = JointType.HingeX;  // Default!
     symmetryType = SymmetryType.None;
 }
 public CritterJointLink() {
     //Debug.Log("CritterJointLink Constructor()! NO ID NO ID NO ID NO ID");
     jointType = JointType.HingeX;  // Default!
     symmetryType = SymmetryType.None;
 }
Exemple #12
0
 /// <summary>
 /// Initializes an instance with the specified information.
 /// </summary>
 /// <param name="conclusions">All conclusions.</param>
 /// <param name="views">All views.</param>
 /// <param name="symmetryType">The symmetry type.</param>
 /// <param name="mappingTable">The mapping table.</param>
 public GspTechniqueInfo(
     IReadOnlyList <Conclusion> conclusions, IReadOnlyList <View> views,
     SymmetryType symmetryType, int?[] mappingTable) : base(conclusions, views) =>
     (SymmetryType, MappingTable) = (symmetryType, mappingTable);
 public CritterJointLink()
 {
     //Debug.Log("CritterJointLink Constructor()! NO ID NO ID NO ID NO ID");
     jointType    = JointType.HingeX; // Default!
     symmetryType = SymmetryType.None;
 }
Exemple #14
0
 /// Set the symmetry type for this sparse matrix (default: GENERAL).
 /// A derived class should always support GENERAL (i.e. unsymmetric matrices), but is free
 /// to perform optimizations for symmetric or structurally symmetric matrices.
 public void SetType(SymmetryType type)
 {
     m_type = type;
 }
Exemple #15
0
 public SimpleTiledModelTileConfig(GameObject prefab, SymmetryType symmetry) : base(prefab)
 {
     Weight   = 1;
     Symmetry = symmetry;
 }
Exemple #16
0
 public static string SerializeMetadataEntry(this SymmetryType value)
 => $"{MetadataTokens.Prefix}{MetadataTokens.Symmetry}{value}";