2024-08-03 01:21:11 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Numerics;
|
2024-08-02 18:04:45 +00:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
using Questionable.Model.Common.Converter;
|
|
|
|
|
|
|
|
|
|
namespace Questionable.Model.Gathering;
|
|
|
|
|
|
|
|
|
|
public sealed class GatheringLocation
|
|
|
|
|
{
|
2024-08-03 01:21:11 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public Guid InternalId { get; } = Guid.NewGuid();
|
|
|
|
|
|
2024-08-02 18:04:45 +00:00
|
|
|
|
[JsonConverter(typeof(VectorConverter))]
|
|
|
|
|
public Vector3 Position { get; set; }
|
|
|
|
|
|
2024-08-03 01:21:11 +00:00
|
|
|
|
public int? MinimumAngle { get; set; }
|
|
|
|
|
public int? MaximumAngle { get; set; }
|
|
|
|
|
public float? MinimumDistance { get; set; }
|
|
|
|
|
public float? MaximumDistance { get; set; }
|
2024-08-02 18:04:45 +00:00
|
|
|
|
|
|
|
|
|
public bool IsCone()
|
|
|
|
|
{
|
|
|
|
|
return MinimumAngle != null && MaximumAngle != null;
|
|
|
|
|
}
|
2024-08-03 01:21:11 +00:00
|
|
|
|
|
|
|
|
|
public float CalculateMinimumDistance() => MinimumDistance ?? 1f;
|
|
|
|
|
public float CalculateMaximumDistance() => MaximumDistance ?? 3f;
|
2024-08-02 18:04:45 +00:00
|
|
|
|
}
|