github
1314 of 3642 branches covered (36.08%)
Branch coverage included in aggregate %.
17 of 43 new or added lines in 4 files covered. (39.53%)
3138 existing lines in 160 files now uncovered.4965 of 12149 relevant lines covered (40.87%)
5600.46 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)) |
3,544✔ |
11 |
{ |
3,544✔ |
12 |
} |
3,544✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
3,544✔ |
15 |
{ |
3,544✔ |
16 |
OffsetCoords = coords; |
3,544✔ |
17 |
|
|
18 |
var x = coords.X; |
3,544✔ |
19 |
var y = coords.Y; |
3,544✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
3,544✔ |
22 |
} |
3,544✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
2,091,654✔ |
25 |
|
|
26 |
/// <summary>
|
|
27 |
/// Уникальный идентификатор узла в рамках сектора.
|
|
28 |
/// </summary>
|
|
29 |
/// <remarks>
|
|
30 |
/// Нужен только для отладки.
|
|
31 |
/// </remarks>
|
|
32 |
[PublicAPI] |
|
33 |
public int Id { get; set; } |
3,544✔ |
34 |
|
|
35 |
public OffsetCoords OffsetCoords { get; }
|
6,497✔ |
36 |
|
|
37 |
public override string ToString() |
|
UNCOV
38
|
{ |
× |
UNCOV
39
|
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
× |
UNCOV
40
|
} |
× |
41 |
} |
|
42 |
} |