Files
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

30 lines
921 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Theriapolis.Core.Util;
namespace Theriapolis.Core.World;
/// <summary>
/// A bridge where a road or rail polyline crosses a river.
/// Endpoints are in world-pixel space and follow the actual road polyline,
/// so the deck visually matches the road at the crossing regardless of meander.
/// </summary>
public readonly struct Bridge
{
public readonly Vec2 Start;
public readonly Vec2 End;
public readonly int RoadId;
public Bridge(Vec2 start, Vec2 end, int roadId)
{
Start = start;
End = end;
RoadId = roadId;
}
/// <summary>Center of the deck (midpoint of StartEnd).</summary>
public float WorldPixelX => (Start.X + End.X) * 0.5f;
public float WorldPixelY => (Start.Y + End.Y) * 0.5f;
/// <summary>Road direction angle (radians) from Start to End.</summary>
public float RoadAngle => MathF.Atan2(End.Y - Start.Y, End.X - Start.X);
}