Editor/Platform/ArchPlanPlatforms.cs

Extension methods for ArchPlan that find platform-related parts and owners. Adds FindPlatform to get an ArchPlatformPart by id, OwnerOf to get the ArchBuilding that hosts a platform part, and PlatformCarrying to get the platform hosting a stair part.

Reflection
namespace Sunless.Architecture;

public static class ArchPlanPlatforms
{
	public static ArchPlatformPart FindPlatform( this ArchPlan plan, int id, ArchKinds table = null ) =>
		plan.Find<ArchPlatformPart>( id, table );

	public static ArchBuilding OwnerOf( this ArchPlan plan, ArchPlatformPart platform, ArchKinds table = null ) =>
		plan.HostOf<ArchBuilding>( platform, table );

	// Asked of the part rather than of a kind, because a carved flight and a room's flight are one type and only
	// the deck it is filed on tells them apart.
	public static ArchPlatformPart PlatformCarrying( this ArchPlan plan, ArchStairPart stair, ArchKinds table = null ) =>
		plan.HostOf<ArchPlatformPart>( stair, table );
}