github
2051 of 3728 branches covered (55.02%)
Branch coverage included in aggregate %.
5 of 33 new or added lines in 2 files covered. (15.15%)
1976 existing lines in 246 files now uncovered.8502 of 12814 relevant lines covered (66.35%)
68345.79 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)) |
5,910✔ |
11 |
{ |
5,910✔ |
12 |
} |
5,910✔ |
13 |
|
|
14 |
public HexNode(OffsetCoords coords)
|
5,910✔ |
15 |
{ |
5,910✔ |
16 |
OffsetCoords = coords; |
5,910✔ |
17 |
|
|
18 |
var x = coords.X; |
5,910✔ |
19 |
var y = coords.Y; |
5,910✔ |
20 |
|
|
21 |
CubeCoords = HexHelper.ConvertToCube(x, y); |
5,910✔ |
22 |
} |
5,910✔ |
23 |
|
|
24 |
public CubeCoords CubeCoords { get; }
|
22,205,181✔ |
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; }
|
889,018✔ |
36 |
|
|
37 |
public override string ToString() |
|
38 |
{ |
6,156✔ |
39 |
return $"(X: {OffsetCoords.X}, Y: {OffsetCoords.Y})"; |
6,156✔ |
40 |
} |
6,156✔ |
41 |
} |
|
42 |
} |