Version 3.0.338

This commit is contained in:
Anja Müller-Meißner 2022-09-06 16:08:19 +02:00 committed by Anja
parent 573fe77e12
commit 0468955d49
751 changed files with 62747 additions and 60672 deletions

View file

@ -1,14 +1,14 @@
namespace TINK.Model.Map
{
public interface IMapSpan
{
/// <summary> Center of map displayed area.</summary>
IPosition Center { get; }
public interface IMapSpan
{
/// <summary> Center of map displayed area.</summary>
IPosition Center { get; }
/// <summary> Radius of displayed map area. </summary>
double Radius { get; }
/// <summary> Radius of displayed map area. </summary>
double Radius { get; }
/// <summary> Gets if map span is valid or not. </summary>
bool IsValid { get; }
}
/// <summary> Gets if map span is valid or not. </summary>
bool IsValid { get; }
}
}

View file

@ -2,29 +2,29 @@
namespace TINK.Model.Map
{
/// <summary> Holds the displayed map area. </summary>
public class MapSpan : IMapSpan
{
internal MapSpan(IPosition center, double radius)
{
if (!GetIsValid(center, radius))
throw new ArgumentNullException();
/// <summary> Holds the displayed map area. </summary>
public class MapSpan : IMapSpan
{
internal MapSpan(IPosition center, double radius)
{
if (!GetIsValid(center, radius))
throw new ArgumentNullException();
Center = center;
Radius = radius;
}
Center = center;
Radius = radius;
}
/// <summary> Center of map displayed area.</summary>
public IPosition Center { get; }
/// <summary> Center of map displayed area.</summary>
public IPosition Center { get; }
/// <summary> Radius of displayed map area. </summary>
public double Radius { get; }
/// <summary> Radius of displayed map area. </summary>
public double Radius { get; }
public bool IsValid => GetIsValid(Center, Radius);
public bool IsValid => GetIsValid(Center, Radius);
public static bool GetIsValid(IPosition center, double radius)
=> center != null
&& center.IsValid
&& !double.IsNaN(radius);
}
public static bool GetIsValid(IPosition center, double radius)
=> center != null
&& center.IsValid
&& !double.IsNaN(radius);
}
}

View file

@ -1,11 +1,11 @@

namespace TINK.Model.Map
{
public static class MapSpanFactory
{
public static IMapSpan Create(IPosition position = null, double radius = double.NaN)
=> MapSpan.GetIsValid(position, radius)
? new MapSpan(position, radius) as IMapSpan
: new NullMapSpan();
}
public static class MapSpanFactory
{
public static IMapSpan Create(IPosition position = null, double radius = double.NaN)
=> MapSpan.GetIsValid(position, radius)
? new MapSpan(position, radius) as IMapSpan
: new NullMapSpan();
}
}

View file

@ -1,16 +1,16 @@

namespace TINK.Model.Map
{
public class NullMapSpan : IMapSpan
{
internal NullMapSpan() { }
public class NullMapSpan : IMapSpan
{
internal NullMapSpan() { }
/// <summary> Center of map displayed area.</summary>
public IPosition Center { get; } = PositionFactory.Create();
/// <summary> Center of map displayed area.</summary>
public IPosition Center { get; } = PositionFactory.Create();
/// <summary> Radius of displayed map area. </summary>
public double Radius => double.NaN;
/// <summary> Radius of displayed map area. </summary>
public double Radius => double.NaN;
public bool IsValid => MapSpan.GetIsValid(Center, Radius);
}
public bool IsValid => MapSpan.GetIsValid(Center, Radius);
}
}