github
4126 of 7378 branches covered (55.92%)
Branch coverage included in aggregate %.
4 of 20 new or added lines in 2 files covered. (20.0%)
431 existing lines in 64 files now uncovered.6199 of 8856 relevant lines covered (70.0%)
188850.03 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)) |
12,099✔ |
11 |
{ |
6,439✔ |
12 |
} |
12,099✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
12,099✔ |
15 |
{ |
6,439✔ |
16 |
OffsetCoords = coords; |
12,099✔ |
17 |
|
|
18 |
var x = coords.X; |
12,099✔ |
19 |
var y = coords.Y; |
12,099✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
12,099✔ |
22 |
} |
12,099✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
57,060,907✔ |
25 |
|
|
26 |
/// <summary>
|
|
27 |
/// Уникальный идентификатор узла в рамках сектора.
|
|
28 |
/// </summary>
|
|
29 |
/// <remarks>
|
|
30 |
/// Нужен только для отладки.
|
|
31 |
/// </remarks>
|
|
32 |
[PublicAPI] |
|
UNCOV
33
|
public int Id { get; set; } |
× |
34 |
|
|
35 |
public OffsetCoords OffsetCoords { get; }
|
2,428,822✔ |
36 |
|
|
37 |
public override string ToString() |
|
38 |
{ |
15,588✔ |
39 |
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
21,116✔ |
40 |
} |
15,588✔ |
41 |
} |
|
42 |
} |