< Summary

Information
Class: Rudim.Common.MoveTypes
Assembly: Rudim
File(s): /home/runner/work/rudim/rudim/Rudim/Common/MoveTypes.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Quiet()100%11100%
get_Capture()100%11100%
get_EnPassant()100%11100%
get_DoublePush()100%11100%
get_KnightPromotion()100%11100%
get_BishopPromotion()100%11100%
get_RookPromotion()100%11100%
get_QueenPromotion()100%11100%
get_KnightPromotionCapture()100%11100%
get_BishopPromotionCapture()100%11100%
get_RookPromotionCapture()100%11100%
get_QueenPromotionCapture()100%11100%
get_Castle()100%11100%

File(s)

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

#LineLine coverage
 1using System;
 2namespace Rudim.Common
 3{
 4    public record MoveType(int Value, Piece Piece = Piece.None, string PromotionChar = "", bool IsCapture = false)
 5    {
 6        public virtual bool Equals(MoveType other) => other?.Value == Value;
 7        public override int GetHashCode() => HashCode.Combine(Value);
 8    }
 9
 10    public static class MoveTypes
 11    {
 4878244912        public static MoveType Quiet { get; } = new(0);
 648096213        public static MoveType Capture { get; } = new(1, Piece.None, null, true);
 1510330514        public static MoveType EnPassant { get; } = new(2, Piece.None, null, true);
 1075173615        public static MoveType DoublePush { get; } = new(3, Piece.None);
 1110369816        public static MoveType KnightPromotion { get; } = new(4, Piece.Knight, "n");
 10206817        public static MoveType BishopPromotion { get; } = new(5, Piece.Bishop, "b");
 10206818        public static MoveType RookPromotion { get; } = new(6, Piece.Rook, "r");
 10206919        public static MoveType QueenPromotion { get; } = new(7, Piece.Queen, "q");
 11204920        public static MoveType KnightPromotionCapture { get; } = new(12, Piece.Knight, "n", true);
 11204921        public static MoveType BishopPromotionCapture { get; } = new(13, Piece.Bishop, "b", true);
 11204922        public static MoveType RookPromotionCapture { get; } = new(14, Piece.Rook, "r", true);
 61645323        public static MoveType QueenPromotionCapture { get; } = new(15, Piece.Queen, "q", true);
 1202922624        public static MoveType Castle { get; } = new(16);
 25    }
 26}