github
1279 of 3642 branches covered (35.12%)
Branch coverage included in aggregate %.
10 of 43 new or added lines in 4 files covered. (23.26%)
3169 existing lines in 162 files now uncovered.4839 of 12149 relevant lines covered (39.83%)
3489.75 hits per line
1 |
using JetBrains.Annotations; |
|
2 |
|
|
3 |
using Zilon.Core.Common;
|
|
4 |
using Zilon.Core.Graphs;
|
|
5 |
|
|
6 |
namespace Zilon.Core.Tactics.Spatial
|
|
7 |
{ |
|
8 |
public class HexNode : IGraphNode |
|
9 |
{ |
|
10 |
public HexNode(int x, int y) : this(new OffsetCoords(x, y)) |
1,544✔ |
11 |
{ |
1,544✔ |
12 |
} |
1,544✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
1,544✔ |
15 |
{ |
1,544✔ |
16 |
OffsetCoords = coords; |
1,544✔ |
17 |
|
|
18 |
var x = coords.X; |
1,544✔ |
19 |
var y = coords.Y; |
1,544✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
1,544✔ |
22 |
} |
1,544✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
835,174✔ |
25 |
|
|
26 |
/// <summary>
|
|
27 |
/// Уникальный идентификатор узла в рамках сектора.
|
|
28 |
/// </summary>
|
|
29 |
/// <remarks>
|
|
30 |
/// Нужен только для отладки.
|
|
31 |
/// </remarks>
|
|
32 |
[PublicAPI] |
|
33 |
public int Id { get; set; } |
1,544✔ |
34 |
|
|
35 |
public OffsetCoords OffsetCoords { get; }
|
3,197✔ |
36 |
|
|
37 |
public override string ToString() |
|
UNCOV
38
|
{ |
× |
UNCOV
39
|
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
× |
UNCOV
40
|
} |
× |
41 |
} |
|
42 |
} |