< Summary

Information
Class: Rudim.Common.MoveType
Assembly: Rudim
File(s): /home/runner/work/rudim/rudim/Rudim/Common/MoveTypes.cs
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 26
Line coverage: 66.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Value()100%11100%
Equals(...)50%22100%
GetHashCode()100%210%

File(s)

/home/runner/work/rudim/rudim/Rudim/Common/MoveTypes.cs

#LineLine coverage
 1using System;
 2namespace Rudim.Common
 3{
 1602554494    public record MoveType(int Value, Piece Piece = Piece.None, string PromotionChar = "", bool IsCapture = false)
 5    {
 322082256        public virtual bool Equals(MoveType other) => other?.Value == Value;
 07        public override int GetHashCode() => HashCode.Combine(Value);
 8    }
 9
 10    public static class MoveTypes
 11    {
 12        public static MoveType Quiet { get; } = new(0);
 13        public static MoveType Capture { get; } = new(1, Piece.None, null, true);
 14        public static MoveType EnPassant { get; } = new(2, Piece.None, null, true);
 15        public static MoveType DoublePush { get; } = new(3, Piece.None);
 16        public static MoveType KnightPromotion { get; } = new(4, Piece.Knight, "n");
 17        public static MoveType BishopPromotion { get; } = new(5, Piece.Bishop, "b");
 18        public static MoveType RookPromotion { get; } = new(6, Piece.Rook, "r");
 19        public static MoveType QueenPromotion { get; } = new(7, Piece.Queen, "q");
 20        public static MoveType KnightPromotionCapture { get; } = new(12, Piece.Knight, "n", true);
 21        public static MoveType BishopPromotionCapture { get; } = new(13, Piece.Bishop, "b", true);
 22        public static MoveType RookPromotionCapture { get; } = new(14, Piece.Rook, "r", true);
 23        public static MoveType QueenPromotionCapture { get; } = new(15, Piece.Queen, "q", true);
 24        public static MoveType Castle { get; } = new(16);
 25    }
 26}