Files
crystall-punk-14/Content.Shared/_CP14/DemiplaneTraveling/CP14SharedStationDemiplaneMapSystem.cs
Ed aeedff5caa Demiplane exploration map (#1251)
* dehardcode nodeTreeControl part 1

* finish

* demiplane map system setup

* link map entity with station data!

* random demiplane map generation

* redesign demiplane map node tree

* center

* map generate v2

* location generation

* modifier generation

* missing location icons

* ui polish

* data refactor

* fix line color

* ejectabling

* split demiplane component into two

* blocker attempt

* revoking

* fix frontier calculation

* dimensit

* demiplane core room spawning

* demiplane cool destruction

* Update round_end.yml

* progression works now!

* Update CP14NodeTree.cs

* Update CP14NodeTree.cs

* documentation pass

* fix abusing, some balance pass

* demiplane naming fix

* см

* location names

* delete old keys

* Update buy.yml

* Update migration.yml

* fix guidebook

* Update misc.yml

* Update misc.yml
2025-05-05 15:19:44 +03:00

48 lines
1.3 KiB
C#

using Robust.Shared.Serialization;
namespace Content.Shared._CP14.DemiplaneTraveling;
public abstract partial class CP14SharedStationDemiplaneMapSystem : EntitySystem
{
public static bool NodeInFronrierZone(Dictionary<Vector2i,CP14DemiplaneMapNode> nodes, HashSet<(Vector2i, Vector2i)> edges, Vector2i key)
{
if (!nodes.TryGetValue(key, out var node))
return false;
if (node.Scanned || node.Start)
return false;
//return false if no finished or start nodes near
var near = new List<Vector2i>();
foreach (var edge in edges)
{
var node1 = nodes[edge.Item1];
var node2 = nodes[edge.Item2];
if (node1 != node && node2 != node)
continue;
if (node1.Scanned || node1.Start || node2.Scanned || node2.Start)
{
return true;
}
}
return false;
}
}
[Serializable, NetSerializable]
public sealed class CP14DemiplaneMapEjectMessage(Vector2i position) : BoundUserInterfaceMessage
{
public readonly Vector2i Position = position;
}
[Serializable, NetSerializable]
public sealed class CP14DemiplaneMapRevokeMessage(Vector2i position) : BoundUserInterfaceMessage
{
public readonly Vector2i Position = position;
}