Files
TheriapolisV3/Theriapolis.Core/World/Polylines/Polyline.cs
T
Christopher Wiebe b451f83174 Initial commit: Theriapolis baseline at port/godot branch point
Captures the pre-Godot-port state of the codebase. This is the rollback
anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md).
All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 20:40:51 -07:00

34 lines
1.2 KiB
C#

using Theriapolis.Core.Util;
namespace Theriapolis.Core.World.Polylines;
public enum PolylineType : byte { River, Road, Rail }
public enum RiverClass : byte { Stream, River, MajorRiver }
public enum RoadType : byte { Footpath, DirtRoad, PostRoad, Highway }
/// <summary>
/// A polyline in world-pixel space (0..32768 on each axis).
/// Source of truth for rivers, roads, and rail. Per-tile flags on WorldTile are derived caches.
/// </summary>
public sealed class Polyline
{
public PolylineType Type { get; init; }
public int Id { get; init; }
public List<Vec2> Points { get; } = new();
public List<Vec2>? SimplifiedPoints { get; set; }
public float Width { get; set; }
// River-specific
public RiverClass RiverClassification { get; set; }
public int FlowAccumulation { get; set; }
// Road-specific
public RoadType RoadClassification { get; set; }
// Infrastructure-specific (source/destination settlement IDs)
public int FromSettlementId { get; set; } = -1;
public int ToSettlementId { get; set; } = -1;
public bool IsEmpty => Points.Count < 2;
}