< Summary

Class:GDX.Jobs.ParallelFor.Color32MatchJob
Assembly:GDX
File(s):D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Jobs/ParallelFor/Color32MatchJob.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:53
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%30500%

File(s)

D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Jobs/ParallelFor/Color32MatchJob.cs

#LineLine coverage
 1// Copyright (c) 2020-2022 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="Color32"/>s in the provided <see cref="Unity.Collections.NativeArray{T}" />s ma
 14    ///     parallel.
 15    /// </summary>
 16    [BurstCompile]
 17    public struct Color32MatchJob : IJobParallelFor
 18    {
 19        /// <summary>
 20        ///     The left-hand side <see cref="Unity.Collections.NativeArray{T}" /> typed as <see cref="byte" />.
 21        /// </summary>
 22        [ReadOnly] public NativeArray<Color32> A;
 23
 24        /// <summary>
 25        ///     The right-hand side <see cref="Unity.Collections.NativeArray{T}" /> typed as <see cref="byte" />.
 26        /// </summary>
 27        [ReadOnly] public NativeArray<Color32> B;
 28
 29        /// <summary>
 30        ///     Does the color match?
 31        /// </summary>
 32        [WriteOnly] public NativeArray<bool> Match;
 33
 34        /// <summary>
 35        /// Executable work for the provided index.
 36        /// </summary>
 37        /// <param name="index">The index of the Parallel for loop at which to perform work.</param>
 38        public void Execute(int index)
 039        {
 040            if (A[index].r == B[index].r &&
 41                A[index].g == B[index].g &&
 42                A[index].b == B[index].b &&
 43                A[index].a == B[index].a)
 044            {
 045                Match[index] = true;
 046            }
 47            else
 048            {
 049                Match[index] = false;
 050            }
 051        }
 52    }
 53}

Methods/Properties

Execute(System.Int32)