public HexagonLayer(World world, HexMexCamera camera) : base(camera) { Corners = HexagonHelper.GenerateWorldCorners(CCPoint.Zero, 1).ToArray(); World = world; World.HexagonManager.HexagonRevealed += (hm, h) => Render(); AddChild(DrawNode); Render(); }
public HexagonPosition(int x, int y, int z) { if (x + y + z != 0) { throw new ArgumentException("The sum of all axis has to be 0"); } X = x; Y = y; Z = z; DistanceToOrigin = Max(Abs(x), Max(Abs(y), Abs(z))); WorldPositionRadiusOne = HexagonHelper.CalculateWorldPosition(x, y, z, 1, 0); }