PalacePal/Pal.Client/Floors/PersistentLocation.cs

55 lines
1.6 KiB
C#
Raw Normal View History

2023-02-18 20:12:36 +00:00
using System;
using System.Collections.Generic;
using Pal.Client.Database;
2023-03-30 20:01:43 +00:00
namespace Pal.Client.Floors;
/// <summary>
/// A <see cref="ClientLocation"/> loaded in memory, with certain extra attributes as needed.
/// </summary>
internal sealed class PersistentLocation : MemoryLocation
2023-02-18 20:12:36 +00:00
{
2023-03-30 20:01:43 +00:00
/// <see cref="ClientLocation.LocalId"/>
public int? LocalId { get; set; }
2023-02-18 20:12:36 +00:00
/// <summary>
2023-03-30 20:01:43 +00:00
/// Network id for the server you're currently connected to.
2023-02-18 20:12:36 +00:00
/// </summary>
2023-03-30 20:01:43 +00:00
public Guid? NetworkId { get; set; }
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
/// <summary>
/// For markers that the server you're connected to doesn't know: Whether this was requested to be uploaded, to avoid duplicate requests.
/// </summary>
public bool UploadRequested { get; set; }
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
/// <see cref="ClientLocation.RemoteEncounters"/>
///
public List<string> RemoteSeenOn { get; set; } = new();
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
/// <summary>
/// Whether this marker was requested to be seen, to avoid duplicate requests.
/// </summary>
public bool RemoteSeenRequested { get; set; }
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
public ClientLocation.ESource Source { get; init; }
2023-02-22 19:29:58 +00:00
2023-03-30 20:01:43 +00:00
public override bool Equals(object? obj) => obj is PersistentLocation && base.Equals(obj);
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
public override int GetHashCode() => base.GetHashCode();
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
public static bool operator ==(PersistentLocation? a, object? b)
{
return Equals(a, b);
}
2023-02-18 20:12:36 +00:00
2023-03-30 20:01:43 +00:00
public static bool operator !=(PersistentLocation? a, object? b)
{
return !Equals(a, b);
}
2023-03-30 20:01:43 +00:00
public override string ToString()
{
return $"PersistentLocation(Position={Position}, Type={Type})";
2023-02-18 20:12:36 +00:00
}
}