< Summary

Class:GDX.Jobs.ParallelFor.ColorMatchJob
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Jobs/ParallelFor/ColorMatchJob.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:51
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:1
Method coverage:0% (0 of 1)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Execute(...)0%6200%

File(s)

./Packages/com.dotbunny.gdx/GDX/Jobs/ParallelFor/ColorMatchJob.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5using Unity.Burst;
 6using Unity.Collections;
 7using Unity.Jobs;
 8using UnityEngine;
 9
 10namespace GDX.Jobs.ParallelFor
 11{
 12    /// <summary>
 13    ///     Determines if the <see cref="Color" />s in the provided <see cref="Unity.Collections.NativeArray{T}" />s mat
 14    ///     other in
 15    ///     parallel.
 16    /// </summary>
 17    [BurstCompile]
 18    public struct ColorMatchJob : IJobParallelFor
 19    {
 20        /// <summary>
 21        ///     The left-hand side <see cref="Unity.Collections.NativeArray{T}" /> typed as <see cref="byte" />.
 22        /// </summary>
 23        [ReadOnly] public NativeArray<Color> A;
 24
 25        /// <summary>
 26        ///     The right-hand side <see cref="Unity.Collections.NativeArray{T}" /> typed as <see cref="byte" />.
 27        /// </summary>
 28        [ReadOnly] public NativeArray<Color> B;
 29
 30        /// <summary>
 31        ///     Does the color match?
 32        /// </summary>
 33        [WriteOnly] public NativeArray<bool> Match;
 34
 35        /// <summary>
 36        ///     Executable work for the provided index.
 37        /// </summary>
 38        /// <param name="index">The index of the Parallel for loop at which to perform work.</param>
 39        public void Execute(int index)
 040        {
 041            if (A[index] != B[index])
 042            {
 043                Match[index] = false;
 044            }
 45            else
 046            {
 047                Match[index] = true;
 048            }
 049        }
 50    }
 51}

Methods/Properties

Execute(System.Int32)