/*
 *	RailSim II Station Plugin
 *	Copyright (c) 2010 Intaanetto Teiryuujo
 */

PluginHeader{
	RailSimVersion = 2.13;
	PluginType = Station;
	PluginName = "Turntable Test";
	PluginAuthor = "Okadu";
	IconTexture = "..\..\Train\Aizentranza01\Icon.png";
	Description = "A sample implementation of a turntable.";
}

StationInfo{
}

Platform{
	Stoppable = no;
	GirderPlugin = "";
	PierPlugin = "";
	PolePlugin = "";
	Coord = (15.000000, 0.0, 0.000000);
	Coord = (20.000000, 0.0, 0.000000);
}

Platform{
	Stoppable = no;
	Coord = (7.500000, 0.0, -12.990381);
	Coord = (10.000000, 0.0, -17.320508);
}

Platform{
	Stoppable = no;
	Coord = (-7.500000, 0.0, -12.990381);
	Coord = (-10.000000, 0.0, -17.320508);
}

Platform{
	Stoppable = no;
	Coord = (-15.000000, 0.0, 0.000000);
	Coord = (-20.000000, 0.0, 0.000000);
}

Platform{
	Stoppable = no;
	Coord = (-7.500000, 0.0, 12.990381);
	Coord = (-10.000000, 0.0, 17.320508);
}

Platform{
	Stoppable = no;
	Coord = (7.500000, 0.0, 12.990381);
	Coord = (10.000000, 0.0, 17.320508);
}

//	rotating rail
Platform{
	TiePlugin = "";
	ParentObject = "RotationPlate";
	Coord = (0.0, 0.0, -15.0);
	Coord = (0.0, 0.0, 15.0);
}

DefineSwitch "Rotation"{
	Entry = "No.1-No.4 / 0[deg]";
	Entry = "No.2-No.5 / 60[deg]";
	Entry = "No.3-No.6 / 120[deg]";
	Entry = "No.4-No.1 / 180[deg]";
	Entry = "No.5-No.2 / 240[deg]";
	Entry = "No.6-No.3 / 300[deg]";
	Entry = "No.1-No.4 / 360[deg]";
}

DefineSwitch "Through"{
	Entry = "Enabled";
	Entry = "Disabled";
}

PrimaryAssembly{
	Object3D "RotationPlate"{
		ModelFileName = "RotationPlate.x";
		ModelScale = 1.0;
		ApplySwitch "Rotation"{
		Case 1:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 60.0;
				AnimationTime = 5.0;
			}
		Case 2:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 120.0;
				AnimationTime = 5.0;
			}
		Case 3:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180.0;
				AnimationTime = 5.0;
			}
		Case 4:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 240.0;
				AnimationTime = 5.0;
			}
		Case 5:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 300.0;
				AnimationTime = 5.0;
			}
		Case 6:
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 360.0;
				AnimationTime = 5.0;
			}
		}
		Joint3D "_LOCAL"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (1.0, 0.0, 0.0);
		}
	}
	ApplySwitch "Through"{
	Case 0:
		ApplySwitch "Rotation"{
		Case 0:
			ConnectRail = 13, 0;
			ConnectRail = 12, 6;
		Case 1:
			ConnectRail = 13, 2;
			ConnectRail = 12, 8;
		Case 2:
			ConnectRail = 13, 4;
			ConnectRail = 12, 10;
		Case 3:
			ConnectRail = 13, 6;
			ConnectRail = 12, 0;
		Case 4:
			ConnectRail = 13, 8;
			ConnectRail = 12, 2;
		Case 5:
			ConnectRail = 13, 10;
			ConnectRail = 12, 4;
		Case 6:
			ConnectRail = 13, 0;
			ConnectRail = 12, 6;
		}
	Case 1:
		DisconnectRail = 13;
		DisconnectRail = 12;
	}
}
