github
2073 of 3728 branches covered (55.61%)
Branch coverage included in aggregate %.
5 of 33 new or added lines in 2 files covered. (15.15%)
1893 existing lines in 244 files now uncovered.8612 of 12814 relevant lines covered (67.21%)
294447.88 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)) |
7,267✔ |
11 |
{ |
7,267✔ |
12 |
} |
7,267✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
7,267✔ |
15 |
{ |
7,267✔ |
16 |
OffsetCoords = coords; |
7,267✔ |
17 |
|
|
18 |
var x = coords.X; |
7,267✔ |
19 |
var y = coords.Y; |
7,267✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
7,267✔ |
22 |
} |
7,267✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
39,923,637✔ |
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; }
|
3,633,154✔ |
36 |
|
|
37 |
public override string ToString() |
|
38 |
{ |
21,160✔ |
39 |
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
21,160✔ |
40 |
} |
21,160✔ |
41 |
} |
|
42 |
} |