github
2058 of 3728 branches covered (55.2%)
Branch coverage included in aggregate %.
5 of 33 new or added lines in 2 files covered. (15.15%)
1925 existing lines in 247 files now uncovered.8568 of 12829 relevant lines covered (66.79%)
126110.59 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)) |
6,273✔ |
11 |
{ |
6,273✔ |
12 |
} |
6,273✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
6,273✔ |
15 |
{ |
6,273✔ |
16 |
OffsetCoords = coords; |
6,273✔ |
17 |
|
|
18 |
var x = coords.X; |
6,273✔ |
19 |
var y = coords.Y; |
6,273✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
6,273✔ |
22 |
} |
6,273✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
24,363,688✔ |
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,404,676✔ |
36 |
|
|
37 |
public override string ToString() |
|
38 |
{ |
22,396✔ |
39 |
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
22,396✔ |
40 |
} |
22,396✔ |
41 |
} |
|
42 |
} |