13 lines
4.0 KiB
C#
13 lines
4.0 KiB
C#
using PlotLine.Models;
|
|
using PlotLine.ViewModels;
|
|
using PlotLine.Services.Context;
|
|
internal static class SpatialContextBrowserFixture
|
|
{
|
|
public static SpatialScope Scope(int scene=22)=>new(){ProjectID=7,BookID=12,ChapterID=10,SceneID=scene,ChapterTitle="The crossing",SceneTitle="A quiet arrival",ChapterNumber=1,SceneNumber=2,PrimaryLocationID=103,CanEdit=true,Version=new(2026,11,27,12,0,0)};
|
|
public static SpatialDocument Data(int scene=22,int? inspect=null){var scope=Scope(scene);var names=new[]{"Aster country","Harbour town","The old house","Bedroom","Lounge","Kitchen","Unmapped garden","Remote valley"};var locations=names.Select((name,i)=>new SpatialLocation{LocationID=100+i,ParentLocationID=i==0||i==7?null:i==1?100:i==2?101:102,LocationName=name,LocationTypeID=i<2?1:4,LocationTypeName=i<2?"Country":"Building",Classification="Fictional",Description=$"Recorded description of {name}.\nThe author uses this space to record atmosphere, entrances and useful details whilst writing.",UpdatedDate=scope.Version,ChildCount=i==0||i==1?1:i==2?4:0}).ToArray();var scenes=new[]{new SpatialScene{Position=-1,SceneID=21,ChapterID=9,ChapterNumber=1,ChapterTitle="Before",SceneNumber=1,SceneTitle="A conversation",LocationID=104},new SpatialScene{Position=0,SceneID=scene,ChapterID=10,ChapterNumber=2,ChapterTitle="Arrival",SceneNumber=1,SceneTitle="The quiet room",LocationID=scene==23?null:scene==24?104:scene==26?107:103},new SpatialScene{Position=1,SceneID=25,ChapterID=10,ChapterNumber=2,SceneNumber=2,SceneTitle="Breakfast",LocationID=105}};scope.PrimaryLocationID=scenes[1].LocationID;
|
|
return new(scope,scenes,[],locations,[new(102,1,"Harbour town map",Guid.Parse("11111111-2222-4333-8444-555555555555"),true,"Marker",false)],[new(31,"The old house",102,null,null),new(31,"The old house",103,41,51),new(31,"The old house",104,41,52),new(31,"The old house",105,41,53)],[new(){ID=1,Name="Harbour town map",Kind="Town",Revision=1,ModifiedDate=scope.Version},new(){ID=2,Name="Other map",Kind="Region",Revision=1,ModifiedDate=scope.Version}],[new(){ID=31,Name="The old house",LocationID=102,ModifiedDate=scope.Version,Version="fixture-plan-version"}],[],[PlotLine.Services.LocationWorkspaceIcons.Presentation("1","Country"),PlotLine.Services.LocationWorkspaceIcons.Presentation("4","Building")]);
|
|
}
|
|
public static MapsViewModel Map(int id=1){var map=new StoryMap{MapID=id,ProjectID=7,Name="Harbour town map",Kind="Region",Revision=1};return new(){Project=new(){ProjectID=7},Maps=[map],Document=new(){Map=map,Features=[new(){FeatureID=Guid.Parse("11111111-2222-4333-8444-555555555555"),MapID=id,Name="The old house",LocationID=id==1?102:null,GeometryClass="Marker",Type="Custom",X=100,Y=80,Width=48,Height=48,IsPlaced=true,ShowLabel=true},new(){FeatureID=Guid.Parse("21111111-2222-4333-8444-555555555555"),MapID=id,Name="Woodland",GeometryClass="Marker",Type="Custom",X=-150,Y=-100,Width=48,Height=48,IsPlaced=true,ShowLabel=true}]}};}
|
|
public static SpatialFloorCanvas Floor()=>new(new(){Project=new(){ProjectID=7},FloorPlan=new(){FloorPlanID=31,ProjectID=7,Name="The old house",LocationID=102},Floors=[new(){FloorPlanFloorID=41,FloorPlanID=31,Name="Ground floor",GridWidth=18,GridHeight=14},new(){FloorPlanFloorID=42,FloorPlanID=31,Name="Upper floor",GridWidth=18,GridHeight=14}],Blocks=[new(){FloorPlanBlockID=51,FloorPlanFloorID=41,LocationID=103,LocationName="Bedroom",BlockType="Room",X=2,Y=2,WidthCells=5,HeightCells=4},new(){FloorPlanBlockID=52,FloorPlanFloorID=41,LocationID=104,LocationName="Lounge",BlockType="Room",X=7,Y=2,WidthCells=6,HeightCells=4},new(){FloorPlanBlockID=53,FloorPlanFloorID=41,LocationID=105,LocationName="Kitchen",BlockType="Room",X=2,Y=6,WidthCells=5,HeightCells=4}],Transitions=[new(){FloorPlanTransitionID=61,FloorPlanFloorID=41,FromLocationID=103,ToLocationID=104,FromLocationName="Bedroom",ToLocationName="Lounge",TransitionType="Door"},new(){FloorPlanTransitionID=62,FloorPlanFloorID=41,FromLocationID=103,ToLocationID=105,FromLocationName="Bedroom",ToLocationName="Kitchen",TransitionType="Archway"}]},[new(51,"fixture-room-51"),new(52,"fixture-room-52"),new(53,"fixture-room-53")]);
|
|
}
|