From: <je...@us...> - 2008-03-26 08:14:25
|
Revision: 291 http://freetrain.svn.sourceforge.net/freetrain/?rev=291&view=rev Author: jendave Date: 2008-03-26 01:14:31 -0700 (Wed, 26 Mar 2008) Log Message: ----------- add settings Modified Paths: -------------- branches/FreeTrainSDL/FreeTrainSDL.csproj branches/FreeTrainSDL/core/FreeTrain.Core.csproj Modified: branches/FreeTrainSDL/FreeTrainSDL.csproj =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-26 08:10:49 UTC (rev 290) +++ branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-26 08:14:31 UTC (rev 291) @@ -65,6 +65,11 @@ <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Program.cs" /> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + <DependentUpon>Settings.settings</DependentUpon> + </Compile> <Compile Include="SDLGUI.cs" /> <Compile Include="SDLGUIButton.cs" /> </ItemGroup> @@ -83,6 +88,10 @@ </ItemGroup> <ItemGroup> <None Include="FreeTrainSdl.snk" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> </ItemGroup> <ItemGroup> <EmbeddedResource Include="App.ico" /> Modified: branches/FreeTrainSDL/core/FreeTrain.Core.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.Core.csproj 2008-03-26 08:10:49 UTC (rev 290) +++ branches/FreeTrainSDL/core/FreeTrain.Core.csproj 2008-03-26 08:14:31 UTC (rev 291) @@ -262,7 +262,7 @@ <SubType>Form</SubType> </Compile> <Compile Include="controllers\AbstractControllerImpl.cs"> - <SubType>UserControl</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="controllers\AbstractLineController.cs"> <SubType>Form</SubType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-03-26 09:06:03
|
Revision: 294 http://freetrain.svn.sourceforge.net/freetrain/?rev=294&view=rev Author: jendave Date: 2008-03-26 02:06:08 -0700 (Wed, 26 Mar 2008) Log Message: ----------- Beginnings of settings file Modified Paths: -------------- branches/FreeTrainSDL/FreeTrainSDL.csproj branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/Properties/Settings.Designer.cs branches/FreeTrainSDL/Properties/Settings.settings Added Paths: ----------- branches/FreeTrainSDL/app.config Modified: branches/FreeTrainSDL/FreeTrainSDL.csproj =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-26 08:56:33 UTC (rev 293) +++ branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-26 09:06:08 UTC (rev 294) @@ -87,6 +87,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <None Include="app.config" /> <None Include="FreeTrainSdl.snk" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-03-26 08:56:33 UTC (rev 293) +++ branches/FreeTrainSDL/Program.cs 2008-03-26 09:06:08 UTC (rev 294) @@ -30,8 +30,8 @@ //using SdlDotNet.Graphics; using SdlDotNet.Core; using SdlDotNet.Input; + using FreeTrain.Framework.Graphics; - using FreeTrain.World; using FreeTrain.Controllers; using FreeTrain.Controllers.Rail; @@ -310,6 +310,8 @@ dragStartMousePosition = new Point(0, 0); dragStartScrollPosition = new Point(0, 0); ScrollPosition = new Point(0, 0); + this.width = Properties.Settings.Default.RenderWindowWidth; + this.height = Properties.Settings.Default.RenderWindowHeight; try { Modified: branches/FreeTrainSDL/Properties/Settings.Designer.cs =================================================================== --- branches/FreeTrainSDL/Properties/Settings.Designer.cs 2008-03-26 08:56:33 UTC (rev 293) +++ branches/FreeTrainSDL/Properties/Settings.Designer.cs 2008-03-26 09:06:08 UTC (rev 294) @@ -22,5 +22,29 @@ return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("600")] + public int RenderWindowHeight { + get { + return ((int)(this["RenderWindowHeight"])); + } + set { + this["RenderWindowHeight"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("800")] + public int RenderWindowWidth { + get { + return ((int)(this["RenderWindowWidth"])); + } + set { + this["RenderWindowWidth"] = value; + } + } } } Modified: branches/FreeTrainSDL/Properties/Settings.settings =================================================================== --- branches/FreeTrainSDL/Properties/Settings.settings 2008-03-26 08:56:33 UTC (rev 293) +++ branches/FreeTrainSDL/Properties/Settings.settings 2008-03-26 09:06:08 UTC (rev 294) @@ -1,6 +1,12 @@ <?xml version='1.0' encoding='utf-8'?> -<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> - <Profiles> - <Profile Name="(Default)" /> - </Profiles> -</SettingsFile> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FreeTrain.Properties" GeneratedClassName="Settings"> + <Profiles /> + <Settings> + <Setting Name="RenderWindowHeight" Type="System.Int32" Scope="User"> + <Value Profile="(Default)">600</Value> + </Setting> + <Setting Name="RenderWindowWidth" Type="System.Int32" Scope="User"> + <Value Profile="(Default)">800</Value> + </Setting> + </Settings> +</SettingsFile> \ No newline at end of file Added: branches/FreeTrainSDL/app.config =================================================================== --- branches/FreeTrainSDL/app.config (rev 0) +++ branches/FreeTrainSDL/app.config 2008-03-26 09:06:08 UTC (rev 294) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <configSections> + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > + <section name="FreeTrain.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> + </sectionGroup> + </configSections> + <userSettings> + <FreeTrain.Properties.Settings> + <setting name="RenderWindowHeight" serializeAs="String"> + <value>600</value> + </setting> + <setting name="RenderWindowWidth" serializeAs="String"> + <value>800</value> + </setting> + </FreeTrain.Properties.Settings> + </userSettings> +</configuration> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-03-27 21:25:41
|
Revision: 298 http://freetrain.svn.sourceforge.net/freetrain/?rev=298&view=rev Author: jendave Date: 2008-03-27 14:24:39 -0700 (Thu, 27 Mar 2008) Log Message: ----------- Start creating Winforms MDI Control Center Modified Paths: -------------- branches/FreeTrainSDL/FreeTrainSDL.csproj branches/FreeTrainSDL/FreeTrainSDL.sln branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.cs branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.resx branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/controllers/AbstractLineController.cs branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/controllers/ModalController.cs branches/FreeTrainSDL/core/controllers/PointSelectorController.cs branches/FreeTrainSDL/core/controllers/RectSelectorController.cs branches/FreeTrainSDL/core/controllers/land/BulldozeController.cs branches/FreeTrainSDL/core/controllers/land/LandController.cs branches/FreeTrainSDL/core/controllers/land/LandPropertyController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.resx branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.resx branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.resx branches/FreeTrainSDL/core/controllers/rail/StationPropertyDialog.cs branches/FreeTrainSDL/core/controllers/rail/StationPropertyDialog.resx branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.Designer.cs branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/controllers/terrain/MountainController.Designer.cs branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs branches/FreeTrainSDL/core/framework/AboutDialog.cs branches/FreeTrainSDL/core/framework/BGMPlaylist.Designer.cs branches/FreeTrainSDL/core/framework/ConfigDialog.cs branches/FreeTrainSDL/core/framework/ConfigDialog.resx branches/FreeTrainSDL/core/framework/ErrorMessageBox.cs branches/FreeTrainSDL/core/framework/ErrorMessageBox.resx branches/FreeTrainSDL/core/framework/NewWorldDialog.cs branches/FreeTrainSDL/core/framework/NewWorldDialog.resx branches/FreeTrainSDL/core/framework/ResourceUtil.cs branches/FreeTrainSDL/core/framework/plugin/PluginListDialog.cs branches/FreeTrainSDL/core/framework/plugin/PluginListDialog.resx branches/FreeTrainSDL/core/util/Translation.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/map/HeightCutWindow.cs branches/FreeTrainSDL/core/views/map/HeightCutWindow.resx branches/FreeTrainSDL/core/views/map/MapView.cs branches/FreeTrainSDL/core/views/map/MapView.resx branches/FreeTrainSDL/core/views/map/PreviewForm.cs branches/FreeTrainSDL/core/views/map/PreviewForm.resx branches/FreeTrainSDL/core/world/accounting/AccountSummaryWindow.cs branches/FreeTrainSDL/core/world/accounting/AccountSummaryWindow.resx branches/FreeTrainSDL/core/world/accounting/GenreSelectorDialog.cs branches/FreeTrainSDL/core/world/accounting/GenreSelectorDialog.resx branches/FreeTrainSDL/core/world/development/DevelopConfigure.cs branches/FreeTrainSDL/core/world/development/LandValueInspector.cs branches/FreeTrainSDL/core/world/development/LandValueInspector.resx branches/FreeTrainSDL/core/world/subsidiaries/MarketWindow.cs branches/FreeTrainSDL/core/world/subsidiaries/MarketWindow.resx branches/FreeTrainSDL/plugins/Chiname.DummyCars/FreeTrain.DummyCars.csproj branches/FreeTrainSDL/plugins/Chiname.Generic/CategoryTreeWnd.cs branches/FreeTrainSDL/plugins/Chiname.Generic/CategoryTreeWnd.resx branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/FreeTrain.ColorTestTrain.csproj branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj Added Paths: ----------- branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.resx Removed Paths: ------------- branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs branches/FreeTrainSDL/makemacapp.sh Modified: branches/FreeTrainSDL/FreeTrainSDL.csproj =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-27 21:24:39 UTC (rev 298) @@ -74,9 +74,9 @@ <Compile Include="SDLGUIButton.cs" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="core\FreeTrain.Core.csproj"> + <ProjectReference Include="core\FreeTrain.csproj"> <Project>{7746CF50-D84E-4E7B-83FB-AB43DB854DA8}</Project> - <Name>FreeTrain.Core</Name> + <Name>FreeTrain</Name> </ProjectReference> </ItemGroup> <ItemGroup> Modified: branches/FreeTrainSDL/FreeTrainSDL.sln =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.sln 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/FreeTrainSDL.sln 2008-03-27 21:24:39 UTC (rev 298) @@ -3,7 +3,7 @@ # Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeTrainSDL", "FreeTrainSDL.csproj", "{B43DC0F1-5C4B-490F-8171-C3754A02D605}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeTrain.Core", "core\FreeTrain.Core.csproj", "{7746CF50-D84E-4E7B-83FB-AB43DB854DA8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeTrain", "core\FreeTrain.csproj", "{7746CF50-D84E-4E7B-83FB-AB43DB854DA8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeTrain.Controls", "lib\Controls\FreeTrain.Controls.csproj", "{D3B86CCE-530E-4472-AE8E-3FA5F903C206}" EndProject Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/Program.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -35,8 +35,11 @@ using FreeTrain.World; using FreeTrain.Controllers; using FreeTrain.Controllers.Rail; +using FreeTrain.Controllers.Land; +using FreeTrain.Controllers.Road; using FreeTrain.Controllers.Terrain; using FreeTrain.Controllers.Structs; +using FreeTrain.Framework.Plugin; using FreeTrain.Framework; using FreeTrain.Views; using FreeTrain.Util; @@ -70,6 +73,7 @@ short oldX; short oldY; bool lastMouseState; + MainWindowMDI mainWindowMDI; #endregion @@ -114,10 +118,10 @@ if (qView != null) { controller = MainWindow.mainWindow.currentController; - + //MainWindow.mainWindow.Show(); qView.updateScreen(); - if (WorldDefinition.World.Satellite == null || - WorldDefinition.World.Satellite.surface.w != 150 || + if (WorldDefinition.World.Satellite == null || + WorldDefinition.World.Satellite.surface.w != 150 || WorldDefinition.World.Satellite.surface.h != 150) { WorldDefinition.World.Satellite = new Surface(150, 150, 32); @@ -138,6 +142,7 @@ { RailRoadController.create(); } + } private void Resize(object sender, SdlDotNet.Graphics.VideoResizeEventArgs e) @@ -244,21 +249,38 @@ { case "rail": RailRoadController.create(); + RailRoadController.theInstance.Hide(); + RailRoadController.theInstance.MdiParent = mainWindowMDI; + //mainWindowMDI.AddOwnedForm(RailRoadController.theInstance); + RailRoadController.theInstance.Show(); break; case "station": PlatformController.create(); + PlatformController.theInstance.Hide(); + PlatformController.theInstance.MdiParent = mainWindowMDI; + PlatformController.theInstance.Show(); break; case "train": TrainPlacementController.create(); + TrainPlacementController.theInstance.Hide(); + TrainPlacementController.theInstance.MdiParent = mainWindowMDI; + TrainPlacementController.theInstance.Show(); break; case "land": MountainController.create(); + MountainController.theInstance.Hide(); + MountainController.theInstance.MdiParent = mainWindowMDI; + MountainController.theInstance.Show(); break; case "struct": VarHeightBuildingController.create(); + VarHeightBuildingController.theInstance.Hide(); + VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; + VarHeightBuildingController.theInstance.Show(); break; case "playlist": BGMPlaylist bgmplaylist = new BGMPlaylist(); + bgmplaylist.MdiParent = mainWindowMDI; bgmplaylist.Show(); break; } @@ -329,8 +351,8 @@ SdlMixer.MusicFinishedDelegate musicStopped = new SdlMixer.MusicFinishedDelegate(MusicHasStopped); SdlMixer.Mix_HookMusicFinished(musicStopped); - + screen = SdlDotNet.Graphics.Video.SetVideoMode(width, height, currentBpp, true); screen.SourceColorKey = Color.Magenta; IntPtr videoInfoPointer = Sdl.SDL_GetVideoInfo(); @@ -377,16 +399,76 @@ finalDraw(); qView.draw(new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8), null); - + gui.SHOW_SPLASH = false; timer.Tick += new EventHandler(timerTick); timer.Interval = 33; timer.Enabled = true; timer.Start(); - //ControlPanel controlPanel = new ControlPanel(); - //controlPanel.Show(); + mainWindowMDI = new MainWindowMDI(); + mainWindowMDI.Show(); + RailRoadController.create(); + RailRoadController.theInstance.Hide(); + RailRoadController.theInstance.MdiParent = mainWindowMDI; + RailRoadController.theInstance.WindowState = FormWindowState.Maximized; + RailRoadController.theInstance.Show(); + PlatformController.create(); + PlatformController.theInstance.Hide(); + PlatformController.theInstance.MdiParent = mainWindowMDI; + PlatformController.theInstance.WindowState = FormWindowState.Maximized; + PlatformController.theInstance.Show(); + TrainPlacementController.create(); + TrainPlacementController.theInstance.Hide(); + TrainPlacementController.theInstance.MdiParent = mainWindowMDI; + TrainPlacementController.theInstance.WindowState = FormWindowState.Maximized; + TrainPlacementController.theInstance.Show(); + MountainController.create(); + MountainController.theInstance.Hide(); + MountainController.theInstance.MdiParent = mainWindowMDI; + MountainController.theInstance.WindowState = FormWindowState.Maximized; + MountainController.theInstance.Show(); + VarHeightBuildingController.create(); + VarHeightBuildingController.theInstance.Hide(); + VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; + VarHeightBuildingController.theInstance.WindowState = FormWindowState.Maximized; + VarHeightBuildingController.theInstance.Show(); + LandController.create(); + LandController.theInstance.Hide(); + LandController.theInstance.MdiParent = mainWindowMDI; + LandController.theInstance.WindowState = FormWindowState.Maximized; + LandController.theInstance.Show(); + LandPropertyController.create(); + LandPropertyController.theInstance.Hide(); + LandPropertyController.theInstance.MdiParent = mainWindowMDI; + LandPropertyController.theInstance.WindowState = FormWindowState.Maximized; + LandPropertyController.theInstance.Show(); + StationPassagewayController.create(); + StationPassagewayController.theInstance.Hide(); + StationPassagewayController.theInstance.MdiParent = mainWindowMDI; + StationPassagewayController.theInstance.WindowState = FormWindowState.Maximized; + StationPassagewayController.theInstance.Show(); + SlopeRailRoadController.create(); + SlopeRailRoadController.theInstance.Hide(); + SlopeRailRoadController.theInstance.MdiParent = mainWindowMDI; + SlopeRailRoadController.theInstance.WindowState = FormWindowState.Maximized; + SlopeRailRoadController.theInstance.Show(); + PluginListDialog pluginListDialog = new PluginListDialog(); + pluginListDialog.MdiParent = mainWindowMDI; + pluginListDialog.WindowState = FormWindowState.Maximized; + pluginListDialog.Show(); + //RoadController roadController = new RoadController(); + //roadController.MdiParent = mainWindowMDI; + //roadController.Show(); + //BulldozeController.create(); + //BulldozeController.theInstance.Hide(); + //BulldozeController.theInstance.MdiParent = mainWindowMDI; + //BulldozeController.theInstance.Show(); + BGMPlaylist bgmplaylist = new BGMPlaylist(); + bgmplaylist.MdiParent = mainWindowMDI; + bgmplaylist.Show(); + Events.Run(); } Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-27 21:24:39 UTC (rev 298) @@ -258,9 +258,6 @@ <Compile Include="contributions\train\TrainContributionFactory.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="controllers\AbstractControllerForm.cs"> - <SubType>Form</SubType> - </Compile> <Compile Include="controllers\AbstractControllerImpl.cs"> <SubType>Form</SubType> </Compile> @@ -468,6 +465,12 @@ <Compile Include="framework\MainWindow.cs"> <SubType>Form</SubType> </Compile> + <Compile Include="framework\MainWindowMDI.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="framework\MainWindowMDI.Designer.cs"> + <DependentUpon>MainWindowMDI.cs</DependentUpon> + </Compile> <Compile Include="framework\MenuItemConstants.cs"> <SubType>Code</SubType> </Compile> @@ -888,9 +891,6 @@ <EmbeddedResource Include="contributions\others\NewWorldDialog.resx"> <DependentUpon>NewWorldDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="controllers\AbstractControllerForm.resx"> - <DependentUpon>AbstractControllerForm.cs</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="controllers\AbstractControllerImpl.resx"> <DependentUpon>AbstractControllerImpl.cs</DependentUpon> </EmbeddedResource> @@ -972,6 +972,10 @@ <DependentUpon>MainWindow.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="framework\MainWindowMDI.resx"> + <SubType>Designer</SubType> + <DependentUpon>MainWindowMDI.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="framework\NewWorldDialog.resx"> <DependentUpon>NewWorldDialog.cs</DependentUpon> </EmbeddedResource> Modified: branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -70,139 +70,134 @@ /// コード エディタで変更しないでください。 /// </summary> private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.name = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.sizeX = new System.Windows.Forms.TextBox(); - this.sizeY = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); - this.sizeZ = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(8, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(48, 20); - this.label1.TabIndex = 0; - this.label1.Text = "&Name:"; - //! this.label1.Text = "名前(&N):"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // name - // - this.name.Location = new System.Drawing.Point(72, 9); - this.name.Name = "name"; - this.name.Size = new System.Drawing.Size(224, 20); - this.name.TabIndex = 1; - this.name.Text = ""; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(10, 35); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(46, 20); - this.label2.TabIndex = 2; - this.label2.Text = "&Size:"; - //! this.label2.Text = "サイズ(&S):"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // sizeX - // - this.sizeX.Location = new System.Drawing.Point(72, 35); - this.sizeX.Name = "sizeX"; - this.sizeX.Size = new System.Drawing.Size(64, 20); - this.sizeX.TabIndex = 3; - this.sizeX.Text = "30"; - this.sizeX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.sizeX.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); - // - // sizeY - // - this.sizeY.Location = new System.Drawing.Point(160, 35); - this.sizeY.Name = "sizeY"; - this.sizeY.Size = new System.Drawing.Size(56, 20); - this.sizeY.TabIndex = 4; - this.sizeY.Text = "30"; - this.sizeY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.sizeY.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); - // - // label3 - // - this.label3.Location = new System.Drawing.Point(136, 35); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(24, 17); - this.label3.TabIndex = 5; - this.label3.Text = "x"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.okButton.Location = new System.Drawing.Point(139, 69); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(79, 25); - this.okButton.TabIndex = 6; - this.okButton.Text = "&OK"; - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.cancelButton.Location = new System.Drawing.Point(224, 69); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 25); - this.cancelButton.TabIndex = 7; - this.cancelButton.Text = "&Cancel"; - //! this.cancelButton.Text = "キャンセル(&C)"; - // - // label4 - // - this.label4.Location = new System.Drawing.Point(216, 35); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(24, 17); - this.label4.TabIndex = 8; - this.label4.Text = "x"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // sizeZ - // - this.sizeZ.Location = new System.Drawing.Point(240, 35); - this.sizeZ.Name = "sizeZ"; - this.sizeZ.Size = new System.Drawing.Size(56, 20); - this.sizeZ.TabIndex = 5; - this.sizeZ.Text = "6"; - this.sizeZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.sizeZ.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); - // - // NewWorldDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(306, 102); - this.Controls.Add(this.sizeZ); - this.Controls.Add(this.label4); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.label3); - this.Controls.Add(this.sizeY); - this.Controls.Add(this.sizeX); - this.Controls.Add(this.label2); - this.Controls.Add(this.name); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "NewWorldDialog"; - this.Text = "Create a new game"; - //! this.Text = "新しいゲームの作成"; - this.ResumeLayout(false); - this.PerformLayout(); - + { + this.label1 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.sizeX = new System.Windows.Forms.TextBox(); + this.sizeY = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.sizeZ = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(48, 20); + this.label1.TabIndex = 0; + this.label1.Text = "&Name:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // name + // + this.name.Location = new System.Drawing.Point(72, 9); + this.name.Name = "name"; + this.name.Size = new System.Drawing.Size(224, 20); + this.name.TabIndex = 1; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(10, 35); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(46, 20); + this.label2.TabIndex = 2; + this.label2.Text = "&Size:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // sizeX + // + this.sizeX.Location = new System.Drawing.Point(72, 35); + this.sizeX.Name = "sizeX"; + this.sizeX.Size = new System.Drawing.Size(64, 20); + this.sizeX.TabIndex = 3; + this.sizeX.Text = "30"; + this.sizeX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.sizeX.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); + // + // sizeY + // + this.sizeY.Location = new System.Drawing.Point(160, 35); + this.sizeY.Name = "sizeY"; + this.sizeY.Size = new System.Drawing.Size(56, 20); + this.sizeY.TabIndex = 4; + this.sizeY.Text = "30"; + this.sizeY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.sizeY.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); + // + // label3 + // + this.label3.Location = new System.Drawing.Point(136, 35); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(24, 17); + this.label3.TabIndex = 5; + this.label3.Text = "x"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.okButton.Location = new System.Drawing.Point(139, 69); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(79, 25); + this.okButton.TabIndex = 6; + this.okButton.Text = "&OK"; + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.cancelButton.Location = new System.Drawing.Point(224, 69); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 25); + this.cancelButton.TabIndex = 7; + this.cancelButton.Text = "&Cancel"; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(216, 35); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(24, 17); + this.label4.TabIndex = 8; + this.label4.Text = "x"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // sizeZ + // + this.sizeZ.Location = new System.Drawing.Point(240, 35); + this.sizeZ.Name = "sizeZ"; + this.sizeZ.Size = new System.Drawing.Size(56, 20); + this.sizeZ.TabIndex = 5; + this.sizeZ.Text = "6"; + this.sizeZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.sizeZ.Validating += new System.ComponentModel.CancelEventHandler(this.validateNumber); + // + // NewWorldDialog + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(306, 102); + this.Controls.Add(this.sizeZ); + this.Controls.Add(this.label4); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.label3); + this.Controls.Add(this.sizeY); + this.Controls.Add(this.sizeX); + this.Controls.Add(this.label2); + this.Controls.Add(this.name); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NewWorldDialog"; + this.Text = "Create a New Game"; + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion Modified: branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.resx =================================================================== --- branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.resx 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/contributions/others/NewWorldDialog.resx 2008-03-27 21:24:39 UTC (rev 298) @@ -1,102 +1,120 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="$this.Name"> - <value>NewWorldDialog</value> - </data> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> </root> \ No newline at end of file Deleted: branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -1,264 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; -using System.Diagnostics; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using FreeTrain.Framework; -using FreeTrain.Views; -using FreeTrain.World; -using FreeTrain.Util; - -namespace FreeTrain.Controllers -{ - /// <summary> - /// Pop-up tool window to host modal controllers. - /// </summary> - public class AbstractControllerForm : Form - { - private Point mouseOffset; - /// <summary> - /// - /// </summary> - public AbstractControllerForm() - { - InitializeComponent(); - try - { - WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(UpdatePreview); - } - catch (NullReferenceException nre) - { - Debug.WriteLine(nre); - } - } - /// <summary> - /// - /// </summary> - /// <param name="disposing"></param> - protected override void Dispose(bool disposing) - { - WorldDefinition.World.viewOptions.OnViewOptionChanged -= new OptionChangedHandler(UpdatePreview); - if (disposing && components != null) - components.Dispose(); - base.Dispose(disposing); - } - - - /// <summary> - /// - /// </summary> - /// <param name="e"></param> - protected override void OnLoad(System.EventArgs e) - { - try - { - // attach this window. - MainWindow.mainWindow.AddOwnedForm(this); - // move this window to the left-top position of the parent window - this.Left = MainWindow.mainWindow.Left; - this.Top = MainWindow.mainWindow.Top; - } - catch - { - //Debug.WriteLine(nre); - } - } - /// <summary> - /// - /// </summary> - public virtual void UpdatePreview() { } - /// <summary> - /// - /// </summary> - protected Label lblTitle; - /// <summary> - /// - /// </summary> - protected Label lblExit; - - #region Windows Form Designer generated code - private System.ComponentModel.Container components = null; - - private void InitializeComponent() - { - this.lblTitle = new System.Windows.Forms.Label(); - this.lblExit = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // lblTitle - // - this.lblTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lblTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(220)))), ((int)(((byte)(84))))); - this.lblTitle.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.Location = new System.Drawing.Point(5, 5); - this.lblTitle.Margin = new System.Windows.Forms.Padding(0); - this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(275, 15); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "AbstractController"; - this.lblTitle.TextAlign = System.Drawing.ContentAlignment.TopLeft; - this.lblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseDown); - this.lblTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseMove); - this.lblTitle.Paint += new System.Windows.Forms.PaintEventHandler(this.lblTitle_Paint); - // - // lblExit - // - this.lblExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.lblExit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(220)))), ((int)(((byte)(84))))); - this.lblExit.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblExit.Location = new System.Drawing.Point(241, 5); - this.lblExit.Margin = new System.Windows.Forms.Padding(0); - this.lblExit.Name = "lblExit"; - this.lblExit.Size = new System.Drawing.Size(39, 15); - this.lblExit.TabIndex = 1; - this.lblExit.Text = Translation.GetString("CONTROLLER_EXIT_BUTTON"); - this.lblExit.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.lblExit.MouseLeave += new System.EventHandler(this.lblExit_MouseLeave); - this.lblExit.Click += new System.EventHandler(this.lblExit_Click); - this.lblExit.MouseEnter += new System.EventHandler(this.lblExit_MouseEnter); - // - // AbstractControllerForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(236)))), ((int)(((byte)(184))))); - this.ClientSize = new System.Drawing.Size(292, 271); - this.Controls.Add(this.lblExit); - this.Controls.Add(this.lblTitle); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AbstractControllerForm"; - this.ShowInTaskbar = false; - this.TopMost = true; - this.Paint += new System.Windows.Forms.PaintEventHandler(this.AbstractControllerForm_Paint); - this.Resize += new System.EventHandler(this.AbstractControllerForm_Resize); - this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseMove); - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseDown); - this.Load += new System.EventHandler(this.AbstractControllerForm_Load); - this.ResumeLayout(false); - - } - - void lblTitle_Paint(object sender, PaintEventArgs e) - { - System.Drawing.Graphics gr = e.Graphics; - gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblExit.Left - this.lblTitle.Left - 1, -1), new Point(this.lblExit.Left - this.lblTitle.Left - 1, this.lblTitle.Height)); - } - - void lblExit_MouseLeave(object sender, EventArgs e) - { - this.lblExit.BackColor = Color.FromArgb(236, 220, 84); - this.lblExit.ForeColor = Color.Black; - } - - void lblExit_MouseEnter(object sender, EventArgs e) - { - this.lblExit.BackColor = Color.Black; - this.lblExit.ForeColor = Color.White; - } - #endregion - - void AbstractControllerForm_Resize(object sender, EventArgs e) - { - this.lblTitle.Width = this.Width - (this.lblTitle.Left * 2); - this.lblExit.Left = this.lblTitle.Left + this.lblTitle.Width - this.lblExit.Width; - } - /// <summary> - /// - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void AbstractControllerForm_MouseDown(object sender, MouseEventArgs e) - { - mouseOffset = new Point(-e.X, -e.Y); - } - /// <summary> - /// - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void AbstractControllerForm_MouseMove(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - Point mousePos = Control.MousePosition; - mousePos.Offset(mouseOffset.X, mouseOffset.Y); - this.Location = mousePos; - } - } - - void AbstractControllerForm_Paint(object sender, PaintEventArgs e) - { - System.Drawing.Graphics gr = e.Graphics; - Point[] pts = new Point[4]; - pts[0] = new Point(0, 0); - pts[1] = new Point(this.Width - 1, 0); - pts[2] = new Point(this.Width - 1, this.Height - 1); - pts[3] = new Point(0, this.Height - 1); - gr.DrawPolygon(new Pen(Brushes.Black, 1), pts); - - pts[0].X += 2; pts[0].Y += 2; - pts[1].X -= 2; pts[1].Y += 2; - pts[2].X -= 2; pts[2].Y -= 2; - pts[3].X += 2; pts[3].Y -= 2; - gr.DrawPolygon(new Pen(Color.FromArgb(206, 204, 170), 3), pts); - - pts[0].X += 1; pts[0].Y += 1; - pts[1].X -= 1; pts[1].Y += 1; - pts[2].X -= 1; pts[2].Y -= 1; - pts[3].X += 1; pts[3].Y -= 1; - gr.DrawPolygon(new Pen(Brushes.Black, 1), pts); - - pts[0].X -= 1; pts[0].Y -= 1; - pts[1].Y -= 1; - gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[0], pts[1]); - - pts[3].X -= 1;// pts[3].Y += 1; - gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[0], pts[3]); - - pts[1].X += 2; pts[1].Y -= 1; - pts[2].X += 2; pts[2].Y += 2; - gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[1], pts[2]); - - pts[3].X -= 1; pts[3].Y += 2; - gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[3], pts[2]); - - gr.DrawLine(new Pen(Brushes.White, 1), new Point(this.lblTitle.Left - 1, this.lblTitle.Top - 1), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top - 1)); - gr.DrawLine(new Pen(Brushes.White, 1), new Point(this.lblTitle.Left - 1, this.lblTitle.Top - 1), new Point(this.lblTitle.Left - 1, this.lblTitle.Top + this.lblTitle.Height + 1)); - gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblTitle.Left - 1, this.lblTitle.Top + this.lblTitle.Height), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top + this.lblTitle.Height)); - gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top - 1), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top + this.lblTitle.Height)); - } - - private void AbstractControllerForm_Load(object sender, EventArgs e) - { - - } - - private void lblExit_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -34,7 +34,7 @@ /// <summary> /// /// </summary> - public class AbstractControllerImpl : AbstractControllerForm, ModalController + public class AbstractControllerImpl : Form, ModalController { /// <summary> /// @@ -137,5 +137,11 @@ { Close(); // cancel } + + /// <summary> + /// + /// </summary> + public void UpdatePreview() + { } } } Modified: branches/FreeTrainSDL/core/controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -36,8 +36,11 @@ /// <summary> /// Controller that places/removes lines, such as roads or rail roads. /// </summary> - public abstract class AbstractLineController : AbstractControllerImpl, MapOverlay + public class AbstractLineController : AbstractControllerImpl, MapOverlay { + public AbstractLineController() + : base() + { } /// <summary> /// /// </summary> @@ -53,7 +56,7 @@ /// <summary> /// /// </summary> - public override void UpdatePreview() + public void UpdatePreview() { if (this.picture.Image != null) this.picture.Image.Dispose(); @@ -364,6 +367,7 @@ /// <summary> /// Draw the preview on the given point. /// </summary> - protected abstract void draw(Direction d, DrawContextEx canvs, Point pt); + protected virtual void draw(Direction d, DrawContextEx canvs, Point pt) + { } } } Modified: branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -53,7 +53,7 @@ public ControllerHostForm() { InitializeComponent(); - WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(updatePreview); + //WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(updatePreview); siteImpl = new ControllerSiteImpl(this); } /// <summary> Modified: branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -175,5 +175,11 @@ { onCanceled(); } + + /// <summary> + /// + /// </summary> + public void UpdatePreview() + { } } } Modified: branches/FreeTrainSDL/core/controllers/ModalController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/ModalController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/ModalController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -88,5 +88,10 @@ /// If this controller needs to modify the map view, return non-null value. /// </summary> MapOverlay Overlay { get; } + + /// <summary> + /// + /// </summary> + void UpdatePreview(); } } Modified: branches/FreeTrainSDL/core/controllers/PointSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -172,6 +172,10 @@ return this as MapOverlay; } } - + /// <summary> + /// + /// </summary> + public void UpdatePreview() + { } } } Modified: branches/FreeTrainSDL/core/controllers/RectSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -221,5 +221,11 @@ { onCanceled(); } + + /// <summary> + /// + /// </summary> + public void UpdatePreview() + { } } } Modified: branches/FreeTrainSDL/core/controllers/land/BulldozeController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/land/BulldozeController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/land/BulldozeController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -56,7 +56,7 @@ theInstance.Activate(); } - private static BulldozeController theInstance; + public static BulldozeController theInstance; /// <summary> /// /// </summary> @@ -78,7 +78,8 @@ previewBitmap = ResourceUtil.loadSystemBitmap("bulldozer.bmp"); preview.Image = previewBitmap; LandBuilderContribution builder = (LandBuilderContribution)PluginManager.theInstance.getContribution("{AE43E6DB-39F0-49FE-BE18-EE3FAC248FDE}"); - currentController = builder.createBuilder(new ControllerSiteImpl(this)); + //TODO: fix this + //currentController = builder.createBuilder(new ControllerSiteImpl(this)); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/land/LandController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/land/LandController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -56,7 +56,7 @@ theInstance.Activate(); } - private static LandController theInstance; + public static LandController theInstance; /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/controllers/land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/land/LandPropertyController.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/land/LandPropertyController.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -53,7 +53,7 @@ } - private static LandPropertyController theInstance; + public static LandPropertyController theInstance; /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs 2008-03-26 20:28:02 UTC (rev 297) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs 2008-03-27 21:24:39 UTC (rev 298) @@ -105,15 +105,6 @@ this.tabControl.SuspendLayout(); this.SuspendLayout(); // - // lblTitle - /... [truncated message content] |
From: <je...@us...> - 2008-03-27 23:04:37
|
Revision: 299 http://freetrain.svn.sourceforge.net/freetrain/?rev=299&view=rev Author: jendave Date: 2008-03-27 16:04:34 -0700 (Thu, 27 Mar 2008) Log Message: ----------- cleanups Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-03-27 21:24:39 UTC (rev 298) +++ branches/FreeTrainSDL/Program.cs 2008-03-27 23:04:34 UTC (rev 299) @@ -240,52 +240,56 @@ if (WorldDefinition.World != null) gui.clock_text = WorldDefinition.World.clock.displayString; gui.drawGUI(width, height, screen.Handle); } - screen.Update(); - } - - private void GUIButtonClick(object sender, EventArgs e) - { - switch ((string)sender) + if (mainWindowMDI != null) { - case "rail": - RailRoadController.create(); - RailRoadController.theInstance.Hide(); - RailRoadController.theInstance.MdiParent = mainWindowMDI; - //mainWindowMDI.AddOwnedForm(RailRoadController.theInstance); - RailRoadController.theInstance.Show(); - break; - case "station": - PlatformController.create(); - PlatformController.theInstance.Hide(); - PlatformController.theInstance.MdiParent = mainWindowMDI; - PlatformController.theInstance.Show(); - break; - case "train": - TrainPlacementController.create(); - TrainPlacementController.theInstance.Hide(); - TrainPlacementController.theInstance.MdiParent = mainWindowMDI; - TrainPlacementController.theInstance.Show(); - break; - case "land": - MountainController.create(); - MountainController.theInstance.Hide(); - MountainController.theInstance.MdiParent = mainWindowMDI; - MountainController.theInstance.Show(); - break; - case "struct": - VarHeightBuildingController.create(); - VarHeightBuildingController.theInstance.Hide(); - VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; - VarHeightBuildingController.theInstance.Show(); - break; - case "playlist": - BGMPlaylist bgmplaylist = new BGMPlaylist(); - bgmplaylist.MdiParent = mainWindowMDI; - bgmplaylist.Show(); - break; + if (WorldDefinition.World != null) mainWindowMDI.statusStrip.Text = WorldDefinition.World.clock.displayString; } + screen.Update(); } + //private void GUIButtonClick(object sender, EventArgs e) + //{ + // switch ((string)sender) + // { + // case "rail": + // RailRoadController.create(); + // RailRoadController.theInstance.Hide(); + // RailRoadController.theInstance.MdiParent = mainWindowMDI; + // //mainWindowMDI.AddOwnedForm(RailRoadController.theInstance); + // RailRoadController.theInstance.Show(); + // break; + // case "station": + // PlatformController.create(); + // PlatformController.theInstance.Hide(); + // PlatformController.theInstance.MdiParent = mainWindowMDI; + // PlatformController.theInstance.Show(); + // break; + // case "train": + // TrainPlacementController.create(); + // TrainPlacementController.theInstance.Hide(); + // TrainPlacementController.theInstance.MdiParent = mainWindowMDI; + // TrainPlacementController.theInstance.Show(); + // break; + // case "land": + // MountainController.create(); + // MountainController.theInstance.Hide(); + // MountainController.theInstance.MdiParent = mainWindowMDI; + // MountainController.theInstance.Show(); + // break; + // case "struct": + // VarHeightBuildingController.create(); + // VarHeightBuildingController.theInstance.Hide(); + // VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; + // VarHeightBuildingController.theInstance.Show(); + // break; + // case "playlist": + // BGMPlaylist bgmplaylist = new BGMPlaylist(); + // bgmplaylist.MdiParent = mainWindowMDI; + // bgmplaylist.Show(); + // break; + // } + //} + private bool scrollByDrag(Point curMousePos) { int dragAccel = 1; @@ -364,14 +368,14 @@ } gui = new SDLGUI(); - gui.ButtonClick += new EventHandler(GUIButtonClick); + //gui.ButtonClick += new EventHandler(GUIButtonClick); gui.initGUI(width, height, videoInfo.vfmt); - gui.addButton("rail", "Railroad Construction"); - gui.addButton("station", "Station Construction"); - gui.addButton("train", "Train Stuff"); - gui.addButton("land", "Modify Terrain"); - gui.addButton("struct", "Structure Construction"); - gui.addButton("playlist", "Music Playlist"); + //gui.addButton("rail", "Railroad Construction"); + //gui.addButton("station", "Station Construction"); + //gui.addButton("train", "Train Stuff"); + //gui.addButton("land", "Modify Terrain"); + //gui.addButton("struct", "Structure Construction"); + //gui.addButton("playlist", "Music Playlist"); gui.clock_text = "Initialising..."; Modified: branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs 2008-03-27 21:24:39 UTC (rev 298) +++ branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs 2008-03-27 23:04:34 UTC (rev 299) @@ -554,7 +554,6 @@ private System.Windows.Forms.MenuStrip menuStrip; private System.Windows.Forms.ToolStrip toolStrip; - private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; @@ -604,6 +603,7 @@ private System.Windows.Forms.ToolStripButton printPreviewToolStripButton; private System.Windows.Forms.ToolStripButton helpToolStripButton; private System.Windows.Forms.ToolTip ToolTip; + public System.Windows.Forms.StatusStrip statusStrip; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-03-31 22:48:31
|
Revision: 300 http://freetrain.svn.sourceforge.net/freetrain/?rev=300&view=rev Author: jendave Date: 2008-03-31 15:48:37 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Major GUI changes. Trying to get everything into the MDI interface. Modified Paths: -------------- branches/FreeTrainSDL/FreeTrainSDL.csproj branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/SDLGUI.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs branches/FreeTrainSDL/core/contributions/common/IEntityBuilder.cs branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs branches/FreeTrainSDL/core/contributions/land/Bulldozer.cs branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs branches/FreeTrainSDL/core/contributions/rail/RailAccessoryContribution.cs branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/controllers/AbstractLineController.cs branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/controllers/LocationStore.cs branches/FreeTrainSDL/core/controllers/ModalController.cs branches/FreeTrainSDL/core/controllers/PointSelectorController.cs branches/FreeTrainSDL/core/controllers/RectSelectorController.cs branches/FreeTrainSDL/core/controllers/land/BulldozeController.cs branches/FreeTrainSDL/core/controllers/land/BulldozeController.resx branches/FreeTrainSDL/core/controllers/land/LandController.cs branches/FreeTrainSDL/core/controllers/land/LandController.resx branches/FreeTrainSDL/core/controllers/land/LandPropertyController.cs branches/FreeTrainSDL/core/controllers/land/LandPropertyController.resx branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/SpecialPurposeRailController.cs branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/controllers/road/RoadController.cs branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs branches/FreeTrainSDL/core/framework/AboutDialog.cs branches/FreeTrainSDL/core/framework/GlobalOptions.cs branches/FreeTrainSDL/core/framework/MainWindow.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.cs branches/FreeTrainSDL/core/framework/ResourceUtil.cs branches/FreeTrainSDL/core/framework/Splash.cs branches/FreeTrainSDL/core/framework/Splash.resx branches/FreeTrainSDL/core/framework/graphics/AlphaBlendSpriteSet.cs branches/FreeTrainSDL/core/framework/graphics/Surface.cs branches/FreeTrainSDL/core/res/about.html branches/FreeTrainSDL/core/views/GlobalViewOptions.cs branches/FreeTrainSDL/core/views/MapOverlay.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/map/MapView.cs branches/FreeTrainSDL/core/world/Car.cs branches/FreeTrainSDL/core/world/Clock.cs branches/FreeTrainSDL/core/world/Cube.cs branches/FreeTrainSDL/core/world/DrawContext.cs branches/FreeTrainSDL/core/world/Location.cs branches/FreeTrainSDL/core/world/RRCrossing.cs branches/FreeTrainSDL/core/world/Voxel.cs branches/FreeTrainSDL/core/world/VoxelOutlookListener.cs branches/FreeTrainSDL/core/world/WorldDefinition.cs branches/FreeTrainSDL/core/world/accounting/BalanceSheetForm.cs branches/FreeTrainSDL/core/world/development/DevelopConfigure.cs branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/world/development/LandValueInspector.cs branches/FreeTrainSDL/core/world/land/LandPropertyVoxel.cs branches/FreeTrainSDL/core/world/land/StaticLandVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgeRail.cs branches/FreeTrainSDL/core/world/rail/FatPlatform.cs branches/FreeTrainSDL/core/world/rail/JunctionRailRoad.cs branches/FreeTrainSDL/core/world/rail/PassagewayRail.cs branches/FreeTrainSDL/core/world/rail/Platform.cs branches/FreeTrainSDL/core/world/rail/RailRoad.cs branches/FreeTrainSDL/core/world/rail/SingleRailRoad.cs branches/FreeTrainSDL/core/world/rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/world/rail/StealSupportedRailContributionImpl.cs branches/FreeTrainSDL/core/world/rail/ThinPlatform.cs branches/FreeTrainSDL/core/world/rail/Train.cs branches/FreeTrainSDL/core/world/rail/TunnelRail.cs branches/FreeTrainSDL/core/world/road/Road.cs branches/FreeTrainSDL/core/world/structs/ConstructionSite.cs branches/FreeTrainSDL/core/world/structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/world/structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/world/subsidiaries/MarketWindow.cs branches/FreeTrainSDL/core/world/terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerForm.resx branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCar.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/CategoryTreeWnd.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.resx branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.resx branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigDialog.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Added Paths: ----------- branches/FreeTrainSDL/core/framework/AboutDialog.Designer.cs branches/FreeTrainSDL/core/framework/Splash.Designer.cs Property Changed: ---------------- branches/FreeTrainSDL/core/controllers/ branches/FreeTrainSDL/core/framework/ Modified: branches/FreeTrainSDL/FreeTrainSDL.csproj =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-03-31 22:48:37 UTC (rev 300) @@ -70,8 +70,6 @@ <DesignTimeSharedInput>True</DesignTimeSharedInput> <DependentUpon>Settings.settings</DependentUpon> </Compile> - <Compile Include="SDLGUI.cs" /> - <Compile Include="SDLGUIButton.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="core\FreeTrain.csproj"> Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/Program.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -27,7 +27,6 @@ using Tao.Sdl; using SdlDotNet.Audio; -//using SdlDotNet.Graphics; using SdlDotNet.Core; using SdlDotNet.Input; @@ -54,13 +53,13 @@ int height = 480; int mapXOffset = 12; int mapYOffset = 24; + Splash splashscreen; System.Windows.Forms.Timer timer; SdlDotNet.Graphics.Surface screen; - SDLGUI gui; Sdl.SDL_VideoInfo videoInfo; Sdl.SDL_PixelFormat pixelFormat; int currentBpp = 16; - ModalController controller = null; + IModalController controller = null; bool dragMode = false; Point dragStartMousePosition; Point dragStartScrollPosition; @@ -96,8 +95,8 @@ private void UpdateMessage(string msg, float progress) { - //Console.WriteLine("LOADING: " + msg + "{" + progress + "}"); - gui.addSplashText(msg.Replace('\n', ' '), progress); + splashscreen.status.AppendText(msg); + splashscreen.status.AppendText("\n"); } private void MusicHasStopped() @@ -117,15 +116,14 @@ { if (qView != null) { - controller = MainWindow.mainWindow.currentController; - //MainWindow.mainWindow.Show(); + controller = MainWindow.mainWindow.CurrentController; qView.updateScreen(); if (WorldDefinition.World.Satellite == null || WorldDefinition.World.Satellite.surface.w != 150 || WorldDefinition.World.Satellite.surface.h != 150) { WorldDefinition.World.Satellite = new Surface(150, 150, 32); - WorldDefinition.World.Satellite.sourceColorKey = Color.Magenta; + WorldDefinition.World.Satellite.SourceColorKey = Color.Magenta; WorldDefinition.World.Satellite.Fill(Color.FromArgb(222, 195, 132)); } } @@ -138,11 +136,6 @@ { Events.QuitApplication(); } - if (e.Key == Key.B) - { - RailRoadController.create(); - } - } private void Resize(object sender, SdlDotNet.Graphics.VideoResizeEventArgs e) @@ -184,15 +177,12 @@ if (lastMouseState) { - if (!gui.checkIfGUIClick(e.EventStruct.button)) + if (controller != null) { - if (controller != null) - { - Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); - Location xyz = qView.fromABToXYZ(ab, controller); + Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); + Location xyz = qView.fromABToXYZ(ab, controller); - if (e.Button == MouseButton.PrimaryButton) controller.OnClick(null, xyz, ab); - } + if (e.Button == MouseButton.PrimaryButton) controller.OnClick(null, xyz, ab); } } lastMouseState = e.ButtonPressed; @@ -206,7 +196,7 @@ } else { - gui.checkMouseMovement(e.EventStruct.motion); + //gui.checkMouseMovement(e.EventStruct.motion); if (controller != null) { Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); @@ -234,62 +224,13 @@ private void finalDraw() { - if (gui != null) + if (mainWindowMDI != null && WorldDefinition.World != null) { - gui.updateGUIElements(width, height); - if (WorldDefinition.World != null) gui.clock_text = WorldDefinition.World.clock.displayString; - gui.drawGUI(width, height, screen.Handle); + mainWindowMDI.toolStripStatusLabel.Text = WorldDefinition.World.clock.displayString; } - if (mainWindowMDI != null) - { - if (WorldDefinition.World != null) mainWindowMDI.statusStrip.Text = WorldDefinition.World.clock.displayString; - } screen.Update(); } - //private void GUIButtonClick(object sender, EventArgs e) - //{ - // switch ((string)sender) - // { - // case "rail": - // RailRoadController.create(); - // RailRoadController.theInstance.Hide(); - // RailRoadController.theInstance.MdiParent = mainWindowMDI; - // //mainWindowMDI.AddOwnedForm(RailRoadController.theInstance); - // RailRoadController.theInstance.Show(); - // break; - // case "station": - // PlatformController.create(); - // PlatformController.theInstance.Hide(); - // PlatformController.theInstance.MdiParent = mainWindowMDI; - // PlatformController.theInstance.Show(); - // break; - // case "train": - // TrainPlacementController.create(); - // TrainPlacementController.theInstance.Hide(); - // TrainPlacementController.theInstance.MdiParent = mainWindowMDI; - // TrainPlacementController.theInstance.Show(); - // break; - // case "land": - // MountainController.create(); - // MountainController.theInstance.Hide(); - // MountainController.theInstance.MdiParent = mainWindowMDI; - // MountainController.theInstance.Show(); - // break; - // case "struct": - // VarHeightBuildingController.create(); - // VarHeightBuildingController.theInstance.Hide(); - // VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; - // VarHeightBuildingController.theInstance.Show(); - // break; - // case "playlist": - // BGMPlaylist bgmplaylist = new BGMPlaylist(); - // bgmplaylist.MdiParent = mainWindowMDI; - // bgmplaylist.Show(); - // break; - // } - //} - private bool scrollByDrag(Point curMousePos) { int dragAccel = 1; @@ -315,12 +256,16 @@ [STAThread] static void Main() { - FreeTrainSDL ftsdl = new FreeTrainSDL(); - ftsdl.Go(); + FreeTrainSDL freeTrainSDL = new FreeTrainSDL(); + freeTrainSDL.Go(); } private void Go() { + splashscreen = new Splash(); + splashscreen.Show(); + splashscreen.BringToFront(); + splashscreen.Refresh(); timer = new System.Windows.Forms.Timer(); Events.KeyboardDown += new EventHandler<KeyboardEventArgs>(this.KeyDown); Events.MouseButtonDown += @@ -344,6 +289,7 @@ SdlDotNet.Graphics.Video.WindowIcon(); SdlDotNet.Graphics.Video.WindowCaption = Translation.GetString("MAIN_WINDOW_TITLE"); SdlDotNet.Graphics.Video.Initialize(); + splashscreen.BringToFront(); } catch { @@ -366,113 +312,42 @@ videoInfo = (Sdl.SDL_VideoInfo)Marshal.PtrToStructure(videoInfoPointer, typeof(Sdl.SDL_VideoInfo)); pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(videoInfo.vfmt, typeof(Sdl.SDL_PixelFormat)); } + splashscreen.status.AppendText("FreeTrain SDL Starting..."); + splashscreen.status.AppendText("\n"); + splashscreen.Refresh(); - gui = new SDLGUI(); - //gui.ButtonClick += new EventHandler(GUIButtonClick); - gui.initGUI(width, height, videoInfo.vfmt); - //gui.addButton("rail", "Railroad Construction"); - //gui.addButton("station", "Station Construction"); - //gui.addButton("train", "Train Stuff"); - //gui.addButton("land", "Modify Terrain"); - //gui.addButton("struct", "Structure Construction"); - //gui.addButton("playlist", "Music Playlist"); - - gui.clock_text = "Initialising..."; - - UpdateMessage("FreeTrain SDL Starting...", -1); - gui.SHOW_SPLASH = true; - finalDraw(); MainWindow.mainWindow = new MainWindow(null, true); - UpdateMessage("Loading plugins...", -1); + splashscreen.status.AppendText("Loading plugins..."); + splashscreen.status.AppendText("\n"); + splashscreen.Refresh(); finalDraw(); Core.init(null, null, null, new ProgressHandler(UpdateMessage), true); world = new WorldDefinition(new Distance(150, 150, 7), 3); WorldDefinition.World = world; weatherOverlay = NullWeatherOverlay.theInstance; - - UpdateMessage("Creating Map...", 0); finalDraw(); qView = new QuarterViewDrawer(world, new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8)); qView.offscreenBuffer = new Surface(world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8, screen.CreateCompatibleSurface().Pixels); - qView.offscreenBuffer.sourceColorKey = Color.Magenta; + qView.offscreenBuffer.SourceColorKey = Color.Magenta; qView.recreateDrawBuffer(new Size(width, height), true); - UpdateMessage("Creating Map...", 100); + splashscreen.status.AppendText("Creating Map..."); + splashscreen.status.AppendText("\n"); + splashscreen.Refresh(); finalDraw(); qView.draw(new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8), null); - - gui.SHOW_SPLASH = false; - timer.Tick += new EventHandler(timerTick); timer.Interval = 33; timer.Enabled = true; timer.Start(); mainWindowMDI = new MainWindowMDI(); mainWindowMDI.Show(); - RailRoadController.create(); - RailRoadController.theInstance.Hide(); - RailRoadController.theInstance.MdiParent = mainWindowMDI; - RailRoadController.theInstance.WindowState = FormWindowState.Maximized; - RailRoadController.theInstance.Show(); - PlatformController.create(); - PlatformController.theInstance.Hide(); - PlatformController.theInstance.MdiParent = mainWindowMDI; - PlatformController.theInstance.WindowState = FormWindowState.Maximized; - PlatformController.theInstance.Show(); - TrainPlacementController.create(); - TrainPlacementController.theInstance.Hide(); - TrainPlacementController.theInstance.MdiParent = mainWindowMDI; - TrainPlacementController.theInstance.WindowState = FormWindowState.Maximized; - TrainPlacementController.theInstance.Show(); - MountainController.create(); - MountainController.theInstance.Hide(); - MountainController.theInstance.MdiParent = mainWindowMDI; - MountainController.theInstance.WindowState = FormWindowState.Maximized; - MountainController.theInstance.Show(); - VarHeightBuildingController.create(); - VarHeightBuildingController.theInstance.Hide(); - VarHeightBuildingController.theInstance.MdiParent = mainWindowMDI; - VarHeightBuildingController.theInstance.WindowState = FormWindowState.Maximized; - VarHeightBuildingController.theInstance.Show(); - LandController.create(); - LandController.theInstance.Hide(); - LandController.theInstance.MdiParent = mainWindowMDI; - LandController.theInstance.WindowState = FormWindowState.Maximized; - LandController.theInstance.Show(); - LandPropertyController.create(); - LandPropertyController.theInstance.Hide(); - LandPropertyController.theInstance.MdiParent = mainWindowMDI; - LandPropertyController.theInstance.WindowState = FormWindowState.Maximized; - LandPropertyController.theInstance.Show(); - StationPassagewayController.create(); - StationPassagewayController.theInstance.Hide(); - StationPassagewayController.theInstance.MdiParent = mainWindowMDI; - StationPassagewayController.theInstance.WindowState = FormWindowState.Maximized; - StationPassagewayController.theInstance.Show(); - SlopeRailRoadController.create(); - SlopeRailRoadController.theInstance.Hide(); - SlopeRailRoadController.theInstance.MdiParent = mainWindowMDI; - SlopeRailRoadController.theInstance.WindowState = FormWindowState.Maximized; - SlopeRailRoadController.theInstance.Show(); - PluginListDialog pluginListDialog = new PluginListDialog(); - pluginListDialog.MdiParent = mainWindowMDI; - pluginListDialog.WindowState = FormWindowState.Maximized; - pluginListDialog.Show(); - //RoadController roadController = new RoadController(); - //roadController.MdiParent = mainWindowMDI; - //roadController.Show(); - //BulldozeController.create(); - //BulldozeController.theInstance.Hide(); - //BulldozeController.theInstance.MdiParent = mainWindowMDI; - //BulldozeController.theInstance.Show(); - BGMPlaylist bgmplaylist = new BGMPlaylist(); - bgmplaylist.MdiParent = mainWindowMDI; - bgmplaylist.Show(); + splashscreen.BringToFront(); + splashscreen.Close(); - Events.Run(); } Modified: branches/FreeTrainSDL/SDLGUI.cs =================================================================== --- branches/FreeTrainSDL/SDLGUI.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/SDLGUI.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -34,27 +34,13 @@ { private Color baseGUIColor, shadeGUIColor, drawerGUIColor; private int baseColor, shadeColor; - private Surface top_bar, splash; //, satmap, bot_right, bot_left; + private Surface top_bar; private IntPtr freesans; - //int BOTTOM_GUI_HEIGHT = 25; - //public int SIDE_GUI_WIDTH = 25; - public int TOP_GUI_HEIGHT = 24; - - int MAX_SPLASH_LINES = 10; - - public bool SHOW_SPLASH = false; - private string[] SPLASH_TEXT; public string clock_text; - protected int SPLASH_TEXT_HEIGHT = 10; - protected int SPLASH_PERCENT = 0; - public EventHandler ButtonClick; - const int MAX_BUTTONS = 16; - private SDLGUIButton[] top_toolbar; - public SDLGUI() { SdlTtf.TTF_Init(); @@ -66,11 +52,6 @@ static string guiDirectory = "gui"; - public static string GuiDirectory - { - get { return guiDirectory; } - set { guiDirectory = value; } - } static string filePath = Path.Combine("..", ".."); private static void initGuiDirectory() { @@ -86,55 +67,11 @@ baseColor = Sdl.SDL_MapRGB(pf, baseGUIColor.R, baseGUIColor.G, baseGUIColor.B); shadeColor = Sdl.SDL_MapRGB(pf, shadeGUIColor.R, shadeGUIColor.G, shadeGUIColor.B); - top_toolbar = new SDLGUIButton[MAX_BUTTONS]; - - /*rail = new SDLGUIButton("rail","Railroad Construction", 10, 10); - if (ButtonClick != null) rail.ButtonClick += ButtonClick; - - station = new SDLGUIButton("station","Station Construction", 10, 10); - if (ButtonClick != null) station.ButtonClick += ButtonClick; - - station = new SDLGUIButton("station","Station Construction", 10, 10); - if (ButtonClick != null) station.ButtonClick += ButtonClick;*/ - top_bar = new Surface(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "top.bmp"))); - splash = new Surface(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "splash.bmp"))); - freesans = SdlTtf.TTF_OpenFont(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "FreeSans.ttf")), SPLASH_TEXT_HEIGHT); - SPLASH_TEXT = new string[MAX_SPLASH_LINES]; - for (int cur = 0; cur < MAX_SPLASH_LINES; cur++) SPLASH_TEXT[cur] = string.Empty; + + freesans = SdlTtf.TTF_OpenFont(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "FreeSans.ttf")), 10); } - public void checkMouseMovement(Sdl.SDL_MouseMotionEvent e) - { - for (int i = 0; i < MAX_BUTTONS; i++) if (top_toolbar[i] != null) top_toolbar[i].checkMovement(e); - } - - public bool checkIfGUIClick(Sdl.SDL_MouseButtonEvent e) - { - bool wasGUIClick = false; - for (int i = 0; i < MAX_BUTTONS; i++) - { - if (!wasGUIClick && top_toolbar[i] != null) wasGUIClick = top_toolbar[i].checkClick(e); - } - return wasGUIClick; - } - - public void addSplashText(String nstr, float percent) - { - SPLASH_PERCENT = (int)(percent); - if (!SPLASH_TEXT[MAX_SPLASH_LINES - 1].Contains(nstr)) - for (int cur = 0; cur < MAX_SPLASH_LINES; cur++) - { - if (cur < (MAX_SPLASH_LINES - 1)) SPLASH_TEXT[cur] = SPLASH_TEXT[cur + 1]; - else SPLASH_TEXT[cur] = nstr; - } - } - - public void updateGUIElements(int width, int height) - { - - } - public void drawGUI(int width, int height, IntPtr screen) { int curXPos = -(top_bar.Size.Width); @@ -149,109 +86,17 @@ Tao.Sdl.Sdl.SDL_BlitSurface(top_bar.surfacePtr(), ref dst, screen, ref src); } - for (int i = 0; i < MAX_BUTTONS; i++) if (top_toolbar[i] != null) top_toolbar[i].draw(screen); - - /*Sdl.SDL_Rect current = new Sdl.SDL_Rect((short)(width - SIDE_GUI_WIDTH), (short)TOP_GUI_HEIGHT, (short)width, (short)height); - Tao.Sdl.Sdl.SDL_FillRect(screen, ref current, baseColor); - current = new Sdl.SDL_Rect(0, (short)TOP_GUI_HEIGHT, (short)SIDE_GUI_WIDTH, (short)height); - Tao.Sdl.Sdl.SDL_FillRect(screen, ref current, baseColor); - current = new Sdl.SDL_Rect(0, (short)(height - BOTTOM_GUI_HEIGHT), (short)width, (short)height); - Tao.Sdl.Sdl.SDL_FillRect(screen, ref current, baseColor); - - - Tao.Sdl.SdlGfx.vlineColor(screen,(short)(width - (SIDE_GUI_WIDTH + 1)),(short)TOP_GUI_HEIGHT,(short)(height - BOTTOM_GUI_HEIGHT - 17),0); - Tao.Sdl.SdlGfx.vlineColor(screen, (short)(width - (SIDE_GUI_WIDTH)), (short)(TOP_GUI_HEIGHT + 2), (short)(height - BOTTOM_GUI_HEIGHT - 17), shadeColor); - - src = bot_right.clipSDLRect; - dst = new Sdl.SDL_Rect((short)(width - (SIDE_GUI_WIDTH) - bot_right.size.Width), (short)(height - BOTTOM_GUI_HEIGHT - bot_right.size.Height + 1), (short)bot_right.size.Width, (short)bot_right.size.Height); - Tao.Sdl.Sdl.SDL_BlitSurface(bot_right.surfacePtr(), ref src, screen, ref dst); - - - Tao.Sdl.SdlGfx.hlineColor(screen, - (short)(width - (SIDE_GUI_WIDTH) - bot_right.size.Width - 1), - (short)(SIDE_GUI_WIDTH + bot_left.size.Width - 2), - (short)(height - BOTTOM_GUI_HEIGHT - 2), - 0); - Tao.Sdl.SdlGfx.hlineColor(screen, - (short)(width - (SIDE_GUI_WIDTH) - bot_right.size.Width - 1), - (short)(SIDE_GUI_WIDTH + bot_left.size.Width - 1), - (short)(height - BOTTOM_GUI_HEIGHT - 1), - shadeColor); - - Tao.Sdl.SdlGfx.vlineColor(screen,(short)(SIDE_GUI_WIDTH),(short)(TOP_GUI_HEIGHT),(short)(height - BOTTOM_GUI_HEIGHT - 18),0); - Tao.Sdl.SdlGfx.vlineColor(screen,(short)(SIDE_GUI_WIDTH - 1),(short)(TOP_GUI_HEIGHT + 2),(short)(height - BOTTOM_GUI_HEIGHT - 16), shadeColor); - - src = bot_left.clipSDLRect; - dst = new Sdl.SDL_Rect((short)(SIDE_GUI_WIDTH - 1), (short)(height - BOTTOM_GUI_HEIGHT - bot_left.size.Height + 1), (short)bot_left.size.Width, (short)bot_left.size.Height); - Tao.Sdl.Sdl.SDL_BlitSurface(bot_left.surfacePtr(), ref src, screen, ref dst); - - - Tao.Sdl.SdlGfx.hlineColor(screen,(short)(width - (SIDE_GUI_WIDTH + 1)),(short)(width),(short)(TOP_GUI_HEIGHT),0); - Tao.Sdl.SdlGfx.hlineColor(screen,0,(short)(SIDE_GUI_WIDTH),(short)(TOP_GUI_HEIGHT),0); - - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(SIDE_GUI_WIDTH - 2), (short)(TOP_GUI_HEIGHT), 0, 0, 0, 255); - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(SIDE_GUI_WIDTH - 1), (short)(TOP_GUI_HEIGHT), 0, 0, 0, 255); - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(SIDE_GUI_WIDTH - 1), (short)(TOP_GUI_HEIGHT + 1), 0, 0, 0, 255); - - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(width - SIDE_GUI_WIDTH + 1), (short)(TOP_GUI_HEIGHT), 0, 0, 0, 255); - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(width - SIDE_GUI_WIDTH), (short)(TOP_GUI_HEIGHT), 0, 0, 0, 255); - Tao.Sdl.SdlGfx.pixelRGBA(screen, (short)(width - SIDE_GUI_WIDTH), (short)(TOP_GUI_HEIGHT + 1), 0, 0, 0, 255);*/ - if (clock_text != null && clock_text != string.Empty) { drawText(screen, freesans, clock_text, Color.Black, (width - 160), 2, 0, false, false); } - - if (SHOW_SPLASH) - { - int xpos = (width / 2) - (splash.Size.Width / 2); - int ypos = (height / 2) - (splash.Size.Height / 2); - src = new Sdl.SDL_Rect((short)xpos, (short)ypos, (short)splash.Size.Width, (short)(splash.Size.Height * 2)); - Tao.Sdl.Sdl.SDL_FillRect(screen, ref src, baseColor); - src = splash.clipSDLRect; - dst = new Sdl.SDL_Rect((short)xpos, (short)ypos, (short)splash.Size.Width, (short)(splash.Size.Height)); - Tao.Sdl.Sdl.SDL_BlitSurface(splash.surfacePtr(), ref src, screen, ref dst); - for (int i = 0; i < MAX_SPLASH_LINES; i++) - if (SPLASH_TEXT[i] != string.Empty) - drawText(screen, freesans, SPLASH_TEXT[i], Color.Black, xpos + 10, (ypos + splash.Size.Height + 10) + (i * (2 + SPLASH_TEXT_HEIGHT)), 0, false, false); - drawText(screen, freesans, "[" + SPLASH_PERCENT.ToString() + "%]", Color.Black, new Point(xpos + (splash.Size.Height * 2) - 16, ypos + splash.Size.Width - 20), 0, false, false); - } - } - public bool addButton(string name, string tooltip) - { - bool added = false; - for (int i = 0; i < MAX_BUTTONS; i++) - { - if (!added && top_toolbar[i] == null) - { - top_toolbar[i] = new SDLGUIButton(name, tooltip, (10 + (i * 26)), 1, ref ButtonClick); - added = true; - } - } - return added; - } - - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, Color c, Point p, int rotate, bool fill, bool centered) - { - drawText(screen, in_font, in_text, c.R, c.G, c.B, 233, p.X, p.Y, rotate, fill, centered); - } - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, Color c, Point p, int alpha, int rotate, bool fill, bool centered) - { - drawText(screen, in_font, in_text, c.R, c.G, c.B, (byte)alpha, p.X, p.Y, rotate, fill, centered); - } - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, Color c, int x, int y, int rotate, bool fill, bool centered) { drawText(screen, in_font, in_text, c.R, c.G, c.B, 255, x, y, rotate, fill, centered); } - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, byte r, byte g, byte b, int x, int y, int rotate, bool fill, bool centered) - { - drawText(screen, in_font, in_text, r, g, b, 255, x, y, rotate, fill, centered); - } - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, byte r, byte g, byte b, byte a, int x, int y, int rotate, bool fill, bool centered) { IntPtr text; @@ -288,15 +133,5 @@ Sdl.SDL_FreeSurface(text); } } - - public void updateSatellite(ref Surface s) - { - /* if (sat.DRAW_OPEN_AMOUNT > 0) - { - //if (satmap == null || satmap.surface.w != w || satmap.surface.h != h) satmap = new Surface(w, h, 16); - - satmap = s; - }*/ - } } } Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 22:48:37 UTC (rev 300) @@ -264,9 +264,6 @@ <Compile Include="controllers\AbstractLineController.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="controllers\ControllerHostForm.cs"> - <SubType>Form</SubType> - </Compile> <Compile Include="controllers\CubeSelectorController.cs"> <SubType>Code</SubType> </Compile> @@ -393,6 +390,14 @@ <Compile Include="framework\ConfigDialog.cs"> <SubType>Form</SubType> </Compile> + <Compile Include="framework\AboutDialog.Designer.cs"> + <DependentUpon>AboutDialog.cs</DependentUpon> + <SubType>Form</SubType> + </Compile> + <Compile Include="framework\Splash.Designer.cs"> + <DependentUpon>Splash.cs</DependentUpon> + <SubType>Form</SubType> + </Compile> <Compile Include="framework\Core.cs"> <SubType>Code</SubType> </Compile> @@ -471,9 +476,6 @@ <Compile Include="framework\MainWindowMDI.Designer.cs"> <DependentUpon>MainWindowMDI.cs</DependentUpon> </Compile> - <Compile Include="framework\MenuItemConstants.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="framework\NewWorldDialog.cs"> <SubType>Form</SubType> </Compile> @@ -897,9 +899,6 @@ <EmbeddedResource Include="controllers\AbstractLineController.resx"> <DependentUpon>AbstractLineController.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="controllers\ControllerHostForm.resx"> - <DependentUpon>ControllerHostForm.cs</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="controllers\land\BulldozeController.resx"> <DependentUpon>BulldozeController.cs</DependentUpon> </EmbeddedResource> Modified: branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -163,7 +163,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createBuilder(IControllerSite site) + public override IModalController createBuilder(IControllerSite site) { return new FixedSizeStructurePlacementController(this, site); } @@ -172,7 +172,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createRemover(IControllerSite site) + public override IModalController createRemover(IControllerSite site) { return new FixedSizeStructureRemovalController(this, site); } Modified: branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -33,7 +33,7 @@ /// <summary> /// FixedSizeStructureController /// </summary> - public class FixedSizeStructurePlacementController : CubeSelectorController, MapOverlay + public class FixedSizeStructurePlacementController : CubeSelectorController, IMapOverlay { /// <summary> /// @@ -84,7 +84,7 @@ /// </summary> /// <param name="view"></param> /// <param name="surface"></param> - public void DrawBefore(QuarterViewDrawer view, DrawContextEx surface) { } + public void DrawBefore(QuarterViewDrawer view, DrawContext surface) { } /// <summary> /// /// </summary> @@ -92,17 +92,17 @@ /// <param name="canvas"></param> /// <param name="loc"></param> /// <param name="pt"></param> - public void DrawVoxel(QuarterViewDrawer view, DrawContextEx canvas, Location loc, Point pt) + public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { if (currentCube.contains(loc)) - alphaSprites.getSprite(loc - this.location).drawAlpha(canvas.surface, pt); + alphaSprites.getSprite(loc - this.location).drawAlpha(canvas.Surface, pt); } /// <summary> /// /// </summary> /// <param name="view"></param> /// <param name="surface"></param> - public void DrawAfter(QuarterViewDrawer view, DrawContextEx surface) { } + public void DrawAfter(QuarterViewDrawer view, DrawContext surface) { } [Serializable] Modified: branches/FreeTrainSDL/core/contributions/common/IEntityBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/IEntityBuilder.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/common/IEntityBuilder.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -75,12 +75,12 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - ModalController createBuilder(IControllerSite site); + IModalController createBuilder(IControllerSite site); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - ModalController createRemover(IControllerSite site); + IModalController createRemover(IControllerSite site); } } Modified: branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -148,13 +148,13 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual ModalController createBuilder(IControllerSite site) { return core.createBuilder(site); } + public virtual IModalController createBuilder(IControllerSite site) { return core.createBuilder(site); } /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual ModalController createRemover(IControllerSite site) { return core.createRemover(site); } + public virtual IModalController createRemover(IControllerSite site) { return core.createRemover(site); } /// <summary> /// /// </summary> @@ -240,7 +240,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual FreeTrain.Controllers.ModalController createBuilder(FreeTrain.Controllers.IControllerSite site) + public virtual FreeTrain.Controllers.IModalController createBuilder(FreeTrain.Controllers.IControllerSite site) { throw new NotImplementedException(); } @@ -249,7 +249,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual FreeTrain.Controllers.ModalController createRemover(FreeTrain.Controllers.IControllerSite site) + public virtual FreeTrain.Controllers.IModalController createRemover(FreeTrain.Controllers.IControllerSite site) { throw new NotImplementedException(); } Modified: branches/FreeTrainSDL/core/contributions/land/Bulldozer.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/Bulldozer.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/land/Bulldozer.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -54,7 +54,7 @@ public override void create(int x1, int y1, int x2, int y2, int z, bool owned) { bulldoze(new Location(x1, y1, z), new Location(x2, y2, z)); - WorldDefinition.World.onVoxelUpdated(new Cube(x1, y1, z, x2 - x1 + 1, y2 - y1 + 1, 1)); + WorldDefinition.World.OnVoxelUpdated(new Cube(x1, y1, z, x2 - x1 + 1, y2 - y1 + 1, 1)); } /// <summary> /// @@ -108,7 +108,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createBuilder(IControllerSite site) + public override IModalController createBuilder(IControllerSite site) { return createRemover(site); } Modified: branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -32,7 +32,7 @@ /// ModalController implementation typical for most of the land builder contribution. /// This class is here just for the code reuse. /// </summary> - public class DefaultControllerImpl : RectSelectorController, MapOverlay + public class DefaultControllerImpl : RectSelectorController, IMapOverlay { /// <summary> /// @@ -70,7 +70,7 @@ /// </summary> /// <param name="view"></param> /// <param name="surface"></param> - public void DrawBefore(QuarterViewDrawer view, DrawContextEx surface) { } + public void DrawBefore(QuarterViewDrawer view, DrawContext surface) { } /// <summary> /// /// </summary> @@ -78,18 +78,18 @@ /// <param name="canvas"></param> /// <param name="loc"></param> /// <param name="pt"></param> - public void DrawVoxel(QuarterViewDrawer view, DrawContextEx canvas, Location loc, Point pt) + public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { if (loc.z != currentLoc.z) return; if (anchor != UNPLACED && loc.inBetween(anchor, currentLoc)) - spriteBuilder().drawAlpha(canvas.surface, pt); + spriteBuilder().drawAlpha(canvas.Surface, pt); } /// <summary> /// /// </summary> /// <param name="view"></param> /// <param name="surface"></param> - public void DrawAfter(QuarterViewDrawer view, DrawContextEx surface) { } + public void DrawAfter(QuarterViewDrawer view, DrawContext surface) { } } } Modified: branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -141,7 +141,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createRemover(IControllerSite site) + public override IModalController createRemover(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); Modified: branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -107,7 +107,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createBuilder(IControllerSite site) + public override IModalController createBuilder(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getLandSprite)); } Modified: branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -90,7 +90,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createBuilder(IControllerSite site) + public override IModalController createBuilder(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); } Modified: branches/FreeTrainSDL/core/contributions/rail/RailAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/rail/RailAccessoryContribution.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/rail/RailAccessoryContribution.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -86,13 +86,13 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public abstract FreeTrain.Controllers.ModalController createBuilder(FreeTrain.Controllers.IControllerSite site); + public abstract FreeTrain.Controllers.IModalController createBuilder(FreeTrain.Controllers.IControllerSite site); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public abstract FreeTrain.Controllers.ModalController createRemover(FreeTrain.Controllers.IControllerSite site); + public abstract FreeTrain.Controllers.IModalController createRemover(FreeTrain.Controllers.IControllerSite site); #endregion } Modified: branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -236,7 +236,7 @@ /// <param name="pt"></param> public override void drawBefore(DrawContext display, Point pt) { - contribution.getSprite(pattern.dirs).draw(display.surface, pt); + contribution.getSprite(pattern.dirs).draw(display.Surface, pt); } /// <summary> /// @@ -269,7 +269,7 @@ voxel.road = new RoadImpl(contribution, voxel, RoadPattern.get(dirs)); } - WorldDefinition.World.onVoxelUpdated(location); + WorldDefinition.World.OnVoxelUpdated(location); } /// <summary> /// Modified: branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -245,7 +245,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createBuilder(IControllerSite site) + public override IModalController createBuilder(IControllerSite site) { // TODO throw new NotImplementedException(); @@ -255,7 +255,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override ModalController createRemover(IControllerSite site) + public override IModalController createRemover(IControllerSite site) { // TODO throw new NotImplementedException(); Property changes on: branches/FreeTrainSDL/core/controllers ___________________________________________________________________ Name: svn:ignore + *.swp Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -34,7 +34,7 @@ /// <summary> /// /// </summary> - public class AbstractControllerImpl : Form, ModalController + public class AbstractControllerImpl : Form, IModalController { /// <summary> /// @@ -53,7 +53,7 @@ // Attach the control when activated. try { - MainWindow.mainWindow.attachController(this); + MainWindow.mainWindow.AttachController(this); } catch (NullReferenceException nre) { @@ -68,8 +68,8 @@ protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { // Detach it when it is closed. - if (MainWindow.mainWindow.currentController == this) - MainWindow.mainWindow.detachController(); + if (MainWindow.mainWindow.CurrentController == this) + MainWindow.mainWindow.DetachController(); } // @@ -97,7 +97,7 @@ /// <summary> /// /// </summary> - public virtual MapOverlay Overlay { get { return this as MapOverlay; } } + public virtual IMapOverlay Overlay { get { return this as IMapOverlay; } } /// <summary> /// @@ -109,7 +109,7 @@ public virtual void OnDetached() { // redraw the entire surface to erase any left-over from this controller - WorldDefinition.World.onAllVoxelUpdated(); + WorldDefinition.World.OnAllVoxelUpdated(); } /// <summary> Modified: branches/FreeTrainSDL/core/controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -36,8 +36,11 @@ /// <summary> /// Controller that places/removes lines, such as roads or rail roads. /// </summary> - public class AbstractLineController : AbstractControllerImpl, MapOverlay + public class AbstractLineController : AbstractControllerImpl, IMapOverlay { + /// <summary> + /// + /// </summary> public AbstractLineController() : base() { } @@ -191,7 +194,7 @@ /// </summary> private Location currentPos = UNPLACED; - private static Location UNPLACED = FreeTrain.World.Location.UNPLACED; + private static Location UNPLACED = FreeTrain.World.Location.Unplaced; /// <summary> /// Aligns the given location to the anchor so that @@ -225,9 +228,9 @@ if (anchor != UNPLACED && isPlacing && currentPos != loc) { if (currentPos != UNPLACED) - WorldDefinition.World.onVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); currentPos = align(loc); - WorldDefinition.World.onVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); } } /// <summary> @@ -257,7 +260,7 @@ else // remove existing ones type.remove(anchor, loc); - WorldDefinition.World.onVoxelUpdated(Cube.createInclusive(anchor, loc)); + WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, loc)); } anchor = UNPLACED; } @@ -276,7 +279,7 @@ { // cancel the anchor if (currentPos != UNPLACED) - WorldDefinition.World.onVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); anchor = UNPLACED; } } @@ -333,7 +336,7 @@ /// </summary> /// <param name="view"></param> /// <param name="canvas"></param> - public void DrawBefore(QuarterViewDrawer view, DrawContextEx canvas) + public void DrawBefore(QuarterViewDrawer view, DrawContext canvas) { if (anchor != UNPLACED && isPlacing) canvas.Tag = type.canBeBuilt(anchor, currentPos); @@ -345,7 +348,7 @@ /// <param name="canvas"></param> /// <param name="loc"></param> /// <param name="pt"></param> - public void DrawVoxel(QuarterViewDrawer view, DrawContextEx canvas, Location loc, Point pt) + public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { object tag = canvas.Tag; @@ -360,14 +363,14 @@ /// </summary> /// <param name="view"></param> /// <param name="canvas"></param> - public void DrawAfter(QuarterViewDrawer view, DrawContextEx canvas) + public void DrawAfter(QuarterViewDrawer view, DrawContext canvas) { } /// <summary> /// Draw the preview on the given point. /// </summary> - protected virtual void draw(Direction d, DrawContextEx canvs, Point pt) + protected virtual void draw(Direction d, DrawContext canvs, Point pt) { } } } Modified: branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -31,10 +31,10 @@ /// <summary> /// ModalController that selects a cube of the fixed size. /// </summary> - public abstract class CubeSelectorController : ModalController + public abstract class CubeSelectorController : IModalController { /// <summary>Constant</summary> - protected static readonly Location UNPLACED = World.Location.UNPLACED; + protected static readonly Location UNPLACED = World.Location.Unplaced; /// <summary> /// /// </summary> @@ -83,12 +83,12 @@ /// <summary> /// /// </summary> - public virtual MapOverlay Overlay + public virtual IMapOverlay Overlay { get { // return this object if it implements MapOverlay by itself. - return this as MapOverlay; + return this as IMapOverlay; } } @@ -151,9 +151,9 @@ { // the current location is moved. // update the screen - w.onVoxelUpdated(currentCube); + w.OnVoxelUpdated(currentCube); location = loc; - w.onVoxelUpdated(currentCube); + w.OnVoxelUpdated(currentCube); } } /// <summary> @@ -166,7 +166,7 @@ public virtual void OnDetached() { // redraw the entire surface to erase any left-over from this controller - WorldDefinition.World.onAllVoxelUpdated(); + WorldDefinition.World.OnAllVoxelUpdated(); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/LocationStore.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/LocationStore.cs 2008-03-27 23:04:34 UTC (rev 299) +++ branches/FreeTrainSDL/core/controllers/LocationStore.cs 2008-03-31 22:48:37 UTC (rev 300) @@ -29,7 +29,7 @@ /// </summary> public class LocationStore { - private Location loc = Location.UNPLACED; + private Location loc = Location.Unplaced; /// <summary> /// /// </summary> @@ -47,11 +47,11 @@ } set { - if (loc != Location.UNPLACED) - WorldDefinition.World.onVoxelUpdated(loc); + if (loc != Location.Unplaced) + WorldDefinition.World.OnVoxelUpdated(loc); loc = value; - if (loc != Location.UNPLACED) - WorldDefinition.World.onVoxelUpdated(loc); + if (loc != Location.Unplaced) + WorldDefinition.World.OnVoxelUpdated(loc); } } } Modified: branches/FreeTrainSDL/core/control... [truncated message content] |
From: <je...@us...> - 2008-03-31 22:57:05
|
Revision: 301 http://freetrain.svn.sourceforge.net/freetrain/?rev=301&view=rev Author: jendave Date: 2008-03-31 15:57:10 -0700 (Mon, 31 Mar 2008) Log Message: ----------- remove unused files. Rename interface files Modified Paths: -------------- branches/FreeTrainSDL/core/FreeTrain.csproj Added Paths: ----------- branches/FreeTrainSDL/core/controllers/IModalController.cs branches/FreeTrainSDL/core/views/IMapOverlay.cs Removed Paths: ------------- branches/FreeTrainSDL/SDLGUI.cs branches/FreeTrainSDL/SDLGUIButton.cs branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs branches/FreeTrainSDL/core/controllers/ControllerHostForm.resx branches/FreeTrainSDL/core/controllers/ModalController.cs branches/FreeTrainSDL/core/framework/MenuItemConstants.cs branches/FreeTrainSDL/core/framework/MruHelper.cs branches/FreeTrainSDL/core/views/MapOverlay.cs branches/FreeTrainSDL/core/views/map/PreviewMapWindow.cs branches/FreeTrainSDL/core/views/map/PreviewMapWindow.resx Deleted: branches/FreeTrainSDL/SDLGUI.cs =================================================================== --- branches/FreeTrainSDL/SDLGUI.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/SDLGUI.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,137 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Collections; -using System.Windows.Forms; -using System.Drawing; -using System.IO; -using Tao.Sdl; -using FreeTrain.Framework.Graphics; - -namespace FreeTrain -{ - public class SDLGUI - { - private Color baseGUIColor, shadeGUIColor, drawerGUIColor; - private int baseColor, shadeColor; - private Surface top_bar; - private IntPtr freesans; - - public string clock_text; - - const int MAX_BUTTONS = 16; - - public SDLGUI() - { - SdlTtf.TTF_Init(); - baseGUIColor = Color.FromArgb(252, 252, 236); - shadeGUIColor = Color.FromArgb(152, 152, 116); - drawerGUIColor = Color.FromArgb(236, 236, 184); - initGuiDirectory(); - } - - static string guiDirectory = "gui"; - - static string filePath = Path.Combine("..", ".."); - private static void initGuiDirectory() - { - if (File.Exists(Path.Combine(guiDirectory, "FreeSans.ttf"))) - { - filePath = ""; - } - guiDirectory = Path.Combine(filePath, guiDirectory); - } - - public void initGUI(int width, int height, IntPtr pf) - { - baseColor = Sdl.SDL_MapRGB(pf, baseGUIColor.R, baseGUIColor.G, baseGUIColor.B); - shadeColor = Sdl.SDL_MapRGB(pf, shadeGUIColor.R, shadeGUIColor.G, shadeGUIColor.B); - - top_bar = new Surface(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "top.bmp"))); - - freesans = SdlTtf.TTF_OpenFont(Path.Combine(Application.StartupPath, Path.Combine(guiDirectory, "FreeSans.ttf")), 10); - } - - public void drawGUI(int width, int height, IntPtr screen) - { - int curXPos = -(top_bar.Size.Width); - - Sdl.SDL_Rect src, dst; - - while (curXPos < width) - { - curXPos += top_bar.Size.Width; - src = new Sdl.SDL_Rect((short)curXPos, 0, (short)top_bar.Size.Width, (short)top_bar.Size.Height); - dst = top_bar.clipSDLRect; - Tao.Sdl.Sdl.SDL_BlitSurface(top_bar.surfacePtr(), ref dst, screen, ref src); - } - - if (clock_text != null && clock_text != string.Empty) - { - drawText(screen, freesans, clock_text, Color.Black, (width - 160), 2, 0, false, false); - } - } - - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, Color c, int x, int y, int rotate, bool fill, bool centered) - { - drawText(screen, in_font, in_text, c.R, c.G, c.B, 255, x, y, rotate, fill, centered); - } - - public static void drawText(IntPtr screen, IntPtr in_font, string in_text, byte r, byte g, byte b, byte a, int x, int y, int rotate, bool fill, bool centered) - { - IntPtr text; - if (in_text != string.Empty) - { - if (fill) text = SdlTtf.TTF_RenderUTF8_Blended(in_font, in_text, new Sdl.SDL_Color(255, 255, 255, a)); - else text = SdlTtf.TTF_RenderUTF8_Blended(in_font, in_text, new Sdl.SDL_Color(r, g, b, a)); - Sdl.SDL_Surface txt = (Sdl.SDL_Surface)Marshal.PtrToStructure(text, typeof(Sdl.SDL_Surface)); - Sdl.SDL_Rect src = new Sdl.SDL_Rect(0, 0, (short)txt.w, (short)txt.h); - - Sdl.SDL_Rect dst, back;// = new Sdl.SDL_Rect((short)(x - (txt.w / 2)), (short)(y - (txt.h / 2)), src.w, src.h); - if (centered) dst = new Sdl.SDL_Rect((short)(x - (txt.w / 2)), (short)(y - (txt.h / 2)), (short)(src.w), (short)(src.h)); - else dst = new Sdl.SDL_Rect((short)(x), (short)(y), (short)(src.w), (short)(src.h)); - back = new Sdl.SDL_Rect((short)(dst.x - 2), (short)(dst.y - 1), (short)(dst.w + 4), (short)(dst.h + 2)); - if (rotate != 0) - { - IntPtr newSrc = SdlGfx.rotozoomSurface(text, rotate, 1, 0); - src = new Sdl.SDL_Rect(0, 0, (short)(txt.h + 2), (short)(txt.w + 2)); - if (centered) dst = new Sdl.SDL_Rect((short)(x - (txt.h / 2)), (short)(y - (txt.w / 2)), (short)(src.w), (short)(src.h)); - else dst = new Sdl.SDL_Rect((short)(x), (short)(y), (short)(src.w), (short)(src.h)); - if (fill) - { - back = new Sdl.SDL_Rect((short)(dst.x - 2), (short)(dst.y - 1), (short)(dst.w + 4), (short)(dst.h + 2)); - Tao.Sdl.Sdl.SDL_FillRect(screen, ref back, 1); - } - Tao.Sdl.Sdl.SDL_BlitSurface(newSrc, ref src, screen, ref dst); - Sdl.SDL_FreeSurface(newSrc); - } - else - { - if (fill) Tao.Sdl.Sdl.SDL_FillRect(screen, ref back, 1); - Tao.Sdl.Sdl.SDL_BlitSurface(text, ref src, screen, ref dst); - } - Sdl.SDL_FreeSurface(text); - } - } - } -} Deleted: branches/FreeTrainSDL/SDLGUIButton.cs =================================================================== --- branches/FreeTrainSDL/SDLGUIButton.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/SDLGUIButton.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,107 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using System.IO; -using Tao.Sdl; -using FreeTrain.Framework.Graphics; - -namespace FreeTrain -{ - class SDLGUIButton - { - private int x_pos, y_pos; - Surface btnon, btnoff; - private string button_name, tooltip_text; - bool button_down = false, draw_tooltip = false; - - public EventHandler ButtonClick; - - IntPtr fnt; - - public SDLGUIButton(string name, string tooltip, int x, int y, ref EventHandler click) - { - tooltip_text = tooltip; - x_pos = x; - y_pos = y; - - ButtonClick += click; - - btnoff = new Surface(Path.Combine(Application.StartupPath, Path.Combine(SDLGUI.GuiDirectory, name + ".png"))); - btnon = new Surface(Path.Combine(Application.StartupPath, Path.Combine(SDLGUI.GuiDirectory, name + "_down.png"))); - - fnt = SdlTtf.TTF_OpenFont(Path.Combine(Application.StartupPath, Path.Combine(SDLGUI.GuiDirectory, "FreeSans.ttf")), 12); - - button_name = name; - } - - public void draw(IntPtr screen) - { - Sdl.SDL_Rect dst = new Sdl.SDL_Rect((short)x_pos, (short)y_pos, btnon.clipSDLRect.w, btnon.clipSDLRect.h); - Sdl.SDL_Rect src = btnon.clipSDLRect; - - if (button_down) Tao.Sdl.Sdl.SDL_BlitSurface(btnon.surfacePtr(), ref src, screen, ref dst); - else Tao.Sdl.Sdl.SDL_BlitSurface(btnoff.surfacePtr(), ref src, screen, ref dst); - - //TOOL TIPS!?!?! - if (draw_tooltip) - { - SDLGUI.drawText(screen, fnt, tooltip_text, Color.White, new Point(x_pos, y_pos + btnon.clipRect.Height + 6), 0, true, false); - } - } - - public void checkMovement(Sdl.SDL_MouseMotionEvent e) - { - draw_tooltip = false; - button_down = false; - if (e.x >= x_pos && e.x <= (x_pos + btnon.clipSDLRect.w)) - if (e.y >= y_pos && e.y <= (y_pos + btnon.clipSDLRect.h)) - { - draw_tooltip = true; - } - - } - - public bool checkClick(Sdl.SDL_MouseButtonEvent e) - { - bool wasGUIClick = false; - button_down = false; - int x = e.x, y = e.y; - if (e.x >= x_pos && e.x <= (x_pos + btnon.clipSDLRect.w)) - { - if (e.y >= y_pos && e.y <= (y_pos + btnon.clipSDLRect.h)) - { - if (e.button == Sdl.SDL_BUTTON_LEFT) - { - button_down = true; - if (ButtonClick != null) ButtonClick(button_name, null); - } - wasGUIClick = true; - } - } - return wasGUIClick; - } - } -} Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 22:57:10 UTC (rev 301) @@ -273,6 +273,7 @@ <Compile Include="controllers\IControllerSite.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="controllers\IModalController.cs" /> <Compile Include="controllers\land\BulldozeController.cs"> <SubType>Form</SubType> </Compile> @@ -288,9 +289,6 @@ <Compile Include="controllers\LocationStore.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="controllers\ModalController.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="controllers\PointSelectorController.cs"> <SubType>Code</SubType> </Compile> @@ -593,9 +591,7 @@ <Compile Include="views\GlobalViewOptions.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="views\MapOverlay.cs"> - <SubType>Code</SubType> - </Compile> + <Compile Include="views\IMapOverlay.cs" /> <Compile Include="views\map\HeightCutWindow.cs"> <SubType>Form</SubType> </Compile> Deleted: branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/controllers/ControllerHostForm.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,151 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using FreeTrain.Framework; -using FreeTrain.Views; -using FreeTrain.World; - -namespace FreeTrain.Controllers -{ - /// <summary> - /// Tool window that hosts <c>ModelController</c>. - /// - /// Derived class should set the currentController appropriately to - /// associate a controller to the form. The current controller can - /// be changed while the form is visible. - /// </summary> - public class ControllerHostForm : Form - { - /// <summary> - /// Currently active controller. - /// </summary> - private ModalController _currentController; - - /// <summary> - /// - /// </summary> - public readonly IControllerSite siteImpl; - /// <summary> - /// - /// </summary> - public ControllerHostForm() - { - InitializeComponent(); - //WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(updatePreview); - siteImpl = new ControllerSiteImpl(this); - } - /// <summary> - /// - /// </summary> - protected ModalController currentController - { - get - { - return _currentController; - } - set - { - if (_currentController != null) - { - // deactive the old one if it's still active - if (MainWindow.mainWindow.currentController == _currentController) - MainWindow.mainWindow.detachController(); - } - // activate the new controller - _currentController = value; - MainWindow.mainWindow.attachController(value); - } - } - /// <summary> - /// - /// </summary> - /// <param name="disposing"></param> - protected override void Dispose(bool disposing) - { - WorldDefinition.World.viewOptions.OnViewOptionChanged -= new OptionChangedHandler(updatePreview); - if (disposing && components != null) - components.Dispose(); - base.Dispose(disposing); - } - - /// <summary> - /// - /// </summary> - /// <param name="e"></param> - protected override void OnActivated(EventArgs e) - { - base.OnActivated(e); - // Attach the control when activated. - MainWindow.mainWindow.attachController(_currentController); - } - - /// <summary> - /// Derived class still needs to extend this method and maintain - /// the singleton. - /// </summary> - protected override void OnClosing(System.ComponentModel.CancelEventArgs e) - { - // Detach the controller when the form is going to be closed. - if (MainWindow.mainWindow.currentController == _currentController) - MainWindow.mainWindow.detachController(); - } - /// <summary> - /// - /// </summary> - /// <param name="e"></param> - protected override void OnLoad(System.EventArgs e) - { - // attach this window. - MainWindow.mainWindow.AddOwnedForm(this); - // move this window to the left-top position of the parent window - this.Left = MainWindow.mainWindow.Left; - this.Top = MainWindow.mainWindow.Top; - } - /// <summary> - /// - /// </summary> - public virtual void updatePreview() { } - - #region Windows Form Designer generated code - private System.ComponentModel.Container components = null; - - private void InitializeComponent() - { - this.SuspendLayout(); - // - // AbstractControllerForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(106, 112); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AbstractControllerForm"; - this.ShowInTaskbar = false; - this.ResumeLayout(false); - } - #endregion - } -} Deleted: branches/FreeTrainSDL/core/controllers/ControllerHostForm.resx =================================================================== --- branches/FreeTrainSDL/core/controllers/ControllerHostForm.resx 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/controllers/ControllerHostForm.resx 2008-03-31 22:57:10 UTC (rev 301) @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used forserialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>(Default)</value> - </data> - <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>8, 8</value> - </data> - <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>80</value> - </data> - <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.Name"> - <value>ControllerHostForm</value> - </data> - <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> -</root> \ No newline at end of file Copied: branches/FreeTrainSDL/core/controllers/IModalController.cs (from rev 300, branches/FreeTrainSDL/core/controllers/ModalController.cs) =================================================================== --- branches/FreeTrainSDL/core/controllers/IModalController.cs (rev 0) +++ branches/FreeTrainSDL/core/controllers/IModalController.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -0,0 +1,97 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Drawing; +using System.Windows.Forms; +using FreeTrain.Views; +using FreeTrain.Views.Map; +using FreeTrain.World; + +namespace FreeTrain.Controllers +{ + /// <summary> + /// User Interface by using MapViewWindow. + /// + /// When active, a ModalController can receive mouse events + /// on map windows, can modify the image of the map view, + /// and can affect how mouse clicks are interpreted. + /// </summary> + public interface IModalController + { + /// <summary> + /// + /// </summary> + /// <param name="source">sender of the event.</param> + /// <param name="loc">(X,Y,Z) location that was clicked</param> + /// <param name="ab">(A,B) location that was clicked.</param> + void OnClick(MapViewWindow source, Location loc, Point ab); + /// <summary> + /// + /// </summary> + /// <param name="source"></param> + /// <param name="loc"></param> + /// <param name="ab"></param> + void OnRightClick(MapViewWindow source, Location loc, Point ab); + /// <summary> + /// + /// </summary> + /// <param name="source"></param> + /// <param name="loc"></param> + /// <param name="ab"></param> + void OnMouseMove(MapViewWindow source, Location loc, Point ab); + + /// <summary> + /// Called when the controller gets activated. + /// </summary> + void OnAttached(); + + /// <summary> + /// Called when the controller gets deactivated. + /// </summary> + void OnDetached(); + + // /// <summary> + // /// Closes the controller. A host uses this method to close + // /// a controller. + // /// </summary> + // void close(); + + /// <summary> + /// Gets the display name of this controller. + /// </summary> + string name { get; } + + /// <summary> + /// Gets the disambiguator associated with this controller, if any. + /// </summary> + LocationDisambiguator Disambiguator { get; } + + /// <summary> + /// If this controller needs to modify the map view, return non-null value. + /// </summary> + IMapOverlay Overlay { get; } + + /// <summary> + /// + /// </summary> + void UpdatePreview(); + } +} Deleted: branches/FreeTrainSDL/core/controllers/ModalController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/ModalController.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/controllers/ModalController.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,97 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; -using System.Windows.Forms; -using FreeTrain.Views; -using FreeTrain.Views.Map; -using FreeTrain.World; - -namespace FreeTrain.Controllers -{ - /// <summary> - /// User Interface by using MapViewWindow. - /// - /// When active, a ModalController can receive mouse events - /// on map windows, can modify the image of the map view, - /// and can affect how mouse clicks are interpreted. - /// </summary> - public interface IModalController - { - /// <summary> - /// - /// </summary> - /// <param name="source">sender of the event.</param> - /// <param name="loc">(X,Y,Z) location that was clicked</param> - /// <param name="ab">(A,B) location that was clicked.</param> - void OnClick(MapViewWindow source, Location loc, Point ab); - /// <summary> - /// - /// </summary> - /// <param name="source"></param> - /// <param name="loc"></param> - /// <param name="ab"></param> - void OnRightClick(MapViewWindow source, Location loc, Point ab); - /// <summary> - /// - /// </summary> - /// <param name="source"></param> - /// <param name="loc"></param> - /// <param name="ab"></param> - void OnMouseMove(MapViewWindow source, Location loc, Point ab); - - /// <summary> - /// Called when the controller gets activated. - /// </summary> - void OnAttached(); - - /// <summary> - /// Called when the controller gets deactivated. - /// </summary> - void OnDetached(); - - // /// <summary> - // /// Closes the controller. A host uses this method to close - // /// a controller. - // /// </summary> - // void close(); - - /// <summary> - /// Gets the display name of this controller. - /// </summary> - string name { get; } - - /// <summary> - /// Gets the disambiguator associated with this controller, if any. - /// </summary> - LocationDisambiguator Disambiguator { get; } - - /// <summary> - /// If this controller needs to modify the map view, return non-null value. - /// </summary> - IMapOverlay Overlay { get; } - - /// <summary> - /// - /// </summary> - void UpdatePreview(); - } -} Deleted: branches/FreeTrainSDL/core/framework/MenuItemConstants.cs =================================================================== --- branches/FreeTrainSDL/core/framework/MenuItemConstants.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/framework/MenuItemConstants.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,118 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Diagnostics; -using System.Windows.Forms; - -namespace FreeTrain.Framework -{ - /// <summary> - /// Enumeration of the menus. - /// </summary> - public sealed class MenuItemConstants - { - /// <summary> - /// - /// </summary> - public readonly string displayName; - - private MenuItemConstants(string _displayName) - { - this.displayName = _displayName; - } - - /// <summary> - /// Obtain a menu item constants from its display name. - /// Throws an exception if it fails to parse. - /// </summary> - public static MenuItemConstants parse(string name) - { - foreach (MenuItemConstants c in - new MenuItemConstants[] { FILE, VIEW, RAIL, ROAD, CONSTRUCTION, CONFIG, HELP }) - { - - if (c.displayName.Equals(name)) - return c; - } - - throw new Exception("undefined menu item:" + name); - } - - /// <summary> - /// Associated menu item. - /// </summary> - public MenuItem menuItem - { - get - { - MainWindow mw = MainWindow.mainWindow; - // TODO: is there any better way to implement this? - if (this == FILE) return mw.menuItem_file; - if (this == VIEW) return mw.menuItem_view; - if (this == RAIL) return mw.menuItem_rail; - if (this == ROAD) return mw.menuItem_road; - if (this == CONSTRUCTION) return mw.menuItem_construction; - if (this == CONFIG) return mw.menuItem_config; - if (this == HELP) return mw.menuItem_help; - - Debug.Fail("undefined menu item constant"); - return null; - } - } - - // - // constants - // - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants FILE = new MenuItemConstants("file"); - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants VIEW = new MenuItemConstants("view"); - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants RAIL = new MenuItemConstants("rail"); - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants ROAD = new MenuItemConstants("road"); - /// <summary> - /// - /// - /// </summary> - public static readonly MenuItemConstants CONSTRUCTION = new MenuItemConstants("construction"); - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants CONFIG = new MenuItemConstants("config"); - /// <summary> - /// - /// </summary> - public static readonly MenuItemConstants HELP = new MenuItemConstants("help"); - - private static readonly MenuItemConstants[] all = { - FILE, VIEW, RAIL, ROAD, CONSTRUCTION, CONFIG, HELP - }; - } -} Deleted: branches/FreeTrainSDL/core/framework/MruHelper.cs =================================================================== --- branches/FreeTrainSDL/core/framework/MruHelper.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/framework/MruHelper.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,47 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using System.Windows.Forms; -using freetrain.controls; - -namespace freetrain.framework -{ - /// <summary> - /// Wraps MruMenuInline for this project. - /// </summary> - internal sealed class MruHelper - { - private MruMenuInline mruMenu; - - /// <summary> - /// File path to save the MRU data. - /// </summary> - private readonly FileInfo mruDataFile = new FileInfo(Application.ExecutablePath+".mru.dat"); - - private readonly MainWindow parent; - - internal MruHelper( MainWindow _parent, MenuItem placeHolder ) - { - this.parent = _parent; - - // load the menu - mruMenu = new MruMenuInline( placeHolder, new MruMenu.ClickHandler(onMruClicked) ); - mruMenu.LoadFromFile(mruDataFile); - - parent.Closed += new EventHandler(onClosed); - } - - internal void addFile( FileInfo file ) { - mruMenu.AddFile(file); - } - - private void onMruClicked( int index, String fileName ) { - parent.loadGame(new FileInfo(fileName)); - } - - private void onClosed( object sender, EventArgs e ) { - // save the setting at the exit of the app. - mruMenu.SaveToFile(mruDataFile); - } - } -} Copied: branches/FreeTrainSDL/core/views/IMapOverlay.cs (from rev 300, branches/FreeTrainSDL/core/views/MapOverlay.cs) =================================================================== --- branches/FreeTrainSDL/core/views/IMapOverlay.cs (rev 0) +++ branches/FreeTrainSDL/core/views/IMapOverlay.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -0,0 +1,52 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Drawing; +using FreeTrain.Views; +using FreeTrain.World; +using FreeTrain.Framework.Graphics; + +namespace FreeTrain.Views +{ + /// <summary> + /// Modifies the image of map view window + /// by overlaying additional data to it. + /// </summary> + public interface IMapOverlay + { + /// <summary> + /// Called before any voxel is drawn. + /// </summary> + void DrawBefore(QuarterViewDrawer view, DrawContext canvas); + + /// <summary> + /// Called for each voxel that the view is trying to draw. + /// </summary> + void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location location, Point point); + + /// <summary> + /// Called after all the images are drawn by MapView. + /// This can be used to draw things that will never be + /// hidden by any objects in the World. + /// </summary> + void DrawAfter(QuarterViewDrawer view, DrawContext canvas); + } +} Deleted: branches/FreeTrainSDL/core/views/MapOverlay.cs =================================================================== --- branches/FreeTrainSDL/core/views/MapOverlay.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/views/MapOverlay.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,52 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; -using FreeTrain.Views; -using FreeTrain.World; -using FreeTrain.Framework.Graphics; - -namespace FreeTrain.Views -{ - /// <summary> - /// Modifies the image of map view window - /// by overlaying additional data to it. - /// </summary> - public interface IMapOverlay - { - /// <summary> - /// Called before any voxel is drawn. - /// </summary> - void DrawBefore(QuarterViewDrawer view, DrawContext canvas); - - /// <summary> - /// Called for each voxel that the view is trying to draw. - /// </summary> - void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location location, Point point); - - /// <summary> - /// Called after all the images are drawn by MapView. - /// This can be used to draw things that will never be - /// hidden by any objects in the World. - /// </summary> - void DrawAfter(QuarterViewDrawer view, DrawContext canvas); - } -} Deleted: branches/FreeTrainSDL/core/views/map/PreviewMapWindow.cs =================================================================== --- branches/FreeTrainSDL/core/views/map/PreviewMapWindow.cs 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/views/map/PreviewMapWindow.cs 2008-03-31 22:57:10 UTC (rev 301) @@ -1,156 +0,0 @@ -using System; -using System.Diagnostics; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using freetrain.util; -using freetrain.world; -using freetrain.controllers; -using freetrain.framework; -using freetrain.framework.graphics; -using org.kohsuke.directdraw; - -namespace freetrain.views.map -{ - /// <summary> - /// Form implementation of the map view. - /// </summary> - public class PreviewMapWindow : UserControl { - //private WindowedDirectDraw ddraw; - private QuarterViewDrawer drawer; - private WeatherOverlay weatherOverlay; - private World world; - - public PreviewMapWindow(World w) { - world = w; - InitializeComponent(); - - AutoScroll = true; - // ( (X*32+16) -16 -16, Y*8 -8 -(8+16*Z) ) - // the left edge of the world is shaggy, so we need to cut the left-most 16 pixels. - // similarly we cut the right-most 16 pixels. - // - // for the same reason, cut the top-most 8 pixels. bottom 8 pixels. - // 16*Z is further cut so that the user won't see the edge of the world - // even if the bottom edge of the world is fully raised. - Size sz = new Size( w.size.x *32 -16, w.size.y *8 - 16); - - AutoScrollMinSize = sz; - ClientSize = sz; - - PictureManager.onSurfaceLost += new EventHandler(onSurfaceLost); - } - - private Point scrollPos { - get { - Point pt = AutoScrollPosition; - return new Point(-pt.X+16,-pt.Y+8); - } - set { - AutoScrollPosition = new Point( - Math.Max(value.X-16,0), - Math.Max(value.Y- 8,0) ); - } - } - - - protected override void OnLoad(EventArgs e) { - base.OnLoad(e); - ddraw = new WindowedDirectDraw(this); - drawer = new QuarterViewDrawer( world, ddraw, - new Rectangle( this.scrollPos, ClientSize ) ); - drawer.OnUpdated += new EventHandler(onDrawerUpdated); - - weatherOverlay = NullWeatherOverlay.theInstance; - } - - protected override void Dispose( bool disposing ) { - if( disposing && components != null) - components.Dispose(); - if(ddraw!=null){ - weatherOverlay.Dispose(); - drawer.Dispose(); - ddraw.Dispose(); - } - PictureManager.onSurfaceLost -= new EventHandler(onSurfaceLost); - world = null; - base.Dispose( disposing ); - } - - - - #region Windows Form Designer generated code - private System.ComponentModel.IContainer components; - - /// <summary> - /// デザイナ サポートに必要なメソッドです。このメソッドの内容を - /// コード エディタで変更しないでください。 - /// </summary> - private void InitializeComponent() { - // - // PreviewMapWindow - // - this.AutoScroll = true; - this.Name = "PreviewMapWindow"; - this.Size = new System.Drawing.Size(432, 427); - - } - #endregion - - - protected override void OnPaint(PaintEventArgs pe) { - drawer.size = this.ClientSize; - drawer.origin = this.scrollPos; - - weatherOverlay.setSize(this.ClientSize); - - //if( ddraw.primarySurface.handle.isLost()!=0 ) // surface is lost - // PictureManager.onSurfaceLost(this,null); - - // drawer.draw( ddraw.primarySurface, PointToScreen(new Point(0,0)) ); - weatherOverlay.draw( drawer, ddraw.primarySurface, PointToScreen(new Point(0,0)) ); - - base.OnPaint(pe); - } - - protected void onDrawerUpdated( object sender, EventArgs e ) { - Invalidate(); - } - - protected void onSurfaceLost( object sender, EventArgs e ) { - ddraw.primarySurface.restore(); - Invalidate(); - } - - protected override void OnPaintBackground( PaintEventArgs pevent ) { - // don't paint the background to avoid flicker - } - - // - - /// <summary> - /// Moves the map window to display the specified location - /// </summary> - public void moveTo( Location loc ) { - // compute the new origin - Point pt = World.world.fromXYZToAB(loc); - Size sz = drawer.size; - sz.Width /= 2; - sz.Height /= 2; - pt -= sz; - - this.scrollPos = pt; - } - - /// <summary> - /// Determine if the specified location is visible by this view. - /// </summary> - public bool isVisible( Location loc ) { - return drawer.isVisible(loc); - } - - - } - -} Deleted: branches/FreeTrainSDL/core/views/map/PreviewMapWindow.resx =================================================================== --- branches/FreeTrainSDL/core/views/map/PreviewMapWindow.resx 2008-03-31 22:48:37 UTC (rev 300) +++ branches/FreeTrainSDL/core/views/map/PreviewMapWindow.resx 2008-03-31 22:57:10 UTC (rev 301) @@ -1,130 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used forserialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>80</value> - </data> - <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>(Default)</value> - </data> - <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="$this.Name"> - <value>PreviewMapWindow</value> - </data> - <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>8, 8</value> - </data> -</root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-03-31 23:10:10
|
Revision: 302 http://freetrain.svn.sourceforge.net/freetrain/?rev=302&view=rev Author: jendave Date: 2008-03-31 16:10:09 -0700 (Mon, 31 Mar 2008) Log Message: ----------- Rename interfaces (not done yet) Modified Paths: -------------- branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs branches/FreeTrainSDL/core/contributions/road/A3RoadContribution.cs branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/contributions/road/StandardRoadContribution.cs branches/FreeTrainSDL/core/contributions/structs/CommercialStructureContribution.cs branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/contributions/train/AsymTrainCarImpl.cs branches/FreeTrainSDL/core/contributions/train/ColoredTrainCarImpl.cs branches/FreeTrainSDL/core/contributions/train/SymTrainCarImpl.cs branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/controllers/AbstractLineController.cs branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/controllers/Disambiguators.cs branches/FreeTrainSDL/core/controllers/IControllerSite.cs branches/FreeTrainSDL/core/controllers/IModalController.cs branches/FreeTrainSDL/core/controllers/PointSelectorController.cs branches/FreeTrainSDL/core/controllers/RectSelectorController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs branches/FreeTrainSDL/core/framework/ResourceUtil.cs branches/FreeTrainSDL/core/framework/graphics/AlphaBlendSpriteSet.cs branches/FreeTrainSDL/core/framework/graphics/ColorMappedSprite.cs branches/FreeTrainSDL/core/framework/graphics/DefaultSpriteLoaderContributionImpl.cs branches/FreeTrainSDL/core/framework/graphics/DirectSprite.cs branches/FreeTrainSDL/core/framework/graphics/HueTransformSprite.cs branches/FreeTrainSDL/core/framework/graphics/NullSprite.cs branches/FreeTrainSDL/core/framework/graphics/PreviewDrawer.cs branches/FreeTrainSDL/core/framework/graphics/SimpleSprite.cs branches/FreeTrainSDL/core/framework/graphics/SpriteFactory.cs branches/FreeTrainSDL/core/framework/graphics/SpriteLoaderContribution.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/WeatherOverlaySpriteSet.cs branches/FreeTrainSDL/core/world/RRCrossing.cs branches/FreeTrainSDL/core/world/development/LandValueInspector.cs branches/FreeTrainSDL/core/world/land/LandPropertyVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgeRail.cs branches/FreeTrainSDL/core/world/rail/FatPlatform.cs branches/FreeTrainSDL/core/world/rail/PassagewayRail.cs branches/FreeTrainSDL/core/world/rail/RailPattern.cs branches/FreeTrainSDL/core/world/rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/world/rail/StealSupportedRailContributionImpl.cs branches/FreeTrainSDL/core/world/rail/ThinPlatform.cs branches/FreeTrainSDL/core/world/rail/TunnelRail.cs branches/FreeTrainSDL/core/world/structs/ConstructionSite.cs branches/FreeTrainSDL/core/world/structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/world/structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/world/terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSprite.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs Added Paths: ----------- branches/FreeTrainSDL/core/contributions/common/IAbstractStructure.cs branches/FreeTrainSDL/core/controllers/ILocationDisambiguator.cs branches/FreeTrainSDL/core/framework/graphics/ISprite.cs branches/FreeTrainSDL/core/world/IVoxelOutlookListener.cs Removed Paths: ------------- branches/FreeTrainSDL/core/controllers/LocationDisambiguator.cs branches/FreeTrainSDL/core/framework/graphics/Sprite.cs branches/FreeTrainSDL/core/world/VoxelOutlookListener.cs Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 23:10:09 UTC (rev 302) @@ -101,6 +101,7 @@ <Compile Include="contributions\common\FixedSizeStructureController.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="contributions\common\IAbstractStructure.cs" /> <Compile Include="contributions\common\IEntityBuilder.cs"> <SubType>Code</SubType> </Compile> @@ -273,6 +274,7 @@ <Compile Include="controllers\IControllerSite.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="controllers\ILocationDisambiguator.cs" /> <Compile Include="controllers\IModalController.cs" /> <Compile Include="controllers\land\BulldozeController.cs"> <SubType>Form</SubType> @@ -283,9 +285,6 @@ <Compile Include="controllers\land\LandPropertyController.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="controllers\LocationDisambiguator.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="controllers\LocationStore.cs"> <SubType>Code</SubType> </Compile> @@ -392,6 +391,7 @@ <DependentUpon>AboutDialog.cs</DependentUpon> <SubType>Form</SubType> </Compile> + <Compile Include="framework\graphics\ISprite.cs" /> <Compile Include="framework\Splash.Designer.cs"> <DependentUpon>Splash.cs</DependentUpon> <SubType>Form</SubType> @@ -450,9 +450,6 @@ <Compile Include="framework\graphics\SimpleSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="framework\graphics\Sprite.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="framework\graphics\SpriteFactory.cs"> <SubType>Code</SubType> </Compile> @@ -697,6 +694,7 @@ <Compile Include="world\Entity.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="world\IVoxelOutlookListener.cs" /> <Compile Include="world\land\LandPropertyVoxel.cs"> <SubType>Code</SubType> </Compile> @@ -865,9 +863,6 @@ <Compile Include="world\Voxel.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="world\VoxelOutlookListener.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="world\WorldDefinition.cs" /> <Content Include="..\plugins\system\plugin.xml"> <Link>plugin.xml</Link> Modified: branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -62,7 +62,7 @@ /// <param name="pic"></param> /// <param name="main"></param> /// <param name="opposite"></param> - public FixedSizeStructureContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite) + public FixedSizeStructureContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main) { _price = master.unitPrice; @@ -97,7 +97,7 @@ /// Sprite set to draw this structure. Indexed as [x,y,z] /// and may contain null if there's no need to draw that voxel. /// </summary> - public readonly Sprite[, ,] sprites; + public readonly ISprite[, ,] sprites; /// <summary> Size of this structure in voxel by voxel. </summary> public readonly Distance size; @@ -143,7 +143,7 @@ /// </summary> /// <param name="d"></param> /// <returns></returns> - public Sprite getSprite(Distance d) + public ISprite getSprite(Distance d) { return sprites[d.x, d.y, d.z]; } Added: branches/FreeTrainSDL/core/contributions/common/IAbstractStructure.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/IAbstractStructure.cs (rev 0) +++ branches/FreeTrainSDL/core/contributions/common/IAbstractStructure.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -0,0 +1,57 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Drawing; +using System.Runtime.Serialization; +using System.Xml; +using FreeTrain.Util; +using FreeTrain.Contributions.Population; +using FreeTrain.Controllers; +using FreeTrain.Framework.Plugin; +using FreeTrain.Framework.Graphics; +using FreeTrain.World; +using FreeTrain.World.Structs; + +namespace FreeTrain.Contributions.Common +{ + /// <summary> + /// + /// </summary> + public interface IAbstractStructure + { + /// <summary> + /// + /// </summary> + int unitPrice { get; } + /// <summary> + /// + /// </summary> + SIZE size { get; } + /// <summary> + /// + /// </summary> + int minHeight { get; } + /// <summary> + /// + /// </summary> + int maxHeight { get; } + } +} Property changes on: branches/FreeTrainSDL/core/contributions/common/IAbstractStructure.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Modified: branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/common/StructureContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -33,29 +33,6 @@ namespace FreeTrain.Contributions.Common { /// <summary> - /// - /// </summary> - public interface AbstractExStructure - { - /// <summary> - /// - /// </summary> - int unitPrice { get; } - /// <summary> - /// - /// </summary> - SIZE size { get; } - /// <summary> - /// - /// </summary> - int minHeight { get; } - /// <summary> - /// - /// </summary> - int maxHeight { get; } - } - - /// <summary> /// Generic structure contribution. /// /// Structure is an object that occupies a cubic area in the World, Modified: branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/land/DefaultControllerImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -38,7 +38,7 @@ /// /// </summary> /// <returns></returns> - public delegate Sprite SpriteBuilder(); + public delegate ISprite SpriteBuilder(); private readonly LandBuilderContribution contrib; private readonly SpriteBuilder spriteBuilder; Modified: branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/land/LandBuilderContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -147,7 +147,7 @@ new DefaultControllerImpl.SpriteBuilder(getSprite)); } - private static Sprite getSprite() + private static ISprite getSprite() { return ResourceUtil.removerChip; //return ResourceUtil.emptyChip; Modified: branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/land/RandomLandBuilder.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -112,7 +112,7 @@ return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getLandSprite)); } - private Sprite getLandSprite() + private ISprite getLandSprite() { return getLand().sprite; } Modified: branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/land/StaticLandBuilder.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -51,7 +51,7 @@ } /// <summary> Sprite of this land contribution. </summary> - public readonly Sprite sprite; + public readonly ISprite sprite; /// <summary> @@ -95,7 +95,7 @@ return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); } - private Sprite getSprite() + private ISprite getSprite() { return sprite; } Modified: branches/FreeTrainSDL/core/contributions/road/A3RoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/road/A3RoadContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/road/A3RoadContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -43,7 +43,7 @@ // load resource, but don't dispose it as sprites will still refer to this surface. Picture picture = getPicture(e); - sprites = new Sprite[3]; + sprites = new ISprite[3]; for (int i = 0; i < 3; i++) sprites[i] = new SimpleSprite(picture, new Point(0, 16), new Point(i * 32, 0), new Size(32, 32)); } @@ -51,13 +51,13 @@ /// <summary> /// three sprites (0:E-W, 1:N-S, 2:cross) /// </summary> - private readonly Sprite[] sprites; + private readonly ISprite[] sprites; /// <summary> /// /// </summary> /// <param name="idx"></param> /// <returns></returns> - protected internal override Sprite getSprite(byte idx) + protected internal override ISprite getSprite(byte idx) { switch (idx) { Modified: branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/road/AbstractRoadContributionImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -55,7 +55,7 @@ /// </summary> /// <param name="dirs"></param> /// <returns></returns> - protected internal abstract Sprite getSprite(byte dirs); + protected internal abstract ISprite getSprite(byte dirs); /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/contributions/road/StandardRoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/road/StandardRoadContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/road/StandardRoadContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -50,7 +50,7 @@ Size sz = XmlUtil.parseSize(picture.Attributes["size"].Value); int offsetY = int.Parse(picture.Attributes["offset"].Value); - flatSprites = new Sprite[16]; + flatSprites = new ISprite[16]; for (int i = 0; i < 15; i++) { flatSprites[i + 1] = new SimpleSprite( @@ -62,7 +62,7 @@ /// <summary> /// sprites by index /// </summary> - private readonly Sprite[] flatSprites; + private readonly ISprite[] flatSprites; private static readonly int[] locations = new int[] { 2,4, 1,4, 1,1, 1,3, 0,1, 2,0, 0,2, 2,3, @@ -73,7 +73,7 @@ /// </summary> /// <param name="idx"></param> /// <returns></returns> - protected internal override Sprite getSprite(byte idx) + protected internal override ISprite getSprite(byte idx) { return flatSprites[idx]; } Modified: branches/FreeTrainSDL/core/contributions/structs/CommercialStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/structs/CommercialStructureContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/structs/CommercialStructureContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -48,7 +48,7 @@ /// <param name="pic"></param> /// <param name="main"></param> /// <param name="opposite"></param> - public CommercialStructureContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite) + public CommercialStructureContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(master, pic, main, opposite) { } /// <summary> /// Modified: branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/structs/VarHeightBuildingContribution.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -68,7 +68,7 @@ /// <param name="pic"></param> /// <param name="main"></param> /// <param name="opposite"></param> - public VarHeightBuildingContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite) + public VarHeightBuildingContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main) { _price = master.unitPrice; @@ -100,9 +100,9 @@ return PluginManager.theInstance.varHeightBuildingsGroup[name]; } - private Sprite[][,] loadSpriteSets(XmlNodeList list) + private ISprite[][,] loadSpriteSets(XmlNodeList list) { - Sprite[][,] sprites = new Sprite[list.Count][,]; + ISprite[][,] sprites = new ISprite[list.Count][,]; int idx = 0; foreach (XmlElement e in list) @@ -130,28 +130,28 @@ public override double pricePerArea { get { return _price; } } /// <summary>Sprite sets.</summary> - private readonly Sprite[][,] tops, bottoms; - private readonly Sprite[,] middle; + private readonly ISprite[][,] tops, bottoms; + private readonly ISprite[,] middle; private bool overlay = false; /// <summary> Sprite to draw the structure </summary> - public Sprite[] getSprites(int x, int y, int z, int height) + public ISprite[] getSprites(int x, int y, int z, int height) { if (z >= height - tops.Length) { if (overlay && z == bottoms.Length - 1) - return new Sprite[] { bottoms[z][x, y], tops[height - z - 1][x, y] }; + return new ISprite[] { bottoms[z][x, y], tops[height - z - 1][x, y] }; else - return new Sprite[] { tops[height - z - 1][x, y] }; + return new ISprite[] { tops[height - z - 1][x, y] }; } if (z < bottoms.Length) { if (overlay && z == bottoms.Length - 1) - return new Sprite[] { bottoms[z][x, y], middle[x, y] }; + return new ISprite[] { bottoms[z][x, y], middle[x, y] }; else - return new Sprite[] { bottoms[z][x, y] }; + return new ISprite[] { bottoms[z][x, y] }; } - return new Sprite[] { middle[x, y] }; + return new ISprite[] { middle[x, y] }; } /// <summary> Size of the basement of this structure in voxel by voxel. </summary> Modified: branches/FreeTrainSDL/core/contributions/train/AsymTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/AsymTrainCarImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/train/AsymTrainCarImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -47,8 +47,8 @@ : base(e) { - levelSprites = new Sprite[16]; - slopeSprites = new Sprite[8]; + levelSprites = new ISprite[16]; + slopeSprites = new ISprite[8]; XmlElement sprite = (XmlElement)XmlUtil.selectSingleNode(e, "sprite"); Picture picture = getPicture(sprite); @@ -69,10 +69,10 @@ } /// <summary> Sprites used to draw a car on a level ground. 8-way from dir=0 to 7 </summary> - private readonly Sprite[] levelSprites; + private readonly ISprite[] levelSprites; /// <summary> Sprites used to draw a car on a slope. 4 way from dir=0,2,4, and 6 </summary> - private readonly Sprite[] slopeSprites; + private readonly ISprite[] slopeSprites; /// <summary> /// Modified: branches/FreeTrainSDL/core/contributions/train/ColoredTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/ColoredTrainCarImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/train/ColoredTrainCarImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -47,10 +47,10 @@ private Color[] _colors; /// <summary> Sprites used to draw a car on a level ground. 8-way from dir=0 to 7 </summary> - private Sprite[] levelSprites; + private ISprite[] levelSprites; /// <summary> Sprites used to draw a car on a slope. 4 way from dir=0,2,4, and 6 </summary> - private Sprite[] slopeSprites; + private ISprite[] slopeSprites; /// <summary> @@ -187,8 +187,8 @@ /// </summary> private void createSprites() { - levelSprites = new Sprite[8]; - slopeSprites = new Sprite[4]; + levelSprites = new ISprite[8]; + slopeSprites = new ISprite[4]; SpriteFactory factory = new ColorMappedSpriteFactory(dayColorPallete, _colors); for (int i = 0; i < 8; i++) Modified: branches/FreeTrainSDL/core/contributions/train/SymTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/SymTrainCarImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/contributions/train/SymTrainCarImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -44,8 +44,8 @@ /// <param name="e"></param> public SymTrainCarImpl( XmlElement e ) : base(e) { - levelSprites = new Sprite[8]; - slopeSprites = new Sprite[4]; + levelSprites = new ISprite[8]; + slopeSprites = new ISprite[4]; XmlElement sprite = (XmlElement)XmlUtil.selectSingleNode(e,"sprite"); Picture picture = getPicture(sprite); @@ -64,10 +64,10 @@ } /// <summary> Sprites used to draw a car on a level ground. 8-way from dir=0 to 7 </summary> - private readonly Sprite[] levelSprites; + private readonly ISprite[] levelSprites; /// <summary> Sprites used to draw a car on a slope. 4 way from dir=0,2,4, and 6 </summary> - private readonly Sprite[] slopeSprites; + private readonly ISprite[] slopeSprites; /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -92,7 +92,7 @@ /// <summary> /// /// </summary> - public virtual LocationDisambiguator Disambiguator { get { return null; } } + public virtual ILocationDisambiguator Disambiguator { get { return null; } } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/AbstractLineController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -286,7 +286,7 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator + public override ILocationDisambiguator Disambiguator { get { @@ -295,7 +295,7 @@ else return sameLevelDisambiguator; } } - private LocationDisambiguator sameLevelDisambiguator; + private ILocationDisambiguator sameLevelDisambiguator; private void modeChanged(object sender, EventArgs e) Modified: branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -115,7 +115,7 @@ /// <summary> /// /// </summary> - public virtual LocationDisambiguator Disambiguator { get { return GroundDisambiguator.theInstance; } } + public virtual ILocationDisambiguator Disambiguator { get { return GroundDisambiguator.theInstance; } } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/Disambiguators.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/Disambiguators.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/Disambiguators.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -28,20 +28,20 @@ /// LocationDisambiguator implementation that prefers /// a location with a railroad. /// </summary> - public class RailRoadDisambiguator : LocationDisambiguator + public class RailRoadDisambiguator : ILocationDisambiguator { // the singleton instance /// <summary> /// /// </summary> - public static LocationDisambiguator theInstance = new RailRoadDisambiguator(); + public static ILocationDisambiguator theInstance = new RailRoadDisambiguator(); private RailRoadDisambiguator() { } /// <summary> /// /// </summary> /// <param name="loc"></param> /// <returns></returns> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { // if there's any rail roads, fine if (RailRoad.get(loc) != null) return true; @@ -56,20 +56,20 @@ /// <summary> /// LocationDisambiguator that prefers the surface level. /// </summary> - public class GroundDisambiguator : LocationDisambiguator + public class GroundDisambiguator : ILocationDisambiguator { // the singleton instance /// <summary> /// /// </summary> - public static LocationDisambiguator theInstance = new GroundDisambiguator(); + public static ILocationDisambiguator theInstance = new GroundDisambiguator(); private GroundDisambiguator() { } /// <summary> /// /// </summary> /// <param name="loc"></param> /// <returns></returns> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { return loc.z == WorldDefinition.World.getGroundLevel(loc); } @@ -78,7 +78,7 @@ /// <summary> /// LocationDisambiguator that only allows locations in the same level /// </summary> - public class SameLevelDisambiguator : LocationDisambiguator + public class SameLevelDisambiguator : ILocationDisambiguator { /// <summary> /// @@ -91,7 +91,7 @@ /// </summary> /// <param name="loc"></param> /// <returns></returns> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { return loc.z == height; } Modified: branches/FreeTrainSDL/core/controllers/IControllerSite.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/IControllerSite.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/IControllerSite.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -31,39 +31,10 @@ /// <summary> /// Close the host. /// </summary> - void close(); + void Close(); /// <summary> /// /// </summary> string name { get; } // TODO: fix } - /// <summary> - /// - /// </summary> - public class ControllerSiteImpl : IControllerSite - { - private readonly Form owner; - /// <summary> - /// - /// </summary> - /// <param name="_owner"></param> - public ControllerSiteImpl(Form _owner) { this.owner = _owner; } - /// <summary> - /// - /// </summary> - public void close() - { - owner.Close(); - } - /// <summary> - /// - /// </summary> - public string name - { - get - { - return owner.Text; - } - } - } } Copied: branches/FreeTrainSDL/core/controllers/ILocationDisambiguator.cs (from rev 299, branches/FreeTrainSDL/core/controllers/LocationDisambiguator.cs) =================================================================== --- branches/FreeTrainSDL/core/controllers/ILocationDisambiguator.cs (rev 0) +++ branches/FreeTrainSDL/core/controllers/ILocationDisambiguator.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -0,0 +1,45 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using FreeTrain.World; + +namespace FreeTrain.Controllers +{ + /// <summary> + /// Used by the MapViewController to disambiguate + /// stacked voxels. + /// + /// When an user clicks a screen, there are many locations + /// that can match. Depending on the context, the program needs + /// to select one of them. For example, when an user is placing + /// a train, we'd like to select a voxel with a railroad. + /// + /// This interface does this. + /// </summary> + public interface ILocationDisambiguator + { + /// <summary> + /// Returns true if the callee prefers this location + /// to be selected. + /// </summary> + bool IsSelectable(Location loc); + } +} Modified: branches/FreeTrainSDL/core/controllers/IModalController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/IModalController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/IModalController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -82,7 +82,7 @@ /// <summary> /// Gets the disambiguator associated with this controller, if any. /// </summary> - LocationDisambiguator Disambiguator { get; } + ILocationDisambiguator Disambiguator { get; } /// <summary> /// If this controller needs to modify the map view, return non-null value. Deleted: branches/FreeTrainSDL/core/controllers/LocationDisambiguator.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/LocationDisambiguator.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/LocationDisambiguator.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -1,45 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using FreeTrain.World; - -namespace FreeTrain.Controllers -{ - /// <summary> - /// Used by the MapViewController to disambiguate - /// stacked voxels. - /// - /// When an user clicks a screen, there are many locations - /// that can match. Depending on the context, the program needs - /// to select one of them. For example, when an user is placing - /// a train, we'd like to select a voxel with a railroad. - /// - /// This interface does this. - /// </summary> - public interface LocationDisambiguator - { - /// <summary> - /// Returns true if the callee prefers this location - /// to be selected. - /// </summary> - bool isSelectable(Location loc); - } -} Modified: branches/FreeTrainSDL/core/controllers/PointSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -154,7 +154,7 @@ /// <summary> /// /// </summary> - public abstract LocationDisambiguator Disambiguator { get; } + public abstract ILocationDisambiguator Disambiguator { get; } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/controllers/RectSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -32,7 +32,7 @@ /// ModalController that selects the rectangular region /// and do something with it. /// </summary> - public abstract class RectSelectorController : IModalController, LocationDisambiguator + public abstract class RectSelectorController : IModalController, ILocationDisambiguator { /// <summary>Constant</summary> protected static readonly Location UNPLACED = World.Location.Unplaced; @@ -137,16 +137,16 @@ /// <summary> /// /// </summary> - public LocationDisambiguator Disambiguator { get { return this; } } + public ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> LocationDisambiguator implementation </summary> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { if (anchor != UNPLACED) return loc.z == anchor.z; else // lands can be placed only on the ground - return GroundDisambiguator.theInstance.isSelectable(loc); + return GroundDisambiguator.theInstance.IsSelectable(loc); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformController.Designer.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -41,7 +41,7 @@ /// <summary> /// /// </summary> - public partial class PlatformController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public partial class PlatformController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { #region Designer generated code private System.Windows.Forms.TabPage stationPage; Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -41,7 +41,7 @@ /// <summary> /// /// </summary> - public partial class PlatformController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public partial class PlatformController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { private FreeTrain.Controls.IndexSelector indexSelector; private System.Windows.Forms.ListView listView1; @@ -150,14 +150,14 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return this; } } + public override ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> LocationDisambiguator implementation </summary> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { if (currentMode == Mode.Station) { - return GroundDisambiguator.theInstance.isSelectable(loc); + return GroundDisambiguator.theInstance.IsSelectable(loc); } if (isPlacing) @@ -167,7 +167,7 @@ if (currentMode == Mode.FatPlatform) loc += direction.right90; - if (GroundDisambiguator.theInstance.isSelectable(loc)) + if (GroundDisambiguator.theInstance.IsSelectable(loc)) return true; RailRoad rr = RailRoad.get(loc); @@ -545,7 +545,7 @@ alphaSprites.Dispose(); - Sprite[, ,] alphas = null; + ISprite[, ,] alphas = null; switch (this.currentMode) { @@ -555,19 +555,19 @@ break; case Mode.ThinPlatform: - Sprite spr = ThinPlatform.getSprite(direction, false); + ISprite spr = ThinPlatform.getSprite(direction, false); // build sprite set // TODO: use the correct sprite if (direction == Direction.NORTH || direction == Direction.SOUTH) { - alphas = new Sprite[1, length, 1]; + alphas = new ISprite[1, length, 1]; for (int i = 0; i < length; i++) alphas[0, i, 0] = spr; } else { - alphas = new Sprite[length, 1, 1]; + alphas = new ISprite[length, 1, 1]; for (int i = 0; i < length; i++) alphas[i, 0, 0] = spr; } @@ -582,7 +582,7 @@ // build sprite set if (direction == Direction.NORTH || direction == Direction.SOUTH) { - alphas = new Sprite[2, length, 1]; + alphas = new ISprite[2, length, 1]; int j = direction == Direction.SOUTH ? 1 : 0; for (int i = 0; i < length; i++) { @@ -592,7 +592,7 @@ } else { - alphas = new Sprite[length, 2, 1]; + alphas = new ISprite[length, 2, 1]; int j = direction == Direction.WEST ? 1 : 0; for (int i = 0; i < length; i++) { Modified: branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -170,7 +170,7 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator + public override ILocationDisambiguator Disambiguator { get { @@ -180,7 +180,7 @@ } } - private LocationDisambiguator sameLevelDisambiguator; + private ILocationDisambiguator sameLevelDisambiguator; // "place" or "remove" button was clicked. reset the anchor private void modeChanged(object sender, EventArgs e) Modified: branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -36,7 +36,7 @@ /// <summary> /// Controller to place/remove slope RRs. /// </summary> - public class SlopeRailRoadController : AbstractControllerImpl, LocationDisambiguator, IMapOverlay + public class SlopeRailRoadController : AbstractControllerImpl, ILocationDisambiguator, IMapOverlay { private FreeTrain.Controls.CostBox costBox; @@ -334,7 +334,7 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return this; } } + public override ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> @@ -343,7 +343,7 @@ /// </summary> /// <param name="loc"></param> /// <returns></returns> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { if (!isPlacing) { Modified: branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -35,7 +35,7 @@ /// <summary> /// StationBridgeController の概要の説明です。 /// </summary> - public class StationPassagewayController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public class StationPassagewayController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { /// <summary> /// @@ -190,17 +190,17 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return this; } } + public override ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> LocationDisambiguator implementation </summary> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { // align to platforms or the ground if (anchor != UNPLACED) // must be the same height with the anchor return loc.z == anchor.z; else - return ThinPlatform.get(loc) != null || GroundDisambiguator.theInstance.isSelectable(loc); + return ThinPlatform.get(loc) != null || GroundDisambiguator.theInstance.IsSelectable(loc); } private static readonly Location UNPLACED = World.Location.Unplaced; Modified: branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -61,12 +61,12 @@ private StationaryStructPlacementController() : base(Core.plugins.railStationaryGroup) { } /// <summary> LocationDisambiguator implementation </summary> - public override bool isSelectable(Location loc) + public override bool IsSelectable(Location loc) { if (isPlacing) { // structures can be placed only on the ground - return GroundDisambiguator.theInstance.isSelectable(loc); + return GroundDisambiguator.theInstance.IsSelectable(loc); } else { Modified: branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.Designer.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -41,7 +41,7 @@ /// Controller that allows the user to /// place/remove trains. /// </summary> - public partial class TrainPlacementController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public partial class TrainPlacementController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { #region Windows Form Designer generated code private DDTreeView tree; Modified: branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -41,7 +41,7 @@ /// Controller that allows the user to /// place/remove trains. /// </summary> - public partial class TrainPlacementController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public partial class TrainPlacementController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { private System.Windows.Forms.ComboBox controllerCombo; private System.Windows.Forms.MenuItem miSell; @@ -316,14 +316,14 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return this; } } + public override ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> /// /// </summary> /// <param name="loc"></param> /// <returns></returns> - public bool isSelectable(Location loc) + public bool IsSelectable(Location loc) { RailRoad rr = RailRoad.get(loc); if (rr == null) return false; Modified: branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -60,12 +60,12 @@ private CommercialStructPlacementController() : base(Core.plugins.commercialStructureGroup) { } /// <summary> LocationDisambiguator implementation </summary> - public override bool isSelectable(Location loc) + public override bool IsSelectable(Location loc) { if (isPlacing) { // structures can be placed only on the ground - return GroundDisambiguator.theInstance.isSelectable(loc); + return GroundDisambiguator.theInstance.IsSelectable(loc); } else { Modified: branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/structs/StructPlacementController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -41,7 +41,7 @@ /// Controller that allows the user to /// place/remove structures. /// </summary> - public abstract class StructPlacementController : AbstractControllerImpl, IMapOverlay, LocationDisambiguator + public abstract class StructPlacementController : AbstractControllerImpl, IMapOverlay, ILocationDisambiguator { private System.Windows.Forms.ComboBox structType; private System.Windows.Forms.PictureBox preview; @@ -91,13 +91,13 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return this; } } + public override ILocationDisambiguator Disambiguator { get { return this; } } /// <summary> /// /// </summary> /// <param name="loc"></param> /// <returns></returns> - public abstract bool isSelectable(Location loc); + public abstract bool IsSelectable(Location loc); #region Designer generated code /// <summary> Modified: branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -94,12 +94,12 @@ } /// <summary> LocationDisambiguator implementation </summary> - public override bool isSelectable(Location loc) + public override bool IsSelectable(Location loc) { if (isPlacing) { // structures can be placed only on the ground - return GroundDisambiguator.theInstance.isSelectable(loc); + return GroundDisambiguator.theInstance.IsSelectable(loc); } else { @@ -154,7 +154,7 @@ // builds a new alpha blended preview // TODO: make a proper 3D preview. Size sz = selectedType.size; - Sprite[, ,] sprites = new Sprite[sz.Width, sz.Height, height]; + ISprite[, ,] sprites = new ISprite[sz.Width, sz.Height, height]; for (int z = 0; z < height; z++) for (int y = 0; y < sz.Height; y++) for (int x = 0; x < sz.Width; x++) Modified: branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/controllers/terrain/MountainController.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -63,7 +63,7 @@ /// <summary> /// /// </summary> - public override LocationDisambiguator Disambiguator { get { return GroundDisambiguator.theInstance; } } + public override ILocationDisambiguator Disambiguator { get { return GroundDisambiguator.theInstance; } } private bool isRaising { Modified: branches/FreeTrainSDL/core/framework/ResourceUtil.cs =================================================================== --- branches/FreeTrainSDL/core/framework/ResourceUtil.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/framework/ResourceUtil.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -168,7 +168,7 @@ /// <summary> /// /// </summary> - public static Sprite emptyChip + public static ISprite emptyChip { get { @@ -180,7 +180,7 @@ /// </summary> /// <param name="w"></param> /// <returns></returns> - public static Sprite getGroundChip(WorldDefinition w) + public static ISprite getGroundChip(WorldDefinition w) { if (w.clock.season != Season.Winter) return groundChips[0]; @@ -188,24 +188,24 @@ return groundChips[1]; } - private static Sprite[] groundChips = new Sprite[]{ + private static ISprite[] groundChips = new ISprite[]{ new SimpleSprite(emptyChips,new Point(0,0),new Point( 0,0),new Size(32,16)), new SimpleSprite(emptyChips,new Point(0,0),new Point(32,0),new Size(32,16)) }; /// <summary> /// /// </summary> - public static Sprite removerChip = + public static ISprite removerChip = new SimpleSprite(cursorChips, new Point(0, 0), new Point(0, 0), new Size(32, 16)); /// <summary> /// /// </summary> - public static Sprite underWaterChip = + public static ISprite underWaterChip = new SimpleSprite(emptyChips, new Point(0, 0), new Point(64, 0), new Size(32, 16)); /// <summary> /// /// </summary> - public static Sprite underGroundChip = + public static ISprite underGroundChip = new SimpleSprite(emptyChips, new Point(0, 0), new Point(96, 0), new Size(32, 16)); } } Modified: branches/FreeTrainSDL/core/framework/graphics/AlphaBlendSpriteSet.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/AlphaBlendSpriteSet.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/framework/graphics/AlphaBlendSpriteSet.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -45,7 +45,7 @@ /// <summary> /// Sprites built for alpha-blending. /// </summary> - public readonly Sprite[, ,] sprites; + public readonly ISprite[, ,] sprites; /// <summary> /// /// </summary> @@ -54,13 +54,13 @@ /// /// </summary> /// <param name="src"></param> - public AlphaBlendSpriteSet(Sprite[, ,] src) + public AlphaBlendSpriteSet(ISprite[, ,] src) { int X = src.GetLength(0); int Y = src.GetLength(1); int Z = src.GetLength(2); surfaces = new Surface[X, Y, Z]; - sprites = new Sprite[X, Y, Z]; + sprites = new ISprite[X, Y, Z]; size = new Distance(X, Y, Z); for (int z = 0; z < Z; z++) @@ -122,7 +122,7 @@ /// </summary> /// <param name="d"></param> /// <returns></returns> - public Sprite getSprite(Distance d) + public ISprite getSprite(Distance d) { return sprites[d.x, d.y, d.z]; } Modified: branches/FreeTrainSDL/core/framework/graphics/ColorMappedSprite.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/ColorMappedSprite.cs 2008-03-31 22:57:10 UTC (rev 301) +++ branches/FreeTrainSDL/core/framework/graphics/ColorMappedSprite.cs 2008-03-31 23:10:09 UTC (rev 302) @@ -148,7 +148,7 @@ /// <param name="origin"></param> /// <param name="size"></param> /// <returns></returns> - public override Sprite c... [truncated message content] |
From: <je...@us...> - 2008-04-01 08:34:59
|
Revision: 303 http://freetrain.svn.sourceforge.net/freetrain/?rev=303&view=rev Author: jendave Date: 2008-04-01 01:35:00 -0700 (Tue, 01 Apr 2008) Log Message: ----------- rename interfaces to follow MS naming standard Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/contributions/rail/DepartureBellContribution.cs branches/FreeTrainSDL/core/contributions/sound/BGMFactoryContribution.cs branches/FreeTrainSDL/core/contributions/train/TrainContributionFactory.cs branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/controllers/PointSelectorController.cs branches/FreeTrainSDL/core/controllers/RectSelectorController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs branches/FreeTrainSDL/core/framework/Core.cs branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs branches/FreeTrainSDL/core/framework/graphics/Picture.cs branches/FreeTrainSDL/core/framework/plugin/DynamicContributionFactory.cs branches/FreeTrainSDL/core/framework/plugin/FixedClassContributionFactory.cs branches/FreeTrainSDL/core/framework/plugin/PluginDefinition.cs branches/FreeTrainSDL/core/framework/plugin/PluginManager.cs branches/FreeTrainSDL/core/framework/sound/RepeatableSoundEffectImpl.cs branches/FreeTrainSDL/core/framework/sound/SoundEffect.cs branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/WeatherOverlay.cs branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs branches/FreeTrainSDL/core/views/map/MapView.cs branches/FreeTrainSDL/core/world/CarState.cs branches/FreeTrainSDL/core/world/Cube.cs branches/FreeTrainSDL/core/world/EmptyVoxel.cs branches/FreeTrainSDL/core/world/Entity.cs branches/FreeTrainSDL/core/world/SparseVoxelArray.cs branches/FreeTrainSDL/core/world/Traffic.cs branches/FreeTrainSDL/core/world/Voxel.cs branches/FreeTrainSDL/core/world/WorldDefinition.cs branches/FreeTrainSDL/core/world/development/CommercialStructurePlan.cs branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/world/development/LandPlan.cs branches/FreeTrainSDL/core/world/development/ULV.cs branches/FreeTrainSDL/core/world/development/ULVFactory.cs branches/FreeTrainSDL/core/world/development/VarHeightBuildingPlan.cs branches/FreeTrainSDL/core/world/land/LandPropertyVoxel.cs branches/FreeTrainSDL/core/world/land/LandVoxel.cs branches/FreeTrainSDL/core/world/land/StaticLandVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/world/rail/BridgeRail.cs branches/FreeTrainSDL/core/world/rail/DelegationTrainControllerImpl.cs branches/FreeTrainSDL/core/world/rail/FatPlatform.cs branches/FreeTrainSDL/core/world/rail/Platform.cs branches/FreeTrainSDL/core/world/rail/PlatformHost.cs branches/FreeTrainSDL/core/world/rail/SimpleTrainControllerImpl.cs branches/FreeTrainSDL/core/world/rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/world/rail/Station.cs branches/FreeTrainSDL/core/world/rail/StationListener.cs branches/FreeTrainSDL/core/world/rail/ThinPlatform.cs branches/FreeTrainSDL/core/world/rail/Train.cs branches/FreeTrainSDL/core/world/rail/TrainController.cs branches/FreeTrainSDL/core/world/rail/TrainHarbor.cs branches/FreeTrainSDL/core/world/structs/Commercial.cs branches/FreeTrainSDL/core/world/structs/PopulatedStructure.cs branches/FreeTrainSDL/core/world/structs/StationListenerImpl.cs branches/FreeTrainSDL/core/world/structs/Structure.cs branches/FreeTrainSDL/core/world/structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/world/subsidiaries/SubsidiaryCompany.cs branches/FreeTrainSDL/core/world/subsidiaries/SubsidiaryEntity.cs branches/FreeTrainSDL/core/world/terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Added Paths: ----------- branches/FreeTrainSDL/core/framework/graphics/BitmapSurfaceLoader.cs branches/FreeTrainSDL/core/framework/graphics/ISurfaceLoader.cs branches/FreeTrainSDL/core/framework/graphics/NightSurfaceLoader.cs branches/FreeTrainSDL/core/framework/plugin/IContributionFactory.cs Removed Paths: ------------- branches/FreeTrainSDL/core/framework/graphics/SurfaceLoaders.cs branches/FreeTrainSDL/core/framework/plugin/ContributionFactory.cs Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/Program.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -66,7 +66,7 @@ Point autoScrollPosition; QuarterViewDrawer qView = null; WorldDefinition world = null; - WeatherOverlay weatherOverlay; + IWeatherOverlay weatherOverlay; Sdl.SDL_Rect sourceRect; Sdl.SDL_Rect dst; short oldX; Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-01 08:35:00 UTC (rev 303) @@ -391,7 +391,11 @@ <DependentUpon>AboutDialog.cs</DependentUpon> <SubType>Form</SubType> </Compile> + <Compile Include="framework\graphics\NightSurfaceLoader.cs" /> + <Compile Include="framework\graphics\BitmapSurfaceLoader.cs" /> <Compile Include="framework\graphics\ISprite.cs" /> + <Compile Include="framework\graphics\ISurfaceLoader.cs" /> + <Compile Include="framework\plugin\IContributionFactory.cs" /> <Compile Include="framework\Splash.Designer.cs"> <DependentUpon>Splash.cs</DependentUpon> <SubType>Form</SubType> @@ -459,9 +463,6 @@ <Compile Include="framework\graphics\SpriteLoaderContribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="framework\graphics\SurfaceLoaders.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="framework\MainWindow.cs"> <SubType>Form</SubType> </Compile> @@ -480,9 +481,6 @@ <Compile Include="framework\plugin\Contribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="framework\plugin\ContributionFactory.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="framework\plugin\DynamicContributionFactory.cs"> <SubType>Code</SubType> </Compile> Modified: branches/FreeTrainSDL/core/contributions/rail/DepartureBellContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/rail/DepartureBellContribution.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/contributions/rail/DepartureBellContribution.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -53,7 +53,7 @@ public readonly string name; /// <summary> Bell sound </summary> - public readonly SoundEffect sound; + public readonly ISoundEffect sound; /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/contributions/sound/BGMFactoryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/sound/BGMFactoryContribution.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/contributions/sound/BGMFactoryContribution.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -50,7 +50,7 @@ public abstract string title { get; } } - internal class BGMFactoryContributionFactory : ContributionFactory + internal class BGMFactoryContributionFactory : IContributionFactory { /// <summary> /// @@ -67,7 +67,7 @@ /// <param name="owner"></param> /// <param name="e"></param> /// <returns></returns> - public Contribution load(PluginDefinition owner, XmlElement e) + public Contribution Load(PluginDefinition owner, XmlElement e) { BGMFactoryContribution contrib = (BGMFactoryContribution)PluginUtil.loadObjectFromManifest(e); Modified: branches/FreeTrainSDL/core/contributions/train/TrainContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/TrainContributionFactory.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/contributions/train/TrainContributionFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -30,7 +30,7 @@ /// When a class element is present, it is used. Otherwise /// defaults to ParamTrainImpl /// </summary> - public class TrainContributionFactory : ContributionFactory + public class TrainContributionFactory : IContributionFactory { /// <summary> /// @@ -47,7 +47,7 @@ /// <param name="owner"></param> /// <param name="e"></param> /// <returns></returns> - public Contribution load(PluginDefinition owner, XmlElement e) + public Contribution Load(PluginDefinition owner, XmlElement e) { if (e.SelectSingleNode("class") == null) // default to ParamTrainImpl Modified: branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -72,7 +72,7 @@ /// </summary> protected virtual void onCanceled() { - site.close(); + site.Close(); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/PointSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -149,7 +149,7 @@ /// </summary> public virtual void close() { - site.close(); + site.Close(); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/RectSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -76,7 +76,7 @@ /// </summary> protected virtual void onCanceled() { - site.close(); + site.Close(); } /// <summary> /// Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -65,7 +65,7 @@ groupFat.Visible = (platform is FatPlatform); // fill host list - foreach (PlatformHost host in platform.listHosts()) + foreach (IPlatformHost host in platform.listHosts()) hostList.Items.Add(host); hostList.SelectedItem = platform.host; @@ -341,7 +341,7 @@ private void OKbutton_Click(object sender, System.EventArgs e) { platform.name = nameBox.Text; - platform.host = (PlatformHost)hostList.SelectedItem; + platform.host = (IPlatformHost)hostList.SelectedItem; platform.bellSound = (DepartureBellContribution)bell.SelectedItem; } Modified: branches/FreeTrainSDL/core/framework/Core.cs =================================================================== --- branches/FreeTrainSDL/core/framework/Core.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/Core.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -187,7 +187,7 @@ /// <summary> /// /// </summary> - public class DefaultPluginErrorHandler : PluginErrorHandler + public class DefaultPluginErrorHandler : IPluginErrorHandler { int errCount; readonly int errMax; Modified: branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs =================================================================== --- branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -38,7 +38,7 @@ /// <param name="plugindirs"></param> /// <param name="progressHandler"></param> /// <param name="errorHandler"></param> - public static void InitializePlugins(string[] plugindirs, ProgressHandler progressHandler, PluginErrorHandler errorHandler) + public static void InitializePlugins(string[] plugindirs, ProgressHandler progressHandler, IPluginErrorHandler errorHandler) { if (initialized) Clear(); Added: branches/FreeTrainSDL/core/framework/graphics/BitmapSurfaceLoader.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/BitmapSurfaceLoader.cs (rev 0) +++ branches/FreeTrainSDL/core/framework/graphics/BitmapSurfaceLoader.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -0,0 +1,79 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Runtime.InteropServices; +using FreeTrain.Framework.Graphics; + +namespace FreeTrain.Framework.Graphics +{ + /// <summary> + /// Loads a surface from a bitmap + /// </summary> + public class BitmapSurfaceLoader : ISurfaceLoader + { + /// <summary> File name of the bitmap. </summary> + private readonly string fileName; + + /// <summary> + /// + /// </summary> + protected Surface DaySurface; + + /// <summary> + /// + /// </summary> + public string FileName + { + get + { + return fileName; + } + } + + /// <summary> + /// + /// </summary> + /// <param name="fileName"></param> + public BitmapSurfaceLoader(string fileName) + { + this.fileName = fileName; + } + + /// <summary> + /// + /// </summary> + /// <param name="surface"></param> + public void Load(ref Surface surface) + { + if (this.DaySurface == null) + { + this.DaySurface = new Surface(FileName); + } + if (surface != null) + { + surface.Dispose(); + } + surface = DaySurface; + } + } +} Property changes on: branches/FreeTrainSDL/core/framework/graphics/BitmapSurfaceLoader.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Copied: branches/FreeTrainSDL/core/framework/graphics/ISurfaceLoader.cs (from rev 299, branches/FreeTrainSDL/core/framework/graphics/SurfaceLoaders.cs) =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/ISurfaceLoader.cs (rev 0) +++ branches/FreeTrainSDL/core/framework/graphics/ISurfaceLoader.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -0,0 +1,45 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Runtime.InteropServices; +using FreeTrain.Framework.Graphics; + +namespace FreeTrain.Framework.Graphics +{ + /// <summary> + /// Function object that can load a picture into the given surface. + /// </summary> + public interface ISurfaceLoader + { + /// <summary> + /// Fill the surface by the image and return the mask color. + /// If the surface is null, the callee needs to allocate a new surface + /// </summary> + void Load(ref Surface surface); + + /// <summary> + /// + /// </summary> + string FileName { get; } + } +} Added: branches/FreeTrainSDL/core/framework/graphics/NightSurfaceLoader.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/NightSurfaceLoader.cs (rev 0) +++ branches/FreeTrainSDL/core/framework/graphics/NightSurfaceLoader.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -0,0 +1,82 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Runtime.InteropServices; +using FreeTrain.Framework.Graphics; + +namespace FreeTrain.Framework.Graphics +{ + /// <summary> + /// Surface Loader that builds a night image in an automatic way. + /// This surface loader uses another surface loader to load the surface, + /// then change the picture on the surface. + /// </summary> + public class NightSurfaceLoader : ISurfaceLoader + { + /// <summary> + /// Base surface loader. + /// </summary> + //private readonly SurfaceLoader coreLoader; + private Surface nightSurface; + + /// <summary> + /// + /// </summary> + public string FileName + { + get + { + return fileName; + } + } + + private string fileName; + + /// <summary> + /// + /// </summary> + /// <param name="fileName"></param> + public NightSurfaceLoader(string fileName) + { + this.fileName = fileName; + } + + /// <summary> + /// + /// </summary> + /// <param name="surface"></param> + public virtual void Load(ref Surface surface) + { + if (this.nightSurface == null) + { + this.nightSurface = new Surface(fileName); + this.nightSurface.buildNightImage(); + } + if (surface != null) + { + surface.Dispose(); + } + surface = nightSurface; + } + } +} Property changes on: branches/FreeTrainSDL/core/framework/graphics/NightSurfaceLoader.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Modified: branches/FreeTrainSDL/core/framework/graphics/Picture.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/Picture.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/graphics/Picture.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -49,7 +49,7 @@ /// <summary> /// capable of restoring surface images. /// </summary> - private readonly SurfaceLoader[,] loaders; + private readonly ISurfaceLoader[,] loaders; /// <summary> /// Dirty flag. Set true to reload the surface. @@ -62,7 +62,7 @@ /// </summary> /// <param name="_id"></param> /// <param name="_loaders"></param> - public Picture(string _id, SurfaceLoader[,] _loaders) + public Picture(string _id, ISurfaceLoader[,] _loaders) { this.id = _id; this.loaders = init(_loaders); @@ -74,7 +74,7 @@ public Picture(string _id, string fileName) { this.id = _id; - SurfaceLoader[,] sl = new SurfaceLoader[4, 2]; + ISurfaceLoader[,] sl = new ISurfaceLoader[4, 2]; sl[0, 0] = new BitmapSurfaceLoader(fileName); this.loaders = init(sl); @@ -88,7 +88,7 @@ public Picture(string _id, string dayfileName, string nightfileName) { this.id = _id; - SurfaceLoader[,] sl = new SurfaceLoader[4, 2]; + ISurfaceLoader[,] sl = new ISurfaceLoader[4, 2]; sl[0, 0] = new BitmapSurfaceLoader(dayfileName); sl[0, 1] = new BitmapSurfaceLoader(nightfileName); this.loaders = init(sl); @@ -111,7 +111,7 @@ string baseFileName = XmlUtil.resolve(pic, pic.Attributes["src"].Value).LocalPath; // this.size = getBitmapSize(baseFileName); - SurfaceLoader[,] specifiedLoaders = new SurfaceLoader[4, 2]; + ISurfaceLoader[,] specifiedLoaders = new ISurfaceLoader[4, 2]; specifiedLoaders[0, 0] = new BitmapSurfaceLoader(baseFileName); specifiedLoaders[0, 1] = getNightOverride(pic); @@ -137,7 +137,7 @@ XmlAttribute src = ovr.Attributes["src"]; if (src != null) { - SurfaceLoader overrideLoader = new BitmapSurfaceLoader( + ISurfaceLoader overrideLoader = new BitmapSurfaceLoader( XmlUtil.resolve(ovr, src.Value).LocalPath); specifiedLoaders[s, 0] = overrideLoader; } @@ -149,7 +149,7 @@ } // load nested night override (for each seasons). - private SurfaceLoader getNightOverride(XmlElement node) + private ISurfaceLoader getNightOverride(XmlElement node) { XmlNode ovr = node.SelectSingleNode("override"); if (ovr == null) return null; @@ -166,9 +166,9 @@ /// </summary> /// <param name="specifiedLoaders"></param> /// <returns></returns> - private SurfaceLoader[,] init(SurfaceLoader[,] specifiedLoaders) + private ISurfaceLoader[,] init(ISurfaceLoader[,] specifiedLoaders) { - SurfaceLoader[,] loaders = new SurfaceLoader[4, 2]; + ISurfaceLoader[,] loaders = new ISurfaceLoader[4, 2]; // Fill-in unspecified SpriteLoaders by the default ones. for (int s = 0; s < 4; s++) Deleted: branches/FreeTrainSDL/core/framework/graphics/SurfaceLoaders.cs =================================================================== --- branches/FreeTrainSDL/core/framework/graphics/SurfaceLoaders.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/graphics/SurfaceLoaders.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -1,150 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Diagnostics; -using System.Drawing; -using System.Runtime.InteropServices; -using FreeTrain.Framework.Graphics; - -namespace FreeTrain.Framework.Graphics -{ - /// <summary> - /// Function object that can load a picture into the given surface. - /// </summary> - public interface SurfaceLoader - { - /// <summary> - /// Fill the surface by the image and return the mask color. - /// If the surface is null, the callee needs to allocate a new surface - /// </summary> - void Load(ref Surface surface); - - /// <summary> - /// - /// </summary> - string FileName { get; } - } - - /// <summary> - /// Loads a surface from a bitmap - /// </summary> - public class BitmapSurfaceLoader : SurfaceLoader - { - /// <summary> File name of the bitmap. </summary> - private readonly string fileName; - - /// <summary> - /// - /// </summary> - protected Surface DaySurface; - - /// <summary> - /// - /// </summary> - public string FileName - { - get - { - return fileName; - } - } - - /// <summary> - /// - /// </summary> - /// <param name="fileName"></param> - public BitmapSurfaceLoader(string fileName) - { - this.fileName = fileName; - } - - /// <summary> - /// - /// </summary> - /// <param name="surface"></param> - public void Load(ref Surface surface) - { - if (this.DaySurface == null) - { - this.DaySurface = new Surface(FileName); - } - if (surface != null) - { - surface.Dispose(); - } - surface = DaySurface; - } - } - - /// <summary> - /// Surface Loader that builds a night image in an automatic way. - /// This surface loader uses another surface loader to load the surface, - /// then change the picture on the surface. - /// </summary> - public class NightSurfaceLoader : SurfaceLoader - { - /// <summary> - /// Base surface loader. - /// </summary> - //private readonly SurfaceLoader coreLoader; - private Surface nightSurface; - - /// <summary> - /// - /// </summary> - public string FileName - { - get - { - return fileName; - } - } - - private string fileName; - - /// <summary> - /// - /// </summary> - /// <param name="fileName"></param> - public NightSurfaceLoader(string fileName) - { - this.fileName = fileName; - } - - /// <summary> - /// - /// </summary> - /// <param name="surface"></param> - public virtual void Load(ref Surface surface) - { - if (this.nightSurface == null) - { - this.nightSurface = new Surface(fileName); - this.nightSurface.buildNightImage(); - } - if (surface != null) - { - surface.Dispose(); - } - surface = nightSurface; - } - } -} Deleted: branches/FreeTrainSDL/core/framework/plugin/ContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/ContributionFactory.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/plugin/ContributionFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -1,20 +0,0 @@ -using System; -using System.Xml; - -namespace FreeTrain.Framework.Plugin -{ - /// <summary> - /// Responsible for loading a contribution from an XML element. - /// </summary> - public interface ContributionFactory - { - /// <summary> - /// Loads a contribution from an XML Element "e", - /// which belongs to the plugin "owner". - /// - /// In case of an error, this method must throw an exception - /// instead of silently returning null. - /// </summary> - Contribution load( PluginDefinition owner, XmlElement e ); - } -} Modified: branches/FreeTrainSDL/core/framework/plugin/DynamicContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/DynamicContributionFactory.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/plugin/DynamicContributionFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -27,7 +27,7 @@ /// Loads a Contribution class by using a <class> element /// in the contribution Xml definition. /// </summary> - public class DynamicContributionFactory : ContributionFactory + public class DynamicContributionFactory : IContributionFactory { /// <param name="baseType"> /// Type of the contribution to be loaded. @@ -55,7 +55,7 @@ /// <param name="owner"></param> /// <param name="e"></param> /// <returns></returns> - public Contribution load(PluginDefinition owner, XmlElement e) + public Contribution Load(PluginDefinition owner, XmlElement e) { Contribution contrib = (Contribution)PluginUtil.loadObjectFromManifest(e); if (baseType.IsInstanceOfType(contrib)) Modified: branches/FreeTrainSDL/core/framework/plugin/FixedClassContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/FixedClassContributionFactory.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/plugin/FixedClassContributionFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -27,7 +27,7 @@ /// Loads a Contribution from a designated class by passing the XmlElement /// to its constructor /// </summary> - public class FixedClassContributionFactory : ContributionFactory + public class FixedClassContributionFactory : IContributionFactory { /// <param name="concreteType"> /// Type of the class to be used to load the class. @@ -51,7 +51,7 @@ /// <param name="owner"></param> /// <param name="e"></param> /// <returns></returns> - public Contribution load(PluginDefinition owner, XmlElement e) + public Contribution Load(PluginDefinition owner, XmlElement e) { return (Contribution)Activator.CreateInstance(concreteType, new object[] { e }); } Copied: branches/FreeTrainSDL/core/framework/plugin/IContributionFactory.cs (from rev 299, branches/FreeTrainSDL/core/framework/plugin/ContributionFactory.cs) =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/IContributionFactory.cs (rev 0) +++ branches/FreeTrainSDL/core/framework/plugin/IContributionFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -0,0 +1,20 @@ +using System; +using System.Xml; + +namespace FreeTrain.Framework.Plugin +{ + /// <summary> + /// Responsible for loading a contribution from an XML element. + /// </summary> + public interface IContributionFactory + { + /// <summary> + /// Loads a contribution from an XML Element "e", + /// which belongs to the plugin "owner". + /// + /// In case of an error, this method must throw an exception + /// instead of silently returning null. + /// </summary> + Contribution Load( PluginDefinition owner, XmlElement element ); + } +} Modified: branches/FreeTrainSDL/core/framework/plugin/PluginDefinition.cs =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/PluginDefinition.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/plugin/PluginDefinition.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -137,8 +137,8 @@ string contributionName = XmlUtil.selectSingleNode(contrib, "name").InnerText; - ContributionFactory factory = - (ContributionFactory)PluginUtil.loadObjectFromManifest(contrib); + IContributionFactory factory = + (IContributionFactory)PluginUtil.loadObjectFromManifest(contrib); // register it PluginManager.theInstance.addContributionFactory( @@ -248,8 +248,8 @@ string type = contrib.Attributes["type"].Value; if (type == "contribution") continue; // ignore - ContributionFactory factory = PluginManager.theInstance.getContributionFactory(type); - Contribution c = factory.load(this, contrib); + IContributionFactory factory = PluginManager.theInstance.getContributionFactory(type); + Contribution c = factory.Load(this, contrib); contributions.Add(c); PluginManager.theInstance.addContribution(c); c.init(this, baseUri); Modified: branches/FreeTrainSDL/core/framework/plugin/PluginManager.cs =================================================================== --- branches/FreeTrainSDL/core/framework/plugin/PluginManager.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/plugin/PluginManager.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -39,7 +39,7 @@ /// <summary> /// /// </summary> - public interface PluginErrorHandler + public interface IPluginErrorHandler { /// <summary> /// @@ -82,7 +82,7 @@ /// <summary> /// /// </summary> - public class SilentPluginErrorHandler : PluginErrorHandler + public class SilentPluginErrorHandler : IPluginErrorHandler { #region PluginErrorHandler o /// <summary> @@ -220,7 +220,7 @@ /// </param> /// <param name="errorHandler"></param> /// <param name="progressHandler"></param> - public void init(ICollection dirs, ProgressHandler progressHandler, PluginErrorHandler errorHandler) + public void init(ICollection dirs, ProgressHandler progressHandler, IPluginErrorHandler errorHandler) { Set pluginSet = new Set(); @@ -428,7 +428,7 @@ /// Normally, this method is called by <c>Plugin</c> but the caller /// can invoke this method before calling the init method. /// </summary> - public void addContributionFactory(string name, ContributionFactory factory) + public void addContributionFactory(string name, IContributionFactory factory) { if (contributionFactories.Contains(name)) throw new Exception(string.Format( @@ -441,9 +441,9 @@ /// </summary> /// <param name="name"></param> /// <returns></returns> - public ContributionFactory getContributionFactory(string name) + public IContributionFactory getContributionFactory(string name) { - ContributionFactory factory = (ContributionFactory) + IContributionFactory factory = (IContributionFactory) contributionFactories[name]; if (factory == null) Modified: branches/FreeTrainSDL/core/framework/sound/RepeatableSoundEffectImpl.cs =================================================================== --- branches/FreeTrainSDL/core/framework/sound/RepeatableSoundEffectImpl.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/sound/RepeatableSoundEffectImpl.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -38,7 +38,7 @@ /// /// This implementation handles this kind of behavior. /// </summary> - public class RepeatableSoundEffectImpl : SoundEffect + public class RepeatableSoundEffectImpl : ISoundEffect { /// <summary> /// </summary> Modified: branches/FreeTrainSDL/core/framework/sound/SoundEffect.cs =================================================================== --- branches/FreeTrainSDL/core/framework/sound/SoundEffect.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/framework/sound/SoundEffect.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -26,7 +26,7 @@ /// <summary> /// Sound Effect /// </summary> - public interface SoundEffect + public interface ISoundEffect { /// <summary> /// Requests to play this sound effect, which is conceptually Modified: branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs =================================================================== --- branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -27,13 +27,13 @@ /// <summary> /// NullWeatherOverlay の概要の説明です。 /// </summary> - public sealed class NullWeatherOverlay : WeatherOverlay + public sealed class NullWeatherOverlay : IWeatherOverlay { private NullWeatherOverlay() { } /// <summary> /// /// </summary> - public static readonly WeatherOverlay theInstance = new NullWeatherOverlay(); + public static readonly IWeatherOverlay theInstance = new NullWeatherOverlay(); /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -351,13 +351,13 @@ /// </summary> private bool shouldDrawGround(int h, int v, int z) { - HoleVoxel hva; + IHoleVoxel hva; if (z == world.Size.z - 1) hva = null; - else hva = world.voxelHVD(h, v, z) as HoleVoxel; + else hva = world.voxelHVD(h, v, z) as IHoleVoxel; - HoleVoxel hvb; + IHoleVoxel hvb; if (z == 0) hvb = null; - else hvb = world.voxelHVD(h, v, z - 1) as HoleVoxel; + else hvb = world.voxelHVD(h, v, z - 1) as IHoleVoxel; if (hva != null && !hva.drawGround(false)) return false; Modified: branches/FreeTrainSDL/core/views/WeatherOverlay.cs =================================================================== --- branches/FreeTrainSDL/core/views/WeatherOverlay.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/views/WeatherOverlay.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -16,37 +16,37 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#endregion LICENSE - -using System; -using System.Drawing; -using System.Windows.Forms; -using FreeTrain.Framework.Graphics; - -namespace FreeTrain.Views -{ - /// <summary> - /// Draws overlay images to a QuarterViewDrawer. - /// </summary> - public interface WeatherOverlay : IDisposable - { - /// <summary> - /// Called when the size of the QuarterViewDrawer is changed. - /// </summary> - void setSize( Size sz ); - - /// <summary> - /// Draws the contents of the given drawer with the overlay - /// to the target image. - /// </summary> - void draw( QuarterViewDrawer drawer, Surface target, Point pt ); - - /// <summary> - /// TBD: Periodical timer notification. - /// </summary> - /// <returns> - /// true if the screen needs to be updated. - /// </returns> - bool onTimerFired(); - } -} +#endregion LICENSE + +using System; +using System.Drawing; +using System.Windows.Forms; +using FreeTrain.Framework.Graphics; + +namespace FreeTrain.Views +{ + /// <summary> + /// Draws overlay images to a QuarterViewDrawer. + /// </summary> + public interface IWeatherOverlay : IDisposable + { + /// <summary> + /// Called when the size of the QuarterViewDrawer is changed. + /// </summary> + void setSize( Size sz ); + + /// <summary> + /// Draws the contents of the given drawer with the overlay + /// to the target image. + /// </summary> + void draw( QuarterViewDrawer drawer, Surface target, Point pt ); + + /// <summary> + /// TBD: Periodical timer notification. + /// </summary> + /// <returns> + /// true if the screen needs to be updated. + /// </returns> + bool onTimerFired(); + } +} Modified: branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs =================================================================== --- branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -28,7 +28,7 @@ /// <summary> /// WeatherOverlayImpl の概要の説明です。 /// </summary> - public class WeatherOverlayImpl : WeatherOverlay + public class WeatherOverlayImpl : IWeatherOverlay { private readonly WeatherOverlaySpriteSet spriteSet; private Size canvasSize; Modified: branches/FreeTrainSDL/core/views/map/MapView.cs =================================================================== --- branches/FreeTrainSDL/core/views/map/MapView.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/views/map/MapView.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -46,7 +46,7 @@ //private QuarterViewDrawer drawer; private System.Windows.Forms.Timer weatherTimer; - private WeatherOverlay weatherOverlay; + private IWeatherOverlay weatherOverlay; /// <summary> /// Modified: branches/FreeTrainSDL/core/world/CarState.cs =================================================================== --- branches/FreeTrainSDL/core/world/CarState.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/CarState.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -69,12 +69,12 @@ /// </summary> /// <param name="visitor"></param> /// <returns></returns> - public abstract object accept(Visitor visitor); + public abstract object accept(IVisitor visitor); /// <summary> /// /// </summary> - public interface Visitor + public interface IVisitor { /// <summary> /// @@ -145,7 +145,7 @@ /// </summary> /// <param name="visitor"></param> /// <returns></returns> - public override object accept(Visitor visitor) + public override object accept(IVisitor visitor) { return visitor.onInside(this); } @@ -173,7 +173,7 @@ /// </summary> /// <param name="visitor"></param> /// <returns></returns> - public override object accept(Visitor visitor) + public override object accept(IVisitor visitor) { return visitor.onUnplaced(this); } @@ -213,7 +213,7 @@ /// </summary> /// <param name="visitor"></param> /// <returns></returns> - public override object accept(Visitor visitor) + public override object accept(IVisitor visitor) { return visitor.onOutsie(this); } Modified: branches/FreeTrainSDL/core/world/Cube.cs =================================================================== --- branches/FreeTrainSDL/core/world/Cube.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/Cube.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -227,7 +227,7 @@ /// <summary> /// Lists up all the entities whose voxels intersect with this cube. /// </summary> - public Entity[] getEntities() + public IEntity[] getEntities() { int mx = x2; int my = y2; @@ -247,7 +247,7 @@ } } - return (Entity[])r.toArray(typeof(Entity)); + return (IEntity[])r.toArray(typeof(IEntity)); } /// <summary> Modified: branches/FreeTrainSDL/core/world/EmptyVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/world/EmptyVoxel.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/EmptyVoxel.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -31,7 +31,7 @@ [Serializable] public class EmptyVoxel : AbstractVoxelImpl { - private readonly Entity _entity; + private readonly IEntity _entity; /// <summary> /// /// </summary> @@ -43,13 +43,13 @@ /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> - public EmptyVoxel(Entity e, int x, int y, int z) : this(e, new Location(x, y, z)) { } + public EmptyVoxel(IEntity e, int x, int y, int z) : this(e, new Location(x, y, z)) { } /// <summary> /// /// </summary> /// <param name="e"></param> /// <param name="loc"></param> - public EmptyVoxel(Entity e, Location loc) + public EmptyVoxel(IEntity e, Location loc) : base(loc) { this._entity = e; @@ -67,6 +67,6 @@ /// <summary> /// /// </summary> - public override Entity entity { get { return _entity; } } + public override IEntity entity { get { return _entity; } } } } Modified: branches/FreeTrainSDL/core/world/Entity.cs =================================================================== --- branches/FreeTrainSDL/core/world/Entity.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/Entity.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -42,7 +42,7 @@ /// /// TODO: it's not clear why multiple tunnel voxels don't form one entity, for example. /// </summary> - public interface Entity + public interface IEntity { /// <summary> /// The monetary value of the entity. Modified: branches/FreeTrainSDL/core/world/SparseVoxelArray.cs =================================================================== --- branches/FreeTrainSDL/core/world/SparseVoxelArray.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/SparseVoxelArray.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -67,7 +67,7 @@ if (old != null) { // removed old ones - Entity e = old.entity; + IEntity e = old.entity; if (e.isSilentlyReclaimable) e.remove(); } Modified: branches/FreeTrainSDL/core/world/Traffic.cs =================================================================== --- branches/FreeTrainSDL/core/world/Traffic.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/Traffic.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -38,7 +38,7 @@ /// </summary> /// TrafficOccupantには線路・道路・および車(電車もしくは自動車)が入れる [Serializable] - public sealed class TrafficVoxel : AbstractVoxelImpl, Entity + public sealed class TrafficVoxel : AbstractVoxelImpl, IEntity { private Car _car; @@ -243,7 +243,7 @@ /// <summary> /// /// </summary> - public override Entity entity { get { return this; } } + public override IEntity entity { get { return this; } } #region Entity implementation /// <summary> Modified: branches/FreeTrainSDL/core/world/Voxel.cs =================================================================== --- branches/FreeTrainSDL/core/world/Voxel.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/Voxel.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -90,13 +90,13 @@ /// </summary> /// <param name="d"></param> /// <param name="f"></param> - public abstract void setFence(Direction d, Fence f); + public abstract void setFence(Direction d, IFence f); /// <summary> /// /// </summary> /// <param name="d"></param> /// <returns></returns> - public abstract Fence getFence(Direction d); + public abstract IFence getFence(Direction d); /// <summary> /// /// </summary> @@ -149,7 +149,7 @@ /// <summary> /// Obtains a reference to the entity that includes this voxel. /// </summary> - public abstract Entity entity { get; } + public abstract IEntity entity { get; } } @@ -162,7 +162,7 @@ /// <summary> /// /// </summary> - protected Fence[] fence = new Fence[4]; + protected IFence[] fence = new IFence[4]; /// <summary> /// /// @@ -205,7 +205,7 @@ /// <param name="pt"></param> protected override void drawFrontFence(DrawContext display, Point pt) { - Fence f; + IFence f; f = fence[(Direction.SOUTH).index / 2]; if (f != null) f.drawFence(display.Surface, pt, Direction.SOUTH); @@ -220,7 +220,7 @@ /// <param name="pt"></param> protected override void drawBehindFence(DrawContext display, Point pt) { - Fence f; + IFence f; f = fence[(Direction.NORTH).index / 2]; if (f != null) f.drawFence(display.Surface, pt, Direction.NORTH); @@ -233,7 +233,7 @@ /// </summary> /// <param name="d"></param> /// <param name="f"></param> - public override void setFence(Direction d, Fence f) + public override void setFence(Direction d, IFence f) { fence[d.index / 2] = f; } @@ -242,7 +242,7 @@ /// </summary> /// <param name="d"></param> /// <returns></returns> - public override Fence getFence(Direction d) + public override IFence getFence(Direction d) { return fence[d.index / 2]; @@ -268,7 +268,7 @@ /// The drawing routine queries this interface for voxels /// that are directly above and below the surface. /// </summary> - public interface HoleVoxel + public interface IHoleVoxel { /// <summary> /// Returns false to prevent the ground surface to be drawn. @@ -283,7 +283,7 @@ /// <summary> /// The interface called when the fence should be drawn. /// </summary> - public interface Fence + public interface IFence { /// <summary> /// called when the fehce should be drawn. Modified: branches/FreeTrainSDL/core/world/WorldDefinition.cs =================================================================== --- branches/FreeTrainSDL/core/world/WorldDefinition.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/WorldDefinition.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -449,7 +449,7 @@ /// </summary> /// <param name="loc"></param> /// <returns></returns> - public Entity getEntityAt(Location loc) + public IEntity getEntityAt(Location loc) { Voxel v = this[loc]; if (v == null) return null; @@ -573,7 +573,7 @@ /// Used as the invisible wall that fills world outside the world /// </summary> [Serializable] - public class OutOfWorldVoxel : Voxel, Entity + public class OutOfWorldVoxel : Voxel, IEntity { /// <summary> /// @@ -599,7 +599,7 @@ /// <summary> /// /// </summary> - public override Entity entity { get { return this; } } + public override IEntity entity { get { return this; } } #region Entity implementation /// <summary> @@ -653,13 +653,13 @@ /// </summary> /// <param name="d"></param> /// <param name="f"></param> - public override void setFence(Direction d, Fence f) { } + public override void setFence(Direction d, IFence f) { } /// <summary> /// /// </summary> /// <param name="d"></param> /// <returns></returns> - public override Fence getFence(Direction d) { return null; } + public override IFence getFence(Direction d) { return null; } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/world/development/CommercialStructurePlan.cs =================================================================== --- branches/FreeTrainSDL/core/world/development/CommercialStructurePlan.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/development/CommercialStructurePlan.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -35,7 +35,7 @@ internal CommercialStructurePlan( CommercialStructureContribution _contrib, - ULVFactory factory, Location _loc ) + IULVFactory factory, Location _loc ) : base( factory.create(Cube.createExclusive(_loc, new Distance(_contrib.size.x, _contrib.size.y, 0) ))) { this.contrib = _contrib; Modified: branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs =================================================================== --- branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -38,7 +38,7 @@ /// Receives clock event and build a new structure if appropriate /// </summary> [Serializable] - public class DevelopmentAlgorithm : ULVFactory + public class DevelopmentAlgorithm : IULVFactory { static internal ArrayList structs = new ArrayList(); static internal ArrayList vhStructs = new ArrayList(); @@ -327,8 +327,8 @@ phase = Phase.Start; break; } - Entity[] es = plan.cube.getEntities(); - foreach (Entity e in es) + IEntity[] es = plan.cube.getEntities(); + foreach (IEntity e in es) { if (!IsReplaceable(e, WorldDefinition.World.landValue[scaning])) { @@ -337,7 +337,7 @@ return; } } - foreach (Entity e in es) + foreach (IEntity e in es) e.remove(); phase++; // 用地確保と建設の間があくと、入れ違いで他のプランが建設される可能性あり @@ -389,7 +389,7 @@ int price = vhbc.price * h; Cube tmp = new Cube(scaning, vhbc.size, h); int cost = 0; - foreach (Entity e in tmp.getEntities()) + foreach (IEntity e in tmp.getEntities()) cost += e.entityValue; while (price < cost && h < h2) { @@ -437,14 +437,14 @@ /// <param name="e"></param> /// <param name="comPrice"></param> /// <returns></returns> - protected bool IsReplaceable(Entity e, int comPrice) + protected bool IsReplaceable(IEntity e, int comPrice) { comPrice = (int)(comPrice * F_ReplacePriceFactor); if (e.isOwned || e is ConstructionSite) return false; - if (e is SubsidiaryEntity) + if (e is ISubsidiaryEntity) { - SubsidiaryEntity se = e as SubsidiaryEntity; + ISubsidiaryEntity se = e as ISubsidiaryEntity; bool b = (se.structurePrice < comPrice || se.structurePrice < se.totalLandPrice); return b; } Modified: branches/FreeTrainSDL/core/world/development/LandPlan.cs =================================================================== --- branches/FreeTrainSDL/core/world/development/LandPlan.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/development/LandPlan.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -33,7 +33,7 @@ private readonly Location loc; private readonly SIZE size; - internal LandPlan( LandBuilderContribution _contrib, ULVFactory factory, Location _loc, SIZE _size ) + internal LandPlan( LandBuilderContribution _contrib, IULVFactory factory, Location _loc, SIZE _size ) : base(factory.create(new Cube(_loc,_size.x,_size.y,0))) { this.contrib = _contrib; this.loc = _loc; Modified: branches/FreeTrainSDL/core/world/development/ULV.cs =================================================================== --- branches/FreeTrainSDL/core/world/development/ULV.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/development/ULV.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -90,7 +90,7 @@ Voxel v = world[x, y, z]; if (v != null) { - Entity e = v.entity; + IEntity e = v.entity; if (e.isOwned) // cannot reclaim this voxel. return null; Modified: branches/FreeTrainSDL/core/world/development/ULVFactory.cs =================================================================== --- branches/FreeTrainSDL/core/world/development/ULVFactory.cs 2008-03-31 23:10:09 UTC (rev 302) +++ branches/FreeTrainSDL/core/world/development/ULVFactory.cs 2008-04-01 08:35:00 UTC (rev 303) @@ -31,7 +31,7 @@ /// /// ULVFactory hides the caching detail. /// </summary> - public interface ULVFactory + public interface IULVFactory { /// <summary> /// Modified: branches/FreeTrainSDL/core/world/development/VarHeightBuildingPlan.cs ===============... [truncated message content] |
From: <je...@us...> - 2008-04-01 09:38:43
|
Revision: 305 http://freetrain.svn.sourceforge.net/freetrain/?rev=305&view=rev Author: jendave Date: 2008-04-01 02:38:50 -0700 (Tue, 01 Apr 2008) Log Message: ----------- casing fixes Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/controllers/IControllerSite.cs branches/FreeTrainSDL/core/controllers/IModalController.cs branches/FreeTrainSDL/core/controllers/PointSelectorController.cs branches/FreeTrainSDL/core/controllers/RectSelectorController.cs branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs branches/FreeTrainSDL/core/views/map/HeightCutWindow.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/Program.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -117,7 +117,7 @@ if (qView != null) { controller = MainWindow.mainWindow.CurrentController; - qView.updateScreen(); + qView.UpdateScreen(); if (WorldDefinition.World.Satellite == null || WorldDefinition.World.Satellite.surface.w != 150 || WorldDefinition.World.Satellite.surface.h != 150) @@ -145,7 +145,7 @@ screen = SdlDotNet.Graphics.Video.SetVideoMode(width, height, currentBpp, true); screen.SourceColorKey = Color.Magenta; weatherOverlay.setSize(new Size(width, height)); - qView.size = new Size(e.Width, e.Height); + qView.Size = new Size(e.Width, e.Height); } private void MusicFinished(object sender, MusicFinishedEventArgs e) @@ -192,7 +192,7 @@ { if (dragMode) { - scrollByDrag(new Point(e.X, e.Y)); + ScrollByDrag(new Point(e.X, e.Y)); } else { @@ -207,7 +207,7 @@ } } - private void timerTick(object sender, EventArgs e) + private void TimerTick(object sender, EventArgs e) { if (qView != null) { @@ -216,13 +216,13 @@ sourceRect = new Sdl.SDL_Rect((short)ScrollPosition.X, (short)ScrollPosition.Y, (short)width, (short)height); dst = new Sdl.SDL_Rect(0, 0, (short)width, (short)height); - Tao.Sdl.Sdl.SDL_BlitSurface(qView.offscreenBuffer.surfacePtr(), ref sourceRect, screen.Handle, ref dst); + Tao.Sdl.Sdl.SDL_BlitSurface(qView.OffscreenBuffer.surfacePtr(), ref sourceRect, screen.Handle, ref dst); } - finalDraw(); + FinalDraw(); } - private void finalDraw() + private void FinalDraw() { if (mainWindowMDI != null && WorldDefinition.World != null) { @@ -231,18 +231,18 @@ screen.Update(); } - private bool scrollByDrag(Point curMousePos) + private bool ScrollByDrag(Point curMousePos) { int dragAccel = 1; Point pt = this.dragStartScrollPosition; pt.X += (curMousePos.X - dragStartMousePosition.X) * dragAccel; pt.Y += (curMousePos.Y - dragStartMousePosition.Y) * dragAccel; ScrollPosition = pt; - qView.origin = ScrollPosition; + qView.Origin = ScrollPosition; return true; } - private int distance(Point a, Point b) + private int Distance(Point a, Point b) { return (int)Math.Sqrt((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y)); } @@ -316,30 +316,30 @@ splashscreen.status.AppendText("\n"); splashscreen.Refresh(); - finalDraw(); + FinalDraw(); MainWindow.mainWindow = new MainWindow(null, true); splashscreen.status.AppendText("Loading plugins..."); splashscreen.status.AppendText("\n"); splashscreen.Refresh(); - finalDraw(); + FinalDraw(); Core.init(null, null, null, new ProgressHandler(UpdateMessage), true); world = new WorldDefinition(new Distance(150, 150, 7), 3); WorldDefinition.World = world; weatherOverlay = NullWeatherOverlay.theInstance; - finalDraw(); + FinalDraw(); qView = new QuarterViewDrawer(world, new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8)); - qView.offscreenBuffer = new Surface(world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8, screen.CreateCompatibleSurface().Pixels); - qView.offscreenBuffer.SourceColorKey = Color.Magenta; - qView.recreateDrawBuffer(new Size(width, height), true); + qView.OffscreenBuffer = new Surface(world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8, screen.CreateCompatibleSurface().Pixels); + qView.OffscreenBuffer.SourceColorKey = Color.Magenta; + qView.RecreateDrawBuffer(new Size(width, height), true); splashscreen.status.AppendText("Creating Map..."); splashscreen.status.AppendText("\n"); splashscreen.Refresh(); - finalDraw(); + FinalDraw(); - qView.draw(new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8), null); - timer.Tick += new EventHandler(timerTick); + qView.Draw(new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8), null); + timer.Tick += new EventHandler(TimerTick); timer.Interval = 33; timer.Enabled = true; timer.Start(); @@ -381,6 +381,7 @@ { Dispose(false); } + /// <summary> /// /// </summary> @@ -402,6 +403,5 @@ } #endregion - } } Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -72,26 +72,14 @@ MainWindow.mainWindow.DetachController(); } - // - // default implementation for ModalController - // - /// <summary> - /// - /// </summary> - [CLSCompliant(false)] - public void close() - { - base.Close(); - } + ///// <summary> + ///// + ///// </summary> + //public string Name { get { return Text; } } /// <summary> /// /// </summary> - public string name { get { return Text; } } - - /// <summary> - /// - /// </summary> public virtual ILocationDisambiguator Disambiguator { get { return null; } } /// <summary> @@ -103,6 +91,7 @@ /// /// </summary> public virtual void OnAttached() { } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/CubeSelectorController.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -77,7 +77,7 @@ /// <summary> /// /// </summary> - public virtual string name { get { return site.name; } } + public virtual string Name { get { return site.Name; } } // can be overrided by a derived class to return another object. /// <summary> Modified: branches/FreeTrainSDL/core/controllers/IControllerSite.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/IControllerSite.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/IControllerSite.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -35,6 +35,6 @@ /// <summary> /// /// </summary> - string name { get; } // TODO: fix + string Name { get; set;} // TODO: fix } } Modified: branches/FreeTrainSDL/core/controllers/IModalController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/IModalController.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/IModalController.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -43,6 +43,7 @@ /// <param name="loc">(X,Y,Z) location that was clicked</param> /// <param name="ab">(A,B) location that was clicked.</param> void OnClick(MapViewWindow source, Location loc, Point ab); + /// <summary> /// /// </summary> @@ -50,6 +51,7 @@ /// <param name="loc"></param> /// <param name="ab"></param> void OnRightClick(MapViewWindow source, Location loc, Point ab); + /// <summary> /// /// </summary> @@ -77,7 +79,7 @@ /// <summary> /// Gets the display name of this controller. /// </summary> - string name { get; } + string Name { get; } /// <summary> /// Gets the disambiguator associated with this controller, if any. Modified: branches/FreeTrainSDL/core/controllers/PointSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/PointSelectorController.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -158,7 +158,7 @@ /// <summary> /// /// </summary> - public virtual string name { get { return site.name; } } + public virtual string Name { get { return site.Name; } } // can be overrided by a derived class to return another object. /// <summary> Modified: branches/FreeTrainSDL/core/controllers/RectSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/controllers/RectSelectorController.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -81,7 +81,7 @@ /// <summary> /// /// </summary> - public virtual string name { get { return site.name; } } + public virtual string Name { get { return site.Name; } } // can be overrided by a derived class to return another object. /// <summary> Modified: branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs =================================================================== --- branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/views/NullWeatherOverlay.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -47,7 +47,7 @@ /// <param name="pt"></param> public void draw(QuarterViewDrawer drawer, Surface target, Point pt) { - drawer.draw(target, pt); + drawer.Draw(target, pt); } /// <summary> /// Modified: branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -46,9 +46,18 @@ /// <summary> /// Off-screen buffer that keeps the image of this window. /// </summary> - public Surface offscreenBuffer; + private Surface offscreenBuffer; /// <summary> + /// + /// </summary> + public Surface OffscreenBuffer + { + get { return offscreenBuffer; } + set { offscreenBuffer = value; } + } + + /// <summary> /// Drawing context that wraps <code>offscreenBuffer</code> /// </summary> private DrawContext drawContext; @@ -70,7 +79,6 @@ /// </summary> private int _heightCutHeight; - /// <summary> /// Fired when the height-cut height is changed /// </summary> @@ -83,7 +91,8 @@ private WorldDefinition world; - ISprite emptyChip, waterChip; + ISprite emptyChip; + ISprite waterChip; /// <summary></summary> /// <param name="initialView"> @@ -97,7 +106,7 @@ _heightCutHeight = world.Size.z - 1; //this.directDraw = directDraw; //offscreenBuffer = offscreen; - recreateDrawBuffer(initialView.Size, true); + RecreateDrawBuffer(initialView.Size, true); topLeft = new Point(initialView.X, initialView.Y); @@ -109,27 +118,27 @@ /// <summary> /// /// </summary> - public Size view_size; + public Size ViewSize; /// <summary> /// Size of the view in pixels. /// </summary> - public Size size + public Size Size { get { - if (offscreenBuffer != null) return view_size; //offscreenBuffer.size; + if (offscreenBuffer != null) return ViewSize; //offscreenBuffer.size; else return new Size(0, 0); } set { - recreateDrawBuffer(value, false); + RecreateDrawBuffer(value, false); } } /// <summary> /// /// </summary> - public Point origin + public Point Origin { get { @@ -188,10 +197,11 @@ updateScreen();*/ } } + /// <summary> /// /// </summary> - public bool enableOverlay + public bool EnableOverlay { get { @@ -212,7 +222,7 @@ { get { - return new Rectangle(topLeft, size); + return new Rectangle(topLeft, Size); } } @@ -223,7 +233,7 @@ /// Note that setting <code>world.size.z-1</code> will cause /// all the voxels to be drawn. /// </summary> - public int heightCutHeight + public int HeightCutHeight { get { @@ -253,7 +263,7 @@ /// (such as when the current surface is lost) /// </param> /// <param name="size"></param> - public void recreateDrawBuffer(Size size, bool forceRecreate) + public void RecreateDrawBuffer(Size size, bool forceRecreate) { /*if(offscreenBuffer!=null ) { @@ -265,7 +275,7 @@ offscreenBuffer = null; }*/ - view_size = size; + ViewSize = size; if (size.Width > 0 && size.Height > 0) { @@ -276,16 +286,15 @@ OnUpdateAllVoxels(); } - - /// <summary> /// Return true if the given voxel is visible. /// </summary> - public bool isVisible(Location loc) + public bool IsVisible(Location loc) { // find the bounding box in (A,B) axes return WorldDefinition.World.getBoundingBox(loc).IntersectsWith(this.visibleRect); } + /// <summary> /// /// </summary> @@ -315,6 +324,7 @@ if (OnUpdated != null) OnUpdated(this, null); } } + /// <summary> /// /// </summary> @@ -342,10 +352,6 @@ if (OnUpdated != null) OnUpdated(this, null); } - - - - /// <summary> /// Checks if we need to draw a ground surface. /// </summary> @@ -373,13 +379,13 @@ /// </summary> /// <param name="rectAB">Rectangle in the (A,B) coordinates.</param> /// <param name="overlay"></param> - public void draw(Rectangle rectAB, IMapOverlay overlay) + public void Draw(Rectangle rectAB, IMapOverlay overlay) { // the same rectangle in the client coordinates Rectangle rectClient = fromABToClient(rectAB); int waterLevel = world.waterLevel; - bool noHeightCut = (heightCutHeight == world.Size.z - 1); + bool noHeightCut = (HeightCutHeight == world.Size.z - 1); Color waterSurfaceColor = waterSurfaceDayColor; if (world.viewOptions.useNightView) @@ -400,7 +406,7 @@ int Hmax = Math.Min(rectHV.Right, world.Size.x - 1); int Zinit = noHeightCut ? (int)waterLevel : 0; // no need to draw underwater unless in the height cut mode - int Z = heightCutHeight; + int Z = HeightCutHeight; int Vmax = Math.Min(rectHV.Bottom + Z * 2, world.Size.y - 1); emptyChip = ResourceUtil.getGroundChip(world); @@ -502,7 +508,7 @@ /// <summary> /// Update the surface by redrawing necessary parts. /// </summary> - public void updateScreen() + public void UpdateScreen() { if (dirtyRect.isEmpty || offscreenBuffer == null) return; // no need for draw. @@ -518,7 +524,7 @@ // draw the rect Rectangle dr = dirtyRect.rect; if (dr.Top < 0) dr.Y = 0; // clipping. higher voxel on the northen edge could make top<0 - draw(dr, overlay); + Draw(dr, overlay); dirtyRect.clear(); // allow MapOverlay to do the wrap-up @@ -551,11 +557,11 @@ /// <summary> /// Draw the view to the specified point of the given surface. /// </summary> - public void draw(Surface target, Point pt) + public void Draw(Surface target, Point pt) { try { - updateScreen(); + UpdateScreen(); } catch //( COMException e ) { @@ -582,15 +588,15 @@ private void onSurfaceLost(object sender, EventArgs ea) { // reallocate the buffer - recreateDrawBuffer(size, true); + RecreateDrawBuffer(Size, true); } /// <summary> /// Obtains the image as a bitmap. /// </summary> - public Bitmap createBitmap() + public Bitmap CreateBitmap() { - updateScreen(); + UpdateScreen(); return drawContext.Surface.Bitmap; } @@ -609,7 +615,6 @@ // if(OnUpdated!=null) OnUpdated(this,null); // } - private static Color waterSurfaceDayColor = Color.FromArgb(0, 114, 188); private static Font drawFont = new Font("MS PGothic", 10); @@ -617,7 +622,6 @@ private static SolidBrush drawBrush1 = new SolidBrush(Color.Black); private static SolidBrush drawBrush2 = new SolidBrush(Color.White); - #region coordinates conversion methods /// <summary> /// Convert the client coordinates to the (A,B) coordinates. @@ -686,7 +690,7 @@ if (controller != null) { ILocationDisambiguator disambiguator = controller.Disambiguator; - for (int z = heightCutHeight; z >= 0; z--) + for (int z = HeightCutHeight; z >= 0; z--) { Location loc = new Location(x - z, y + z, z); if (disambiguator != null && disambiguator.IsSelectable(loc)) Modified: branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs =================================================================== --- branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -73,7 +73,7 @@ /// <param name="pt"></param> public void draw(QuarterViewDrawer drawer, Surface target, Point pt) { - drawer.draw(offscreenSurface, new Point(0, 0)); + drawer.Draw(offscreenSurface, new Point(0, 0)); for (int x = 0; x < canvasSize.Width; x += spriteSet.imageSize.Width) for (int y = 0; y < canvasSize.Height; y += spriteSet.imageSize.Height) spriteSet.overlayImages[currentFrame].draw(offscreenSurface, new Point(x, y)); Modified: branches/FreeTrainSDL/core/views/map/HeightCutWindow.cs =================================================================== --- branches/FreeTrainSDL/core/views/map/HeightCutWindow.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/core/views/map/HeightCutWindow.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -46,7 +46,7 @@ trackBar.Minimum = 0; trackBar.Maximum = World.WorldDefinition.World.Size.z - 1; - trackBar.Value = drawer.heightCutHeight; + trackBar.Value = drawer.HeightCutHeight; drawer.OnHeightCutChanged += new EventHandler(onHeightCutChange); } @@ -63,7 +63,7 @@ private void trackBar_Scroll(object sender, EventArgs e) { - drawer.heightCutHeight = trackBar.Value; + drawer.HeightCutHeight = trackBar.Value; } #region Windows Form Designer generated code private FreeTrain.Controls.TrackBarEx trackBar; @@ -113,7 +113,7 @@ private void onHeightCutChange(object sender, EventArgs e) { - trackBar.Value = drawer.heightCutHeight; + trackBar.Value = drawer.HeightCutHeight; } } Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs 2008-04-01 09:17:20 UTC (rev 304) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs 2008-04-01 09:38:50 UTC (rev 305) @@ -330,7 +330,7 @@ /// /// /// </summary> - public string name { get { return site.name; } } + public string Name { get { return site.Name; } } // can be overrided by a derived class to return another object. /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-01 18:31:15
|
Revision: 306 http://freetrain.svn.sourceforge.net/freetrain/?rev=306&view=rev Author: jendave Date: 2008-04-01 11:31:20 -0700 (Tue, 01 Apr 2008) Log Message: ----------- renames, Consolidated MainWindows Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs branches/FreeTrainSDL/core/contributions/others/EmptyNewGameContributionImpl.cs branches/FreeTrainSDL/core/contributions/train/ParamTrainImpl.cs branches/FreeTrainSDL/core/contributions/train/PatternTrainImpl.cs branches/FreeTrainSDL/core/contributions/train/ReverseTrainCarImpl.cs branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/controllers/land/LandController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs branches/FreeTrainSDL/core/controllers/rail/TrainControllerDialog.cs branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs branches/FreeTrainSDL/core/controllers/rail/TrainTrackingWindow.cs branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/controllers/road/RoadController.cs branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs branches/FreeTrainSDL/core/controllers/structs/FixedSizeStructController.cs branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/framework/BGMManager.cs branches/FreeTrainSDL/core/framework/BGMPlaylist.cs branches/FreeTrainSDL/core/framework/ConfigDialog.cs branches/FreeTrainSDL/core/framework/Core.cs branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs branches/FreeTrainSDL/core/framework/MainWindowMDI.cs branches/FreeTrainSDL/core/framework/ResourceUtil.cs branches/FreeTrainSDL/core/framework/graphics/PreviewDrawer.cs branches/FreeTrainSDL/core/framework/plugin/Contribution.cs branches/FreeTrainSDL/core/framework/plugin/PluginListDialog.cs branches/FreeTrainSDL/core/framework/plugin/PluginManager.cs branches/FreeTrainSDL/core/framework/plugin/PluginSerializationBinder.cs branches/FreeTrainSDL/core/framework/sound/SoundEffectManager.cs branches/FreeTrainSDL/core/views/AbstractView.cs branches/FreeTrainSDL/core/views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/views/WeatherOverlayImpl.cs branches/FreeTrainSDL/core/views/map/MapView.cs branches/FreeTrainSDL/core/world/Clock.cs branches/FreeTrainSDL/core/world/WorldDefinition.cs branches/FreeTrainSDL/core/world/accounting/AccountManager.cs branches/FreeTrainSDL/core/world/accounting/BalanceSheetForm.cs branches/FreeTrainSDL/core/world/development/DevelopConfigure.cs branches/FreeTrainSDL/core/world/development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/world/development/LandValueInspector.cs branches/FreeTrainSDL/core/world/rail/Platform.cs branches/FreeTrainSDL/core/world/rail/Station.cs branches/FreeTrainSDL/core/world/subsidiaries/MarketWindow.cs branches/FreeTrainSDL/core/world/terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Generic/CategoryTreeWnd.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigCommand.cs Removed Paths: ------------- branches/FreeTrainSDL/core/framework/MainWindow.cs branches/FreeTrainSDL/core/framework/MainWindow.resx Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/Program.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -101,7 +101,7 @@ private void MusicHasStopped() { - Core.bgmManager.nextSong(); + Core.BgmManager.nextSong(); } private void Quit(object sender, QuitEventArgs e) @@ -116,7 +116,7 @@ { if (qView != null) { - controller = MainWindow.mainWindow.CurrentController; + controller = MainWindowMDI.mainWindow.CurrentController; qView.UpdateScreen(); if (WorldDefinition.World.Satellite == null || WorldDefinition.World.Satellite.surface.w != 150 || @@ -150,7 +150,7 @@ private void MusicFinished(object sender, MusicFinishedEventArgs e) { - Core.bgmManager.nextSong(); + Core.BgmManager.nextSong(); } private void MouseButtonDown(object sender, MouseButtonEventArgs e) @@ -262,10 +262,16 @@ private void Go() { + + splashscreen = new Splash(); splashscreen.Show(); splashscreen.BringToFront(); splashscreen.Refresh(); + Core.Init(null, null, null, new ProgressHandler(UpdateMessage), true); + world = new WorldDefinition(new Distance(150, 150, 7), 3); + WorldDefinition.World = world; + mainWindowMDI = new MainWindowMDI(); timer = new System.Windows.Forms.Timer(); Events.KeyboardDown += new EventHandler<KeyboardEventArgs>(this.KeyDown); Events.MouseButtonDown += @@ -318,14 +324,11 @@ FinalDraw(); - MainWindow.mainWindow = new MainWindow(null, true); splashscreen.status.AppendText("Loading plugins..."); splashscreen.status.AppendText("\n"); splashscreen.Refresh(); FinalDraw(); - Core.init(null, null, null, new ProgressHandler(UpdateMessage), true); - world = new WorldDefinition(new Distance(150, 150, 7), 3); - WorldDefinition.World = world; + weatherOverlay = NullWeatherOverlay.theInstance; FinalDraw(); @@ -343,7 +346,7 @@ timer.Interval = 33; timer.Enabled = true; timer.Start(); - mainWindowMDI = new MainWindowMDI(); + mainWindowMDI.Show(); splashscreen.BringToFront(); splashscreen.Close(); Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-01 18:31:20 UTC (rev 306) @@ -463,9 +463,6 @@ <Compile Include="framework\graphics\SpriteLoaderContribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="framework\MainWindow.cs"> - <SubType>Form</SubType> - </Compile> <Compile Include="framework\MainWindowMDI.cs"> <SubType>Form</SubType> </Compile> @@ -956,10 +953,6 @@ <EmbeddedResource Include="framework\ErrorMessageBox.resx"> <DependentUpon>ErrorMessageBox.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="framework\MainWindow.resx"> - <DependentUpon>MainWindow.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> <EmbeddedResource Include="framework\MainWindowMDI.resx"> <SubType>Designer</SubType> <DependentUpon>MainWindowMDI.cs</DependentUpon> Modified: branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/contributions/common/FixedSizeStructureController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -62,8 +62,8 @@ { if (contrib.canBeBuilt(cube.corner, ControlMode.Player)) { - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else { @@ -156,8 +156,8 @@ PThreeDimStructure s = WorldDefinition.World.getEntityAt(cube.corner) as PThreeDimStructure; if (s == null || s.type != contrib) { - MainWindow.showError("Wrong type"); - //! MainWindow.showError("種類が違います"); + MessageBox.Show("Wrong type"); + //! MessageBox.Show("種類が違います"); return; } s.remove(); Modified: branches/FreeTrainSDL/core/contributions/others/EmptyNewGameContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/others/EmptyNewGameContributionImpl.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/contributions/others/EmptyNewGameContributionImpl.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -58,7 +58,7 @@ { using (NewWorldDialog dialog = new NewWorldDialog()) { - if (dialog.ShowDialog(MainWindow.mainWindow) == DialogResult.OK) + if (dialog.ShowDialog(MainWindowMDI.mainWindow) == DialogResult.OK) return dialog.createWorld(); else return null; Modified: branches/FreeTrainSDL/core/contributions/train/ParamTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/ParamTrainImpl.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/contributions/train/ParamTrainImpl.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -94,7 +94,7 @@ string idref = e.Attributes["carRef"].Value; if (id == null) throw new FormatException("carRef܂"); - TrainCarContribution contrib = (TrainCarContribution)Core.plugins.getContribution(idref); + TrainCarContribution contrib = (TrainCarContribution)Core.Plugins.getContribution(idref); if (contrib == null) throw new FormatException( string.Format("id='{0}'TrainCarRgr[V܂", idref)); Modified: branches/FreeTrainSDL/core/contributions/train/PatternTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/PatternTrainImpl.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/contributions/train/PatternTrainImpl.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -109,7 +109,7 @@ if (idref == null) throw new FormatException("ref attribute is missing"); //! if(idref==null) throw new FormatException("ref属性がありません"); - TrainCarContribution contrib = (TrainCarContribution)Core.plugins.getContribution(idref); + TrainCarContribution contrib = (TrainCarContribution)Core.Plugins.getContribution(idref); if (contrib == null) throw new FormatException( string.Format("id='{0}' is missing TrainCar contribution", idref)); //! string.Format( "id='{0}'のTrainCarコントリビューションがありません", idref )); Modified: branches/FreeTrainSDL/core/contributions/train/ReverseTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/contributions/train/ReverseTrainCarImpl.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/contributions/train/ReverseTrainCarImpl.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -56,7 +56,7 @@ /// </summary> protected internal override void onInitComplete() { - core = Core.plugins.getContribution(baseId) as TrainCarContribution; + core = Core.Plugins.getContribution(baseId) as TrainCarContribution; if (core == null) throw new FormatException("'" + id + "' refers to TrainCar contribution '" + baseId + "' that could not be found"); //! throw new FormatException("'"+id+"'が参照するTrainCarコントリビューション'"+baseId+"'が見つかりません"); Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerImpl.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -53,7 +53,7 @@ // Attach the control when activated. try { - MainWindow.mainWindow.AttachController(this); + MainWindowMDI.mainWindow.AttachController(this); } catch (NullReferenceException nre) { @@ -68,29 +68,39 @@ protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { // Detach it when it is closed. - if (MainWindow.mainWindow.CurrentController == this) - MainWindow.mainWindow.DetachController(); + if (MainWindowMDI.mainWindow.CurrentController == this) + { + MainWindowMDI.mainWindow.DetachController(); + } } - ///// <summary> - ///// - ///// </summary> - //public string Name { get { return Text; } } - /// <summary> /// /// </summary> - public virtual ILocationDisambiguator Disambiguator { get { return null; } } + public virtual ILocationDisambiguator Disambiguator + { + get + { + return null; + } + } /// <summary> /// /// </summary> - public virtual IMapOverlay Overlay { get { return this as IMapOverlay; } } + public virtual IMapOverlay Overlay + { + get + { + return this as IMapOverlay; + } + } /// <summary> /// /// </summary> - public virtual void OnAttached() { } + public virtual void OnAttached() + { } /// <summary> /// @@ -107,7 +117,9 @@ /// <param name="source"></param> /// <param name="loc"></param> /// <param name="ab"></param> - public virtual void OnClick(MapViewWindow source, Location loc, Point ab) { } + public virtual void OnClick(MapViewWindow source, Location loc, Point ab) + { } + /// <summary> /// /// @@ -115,7 +127,9 @@ /// <param name="view"></param> /// <param name="loc"></param> /// <param name="ab"></param> - public virtual void OnMouseMove(MapViewWindow view, Location loc, Point ab) { } + public virtual void OnMouseMove(MapViewWindow view, Location loc, Point ab) + { } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/controllers/land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/land/LandController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/land/LandController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -53,7 +53,7 @@ InitializeComponent(); // load list of lands - groupBox.DataSource = Core.plugins.landBuilderGroup; + groupBox.DataSource = Core.Plugins.landBuilderGroup; groupBox.DisplayMember = "name"; } /// <summary> Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -35,7 +35,6 @@ using FreeTrain.Views.Map; using FreeTrain.Controls; - namespace FreeTrain.Controllers.Rail { /// <summary> @@ -92,7 +91,7 @@ this.columnHeader6.Text = Translation.GetString("CONTROLLER_STATION_MAINTENANCE"); this.label4.Text = Translation.GetString("CONTROLLER_STATION_DIRECTION"); this.label5.Text = Translation.GetString("CONTROLLER_STATION_COLOUR"); - this.platformPage.Text = Translation.GetString("CONTROLLER_STATION_PLATFORM"); + this.platformPage.Text = Translation.GetString("CONTROLLER_STATION_PLATFORM"); this.checkSlim.Text = Translation.GetString("CONTROLLER_STATION_SLIMPLATFORM"); this.label1.Text = Translation.GetString("CONTROLLER_STATION_LENGTH"); this.Text = Translation.GetString("CONTROLLER_STATION_CONSTRUCTION"); @@ -121,7 +120,7 @@ dirW.Image = bitmapW; // load station type list - stationType.DataSource = Core.plugins.stationGroup; + stationType.DataSource = Core.Plugins.stationGroup; stationType.DisplayMember = "name"; updateAfterResize(null, null); @@ -312,7 +311,7 @@ { if (!selectedStation.canBeBuilt(loc, ControlMode.Player)) { - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); } else { @@ -331,7 +330,7 @@ { if (!FatPlatform.canBeBuilt(loc, direction, length)) { - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); return; } new FatPlatform(loc, direction, length); @@ -344,7 +343,7 @@ if (p.canRemove) p.remove(); else - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_REMOVE")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_REMOVE")); } } return; @@ -354,7 +353,7 @@ { if (!ThinPlatform.canBeBuilt(loc, direction, length)) { - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_BUILD")); return; } new ThinPlatform(loc, direction, length); @@ -367,7 +366,7 @@ if (p.canRemove) p.remove(); else - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_REMOVE")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_REMOVE")); } } return; @@ -484,10 +483,16 @@ { // Builds a new preview bitmap and set it to the picture box PreviewDrawer drawer; + if (selectedStation == null) + { + drawer = new PreviewDrawer(stationPicture.ClientSize, new Distance()); + } + else + { + drawer = new PreviewDrawer(stationPicture.ClientSize, selectedStation.size); + drawer.drawCenter(selectedStation.sprites); + } - drawer = new PreviewDrawer(stationPicture.ClientSize, selectedStation.size); - drawer.drawCenter(selectedStation.sprites); - if (stationPreviewBitmap != null) stationPreviewBitmap.Dispose(); stationPicture.Image = stationPreviewBitmap = drawer.createBitmap(); Modified: branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/PlatformPropertyDialog.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -324,16 +324,16 @@ if (fp.canRemoveLane(index)) fp.removeLane(index); else - MainWindow.showError("Could not be released due to an obstacle"); - //! MainWindow.showError("障害物があって解放できません"); + MessageBox.Show("Could not be released due to an obstacle"); + //! MessageBox.Show("障害物があって解放できません"); } else { if (fp.canAddLane(index)) fp.addLane(index); else - MainWindow.showError("Could not be connected due to an obstacle"); - //! MainWindow.showError("障害物があって接続できません"); + MessageBox.Show("Could not be connected due to an obstacle"); + //! MessageBox.Show("障害物があって接続できません"); } updateDialog(); } Modified: branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/RailRoadController.Designer.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -85,7 +85,7 @@ this.buttonPlace.Name = "buttonPlace"; this.buttonPlace.TabStop = true; this.buttonPlace.UseVisualStyleBackColor = false; - this.buttonPlace.CheckedChanged += new System.EventHandler(this.modeChanged); + this.buttonPlace.CheckedChanged += new System.EventHandler(this.ModeChanged); // // buttonRemove // @@ -93,7 +93,7 @@ this.buttonRemove.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(236))))); this.buttonRemove.Name = "buttonRemove"; this.buttonRemove.UseVisualStyleBackColor = false; - this.buttonRemove.CheckedChanged += new System.EventHandler(this.modeChanged); + this.buttonRemove.CheckedChanged += new System.EventHandler(this.ModeChanged); // // costBox // Modified: branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -59,10 +59,10 @@ /// <summary> /// Updates the message in the dialog box. /// </summary> - private void updateDialog() + private void UpdateDialog() { message.Text = anchor != unplaced ? - Translation.GetString("CONTROLLER_RAIL_END_POINT") : + Translation.GetString("CONTROLLER_RAIL_END_POINT") : Translation.GetString("CONTROLLER_RAIL_START_POINT"); } @@ -78,7 +78,13 @@ private static Location unplaced = FreeTrain.World.Location.Unplaced; - private bool isPlacing { get { return buttonPlace.Checked; } } + private bool IsPlacing + { + get + { + return buttonPlace.Checked; + } + } /// <summary> /// @@ -86,31 +92,35 @@ /// <param name="source"></param> /// <param name="loc"></param> /// <param name="ab"></param> - public override void OnClick(MapViewWindow source, Location loc, Point ab) + public override void OnClick(MapViewWindow source, Location location, Point ab) { if (anchor == unplaced) - { - anchor = loc; + { + anchor = location; sameLevelDisambiguator = new SameLevelDisambiguator(anchor.z); } else { - if (anchor != loc) + if (anchor != location) { - if (isPlacing) + if (IsPlacing) { // build new railroads. - if (!SingleRailRoad.Build(anchor, loc)) - MainWindow.showError(Translation.GetString("CONTROLLER_RAIL_OBSTACLES")); + if (!SingleRailRoad.Build(anchor, location)) + { + MessageBox.Show(Translation.GetString("CONTROLLER_RAIL_OBSTACLES"), "Error"); + } + } else + { // remove existing ones - SingleRailRoad.Remove(anchor, loc); + SingleRailRoad.Remove(anchor, location); + } } anchor = unplaced; } - - updateDialog(); + UpdateDialog(); } /// <summary> @@ -119,7 +129,7 @@ /// <param name="source"></param> /// <param name="loc"></param> /// <param name="ab"></param> - public override void OnRightClick(MapViewWindow source, Location loc, Point ab) + public override void OnRightClick(MapViewWindow source, Location location, Point ab) { if (anchor == unplaced) Close(); // cancel @@ -129,7 +139,7 @@ if (currentPosition != unplaced) WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); anchor = unplaced; - updateDialog(); + UpdateDialog(); } } @@ -139,23 +149,23 @@ /// <param name="view"></param> /// <param name="loc"></param> /// <param name="ab"></param> - public override void OnMouseMove(MapViewWindow view, Location loc, Point ab) + public override void OnMouseMove(MapViewWindow view, Location location, Point ab) { - if (anchor != unplaced && isPlacing && currentPosition != loc) + if (anchor != unplaced && IsPlacing && currentPosition != location) { // update the screen if (currentPosition != unplaced) WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); - currentPosition = loc; + currentPosition = location; WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); int cost; SingleRailRoad.ComputeRoute(anchor, currentPosition, out cost); costBox.cost = cost; } - if (anchor != unplaced && !isPlacing) + if (anchor != unplaced && !IsPlacing) { - costBox.cost = SingleRailRoad.CalcCostOfRemoving(anchor, loc); + costBox.cost = SingleRailRoad.CalcCostOfRemoving(anchor, location); } } @@ -183,10 +193,10 @@ private ILocationDisambiguator sameLevelDisambiguator; // "place" or "remove" button was clicked. reset the anchor - private void modeChanged(object sender, EventArgs e) + private void ModeChanged(object sender, EventArgs e) { anchor = unplaced; - updateDialog(); + UpdateDialog(); } /// <summary> @@ -196,7 +206,7 @@ /// <param name="canvas"></param> public void DrawBefore(QuarterViewDrawer view, DrawContext canvas) { - if (anchor != unplaced && isPlacing) + if (anchor != unplaced && IsPlacing) { int cost; canvas.Tag = SingleRailRoad.ComputeRoute(anchor, currentPosition, out cost); @@ -212,21 +222,21 @@ /// <param name="canvas"></param> /// <param name="loc"></param> /// <param name="pt"></param> - public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) + public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location location, Point point) { IDictionary dic = (IDictionary)canvas.Tag; if (dic != null) { - RailPattern rp = (RailPattern)dic[loc]; + RailPattern rp = (RailPattern)dic[location]; if (rp != null) { - for (int j = WorldDefinition.World.getGroundLevel(loc); j < loc.z; j++) + for (int j = WorldDefinition.World.getGroundLevel(location); j < location.z; j++) // TODO: ground level handling BridgePierVoxel.defaultSprite.drawAlpha( canvas.Surface, - view.fromXYZToClient(loc.x, loc.y, j)); + view.fromXYZToClient(location.x, location.y, j)); - rp.drawAlpha(canvas.Surface, pt); + rp.drawAlpha(canvas.Surface, point); } } } Modified: branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/SlopeRailRoadController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -303,8 +303,8 @@ if (SlopeRailRoad.canCreateSlope(loc, direction)) SlopeRailRoad.createSlope(loc, direction); else - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else { @@ -327,8 +327,8 @@ return; } } - MainWindow.showError("Can not remove"); - //! MainWindow.showError("撤去できません"); + MessageBox.Show("Can not remove"); + //! MessageBox.Show("撤去できません"); } } /// <summary> Modified: branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/StationPassagewayController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -247,8 +247,8 @@ if (isPlacing) { if (!createStair(loc, false)) - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else removeStair(loc); @@ -269,8 +269,8 @@ if (canBuildPassageway(anchor, loc)) buildPassageway(anchor, loc); else - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else { Modified: branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/StationaryStructPlacementController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -58,7 +58,7 @@ } #endregion - private StationaryStructPlacementController() : base(Core.plugins.railStationaryGroup) { } + private StationaryStructPlacementController() : base(Core.Plugins.railStationaryGroup) { } /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) Modified: branches/FreeTrainSDL/core/controllers/rail/TrainControllerDialog.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainControllerDialog.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/TrainControllerDialog.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -237,7 +237,7 @@ { // reset menu items newTCMenu.MenuItems.Clear(); - foreach (TrainControllerContribution contrib in Core.plugins.trainControllers) + foreach (TrainControllerContribution contrib in Core.Plugins.trainControllers) { MenuItem mi = new MenuItem(contrib.name); mi.Click += new EventHandler(new TCCreator(this, contrib).onMenuSelected); Modified: branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/TrainPlacementController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -219,7 +219,7 @@ } else { - MainWindow.showError(Translation.GetString("CONTROLLER_TRAIN_ALREADYPLACED")); + MessageBox.Show(Translation.GetString("CONTROLLER_TRAIN_ALREADYPLACED")); return; } } @@ -227,13 +227,13 @@ RailRoad rr = RailRoad.get(loc); if (rr == null) { - MainWindow.showError(Translation.GetString("CONTROLLER_TRAIN_CANNOTPLACE_NOTRACKS")); + MessageBox.Show(Translation.GetString("CONTROLLER_TRAIN_CANNOTPLACE_NOTRACKS")); return; } if (!tr.place(loc)) { - MainWindow.showError(Translation.GetString("CONSTRUCTION_CANNOT_PLACE")); + MessageBox.Show(Translation.GetString("CONSTRUCTION_CANNOT_PLACE")); } else playSound(); @@ -245,12 +245,12 @@ RailRoad rr = RailRoad.get(loc); if (rr == null) { - MainWindow.showError(Translation.GetString("CONTROLLER_TRAIN_NORAIL")); + MessageBox.Show(Translation.GetString("CONTROLLER_TRAIN_NORAIL")); return; } if (!(rr.Voxel.car is Train.TrainCar)) { - MainWindow.showError(Translation.GetString("CONTROLLER_TRAIN_NOCARS")); + MessageBox.Show(Translation.GetString("CONTROLLER_TRAIN_NOCARS")); return; } ((Train.TrainCar)rr.Voxel.car).parent.remove(); Modified: branches/FreeTrainSDL/core/controllers/rail/TrainTrackingWindow.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainTrackingWindow.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/TrainTrackingWindow.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -280,9 +280,9 @@ private void onMove() { //if( train.head.state.isUnplaced ) return; - //if( MainWindow.primaryMapView==null ) return; + //if( MainWindowMDI.primaryMapView==null ) return; - //MainWindow.primaryMapView.moveTo( train.head.state.asPlaced().location ); + //MainWindowMDI.primaryMapView.moveTo( train.head.state.asPlaced().location ); } } } Modified: branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -54,7 +54,7 @@ // organize trains into a tree IDictionary types = new SortedList(); - foreach (TrainContribution tc in Core.plugins.trains) + foreach (TrainContribution tc in Core.Plugins.trains) { IDictionary company = (IDictionary)types[tc.companyName]; if (company == null) Modified: branches/FreeTrainSDL/core/controllers/road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/road/RoadController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/road/RoadController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -185,7 +185,7 @@ private void makeContribTree() { - RoadContribution[] contribs = Core.plugins.roads; + RoadContribution[] contribs = Core.Plugins.roads; if (contribs.Length > 0) { currentContrib = contribs[0]; Modified: branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/structs/CommercialStructPlacementController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -57,7 +57,7 @@ } #endregion - private CommercialStructPlacementController() : base(Core.plugins.commercialStructureGroup) { } + private CommercialStructPlacementController() : base(Core.Plugins.commercialStructureGroup) { } /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) @@ -84,8 +84,8 @@ if (c.isOwned) c.remove(); else - MainWindow.showError("Can not remove"); - //! MainWindow.showError("撤去できません"); + MessageBox.Show("Can not remove"); + //! MessageBox.Show("撤去できません"); } } Modified: branches/FreeTrainSDL/core/controllers/structs/FixedSizeStructController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/FixedSizeStructController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/structs/FixedSizeStructController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -73,8 +73,8 @@ { if (!selectedType.canBeBuilt(loc, ControlMode.Player)) { - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else { Modified: branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/controllers/structs/VarHeightBuildingController.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -45,7 +45,7 @@ /// /// </summary> public VarHeightBuildingController() - : base(Core.plugins.varHeightBuildingsGroup) + : base(Core.Plugins.varHeightBuildingsGroup) { InitializeComponent(); buttonPlace.Top += 24; @@ -75,8 +75,8 @@ { if (!selectedType.canBeBuilt(loc, height)) { - MainWindow.showError("Can not build"); - //! MainWindow.showError("設置できません"); + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); } else { Modified: branches/FreeTrainSDL/core/framework/BGMManager.cs =================================================================== --- branches/FreeTrainSDL/core/framework/BGMManager.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/BGMManager.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -79,7 +79,7 @@ /// <param name="songname"></param> public void addSong(string songname) { - foreach (BGMContribution contrib in Core.plugins.bgms) + foreach (BGMContribution contrib in Core.Plugins.bgms) { if (contrib.name == songname) currentPlaylist.Add(contrib); } @@ -90,7 +90,7 @@ /// <param name="songname"></param> public void moveUp(string songname) { - foreach (BGMContribution contrib in Core.plugins.bgms) + foreach (BGMContribution contrib in Core.Plugins.bgms) { if (contrib.name == songname) { @@ -109,7 +109,7 @@ /// <param name="songname"></param> public void moveDown(string songname) { - foreach (BGMContribution contrib in Core.plugins.bgms) + foreach (BGMContribution contrib in Core.Plugins.bgms) { if (contrib.name == songname) { @@ -128,7 +128,7 @@ /// <param name="songname"></param> public void removeSong(string songname) { - foreach (BGMContribution contrib in Core.plugins.bgms) + foreach (BGMContribution contrib in Core.Plugins.bgms) { if (contrib.name == songname) { @@ -212,7 +212,7 @@ } catch (Exception e) { - MessageBox.Show(MainWindow.mainWindow, + MessageBox.Show(MainWindowMDI.mainWindow, "Can not play back\n" + e.StackTrace, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); //! "再生できません¥n"+e.StackTrace, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error ); } @@ -265,7 +265,7 @@ protected override void OnClick(EventArgs e) { using( OpenFileDialog ofd = new OpenFileDialog() ) { - if( ofd.ShowDialog(MainWindow.mainWindow)==DialogResult.OK ) + if( ofd.ShowDialog(MainWindowMDI.mainWindow)==DialogResult.OK ) owner.currentBGM = new TempBGMContribution(ofd.FileName); } } Modified: branches/FreeTrainSDL/core/framework/BGMPlaylist.cs =================================================================== --- branches/FreeTrainSDL/core/framework/BGMPlaylist.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/BGMPlaylist.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -51,20 +51,20 @@ private void cmdPlayPause_Click(object sender, EventArgs e) { - if (Core.bgmManager != null && lstCurrentPlaylist.Items.Count > 0) + if (Core.BgmManager != null && lstCurrentPlaylist.Items.Count > 0) { if (isPlaying) { cmdPlay.Text = "Play"; isPlaying = false; - Core.bgmManager.currentBGM = null; + Core.BgmManager.currentBGM = null; } else { if (lstCurrentPlaylist.SelectedItem == null) - Core.bgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.Items[0]; + Core.BgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.Items[0]; else - Core.bgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.SelectedItem; + Core.BgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.SelectedItem; isPlaying = true; cmdPlay.Text = "Pause"; } @@ -76,7 +76,7 @@ if (lstCurrentPlaylist.SelectedItem != null) { string selected = lstCurrentPlaylist.Text; - Core.bgmManager.removeSong(lstCurrentPlaylist.Text); + Core.BgmManager.removeSong(lstCurrentPlaylist.Text); refreshPlaylists(); lstBGMs.Text = selected; } @@ -87,7 +87,7 @@ if (lstBGMs.SelectedItem != null) { string selected = lstBGMs.Text; - Core.bgmManager.addSong(lstBGMs.Text); + Core.BgmManager.addSong(lstBGMs.Text); refreshPlaylists(); lstCurrentPlaylist.Text = selected; } @@ -97,9 +97,9 @@ { lstBGMs.Items.Clear(); lstCurrentPlaylist.Items.Clear(); - foreach (BGMContribution contrib in Core.plugins.bgms) - if (!Core.bgmManager.currentPlaylist.Contains(contrib)) lstBGMs.Items.Add(contrib); - foreach (BGMContribution contrib in Core.bgmManager.currentPlaylist) + foreach (BGMContribution contrib in Core.Plugins.bgms) + if (!Core.BgmManager.currentPlaylist.Contains(contrib)) lstBGMs.Items.Add(contrib); + foreach (BGMContribution contrib in Core.BgmManager.currentPlaylist) { lstCurrentPlaylist.Items.Add(contrib); /*if (Core.bgmManager.currentBGM == contrib) @@ -113,7 +113,7 @@ { if (lstBGMs.SelectedItem != null) { - Core.bgmManager.addSong(lstBGMs.Text); + Core.BgmManager.addSong(lstBGMs.Text); refreshPlaylists(); } } @@ -139,7 +139,7 @@ Brush textBrush = SystemBrushes.ControlText; Font drawFont = e.Font; - if (Core.bgmManager.currentBGM == lstCurrentPlaylist.Items[e.Index]) + if (Core.BgmManager.currentBGM == lstCurrentPlaylist.Items[e.Index]) { drawFont = new Font(drawFont.FontFamily, drawFont.Size, FontStyle.Bold); cmdPlay.Text = "Pause"; @@ -157,9 +157,9 @@ void lstCurrentPlaylist_DoubleClick(object sender, System.EventArgs e) { if (lstCurrentPlaylist.SelectedItem == null) - Core.bgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.Items[0]; + Core.BgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.Items[0]; else - Core.bgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.SelectedItem; + Core.BgmManager.currentBGM = (BGMContribution)lstCurrentPlaylist.SelectedItem; refreshPlaylists(); isPlaying = true; cmdPlay.Text = "Pause"; @@ -167,13 +167,13 @@ private void cmdNext_Click(object sender, EventArgs e) { - Core.bgmManager.nextSong(); + Core.BgmManager.nextSong(); refreshPlaylists(); } private void cmdPrev_Click(object sender, EventArgs e) { - Core.bgmManager.previousSong(); + Core.BgmManager.previousSong(); refreshPlaylists(); } @@ -182,7 +182,7 @@ if (lstCurrentPlaylist.SelectedItem != null) { string selected = lstCurrentPlaylist.Text; - Core.bgmManager.moveDown(lstCurrentPlaylist.Text); + Core.BgmManager.moveDown(lstCurrentPlaylist.Text); refreshPlaylists(); lstCurrentPlaylist.Text = selected; } @@ -193,7 +193,7 @@ if (lstCurrentPlaylist.SelectedItem != null) { string selected = lstCurrentPlaylist.Text; - Core.bgmManager.moveUp(lstCurrentPlaylist.Text); + Core.BgmManager.moveUp(lstCurrentPlaylist.Text); refreshPlaylists(); lstCurrentPlaylist.Text = selected; } Modified: branches/FreeTrainSDL/core/framework/ConfigDialog.cs =================================================================== --- branches/FreeTrainSDL/core/framework/ConfigDialog.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/ConfigDialog.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -51,7 +51,7 @@ /// <summary> /// /// </summary> - public ConfigDialog() : this(Core.options) { } + public ConfigDialog() : this(Core.Options) { } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/framework/Core.cs =================================================================== --- branches/FreeTrainSDL/core/framework/Core.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/Core.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -34,27 +34,15 @@ /// <summary> /// Entry point to other static instances in the FreeTrain framework. /// </summary> - public sealed class Core + public static class Core { - private Core() { } // no instantiation + //private Core() + //{ } // no instantiation - - ///// <summary> - ///// Registry key where the per-user application setting - ///// should be stored. - ///// </summary> - //public static RegistryKey userRegistry - //{ - // get - // { - // return Registry.CurrentUser.CreateSubKey(@"Software\FreeTrain"); - // } - //} - /// <summary> /// Installation directory of the FreeTrain framework. /// </summary> - public static string installationDirectory + public static string InstallationDirectory { get { @@ -69,17 +57,29 @@ /// <summary> Plug-ins. </summary> - public static readonly PluginManager plugins = new PluginManager(); + private static readonly PluginManager plugins = new PluginManager(); + public static PluginManager Plugins + { + get { return Core.plugins; } + } + + /// <summary> Global options. </summary> - public static readonly GlobalOptions options = new GlobalOptions().load(); + private static readonly GlobalOptions options = new GlobalOptions().load(); + public static GlobalOptions Options + { + get { return Core.options; } + } + + /// <summary> Game mode </summary> - public static bool isConstructionMode + public static bool IsConstructionMode { get { - return _isConstructionMode; + return isConstructionMode; } } @@ -87,21 +87,18 @@ /// Handles BGM playback. /// Should be instanciated by attaching the main window. /// </summary> - public static BGMManager bgmManager { get { return _bgmManager; } } + public static BGMManager BgmManager { get { return bgmManager; } } /// <summary> /// Handles SFX. /// Should be instanciated by attaching the main window. /// </summary> - public static SoundEffectManager soundEffectManager { get { return _soundEffectManager; } } + public static SoundEffectManager SoundEffectManager { get { return soundEffectManager; } } + private static SoundEffectManager soundEffectManager; + private static BGMManager bgmManager; + private static bool isConstructionMode; - private static SoundEffectManager _soundEffectManager; - private static BGMManager _bgmManager; - private static bool _isConstructionMode; - - - /// <summary> /// Initializes the framework. /// Should be called once and only once. @@ -113,15 +110,15 @@ /// <param name="constructionMode"></param> /// Receives initializtion progress report. Can be null. /// </param> - public static void init(string[] args, Control owner, MenuItem bgmMenuItem, ProgressHandler progressHandler, bool constructionMode) + public static void Init(string[] args, Control owner, MenuItem bgmMenuItem, ProgressHandler progressHandler, bool constructionMode) { - _isConstructionMode = constructionMode; + isConstructionMode = constructionMode; if (progressHandler == null) progressHandler = new ProgressHandler(silentProgressHandler); - if (owner != null) _soundEffectManager = new SoundEffectManager(owner); + if (owner != null) soundEffectManager = new SoundEffectManager(owner); if (args == null) { @@ -138,7 +135,7 @@ } //if (bgmMenuItem != null) _bgmManager = new BGMManager(bgmMenuItem); - _bgmManager = new BGMManager(); + bgmManager = new BGMManager(); } private static void silentProgressHandler(string msg, float progress) @@ -300,14 +297,14 @@ /// <returns></returns> public bool OnFinal(IDictionary errorPlugins, int totalErrorCount) { - DialogResult res = MessageBox.Show(MainWindow.mainWindow, @"Some plugins could not be loaded. + DialogResult res = MessageBox.Show(MainWindowMDI.mainWindow, @"Some plugins could not be loaded. Some functions may not be available and you might encounter errors. In the worst case, game data might be lost, so it is advised that you quit now. Do you want to quit FreeTrain now? * Contact plugin authors in the first place to resolve errors.", - //! DialogResult res = MessageBox.Show(MainWindow.mainWindow, @"正常に読み込めなかったプラグインがあります。 + //! DialogResult res = MessageBox.Show(MainWindowMDI.mainWindow, @"正常に読み込めなかったプラグインがあります。 //! 一部の機能が使えなかったり、プレイ中にエラーが発生するおそれがあります。 //! 最悪の場合ゲームデータを破壊する可能性もありますので、このまま終了することをお奨めします。 //! Modified: branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs =================================================================== --- branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/ExternToolsHelper.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -42,8 +42,8 @@ { if (initialized) Clear(); - if (MainWindow.mainWindow == null) - MainWindow.mainWindow = new MainWindow(plugindirs, false); + if (MainWindowMDI.mainWindow == null) + MainWindowMDI.mainWindow = new MainWindowMDI(); if (progressHandler == null) progressHandler = new ProgressHandler(SilentProgress); @@ -52,7 +52,7 @@ foreach (string subdir in Directory.GetDirectories(baseDir)) r.Add(Path.Combine(baseDir, subdir)); // load plug-ins - Core.plugins.init(r, progressHandler, errorHandler); + Core.Plugins.init(r, progressHandler, errorHandler); if (WorldDefinition.World == null) WorldDefinition.World = new WorldDefinition(new Distance(5, 5, 5), 0); initialized = true; Deleted: branches/FreeTrainSDL/core/framework/MainWindow.cs =================================================================== --- branches/FreeTrainSDL/core/framework/MainWindow.cs 2008-04-01 09:38:50 UTC (rev 305) +++ branches/FreeTrainSDL/core/framework/MainWindow.cs 2008-04-01 18:31:20 UTC (rev 306) @@ -1,144 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Diagnostics; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.IO; -using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Runtime.Serialization; -using System.Data; - -using FreeTrain.Contributions.Common; -using FreeTrain.Contributions.Rail; -using FreeTrain.Contributions.Road; -using FreeTrain.Contributions.Structs; -using FreeTrain.Contributions.Others; -using FreeTrain.Controls; -using FreeTrain.Controllers; -using FreeTrain.Controllers.Land; -using FreeTrain.Controllers.Rail; -using FreeTrain.Controllers.Road; -using FreeTrain.Controllers.Terrain; -using FreeTrain.Controllers.Structs; -using FreeTrain.Framework.Plugin; -using FreeTrain.Framework.Sound; -using FreeTrain.Framework.Graphics; -using FreeTrain.Views; -using FreeTrain.Views.Map; -using FreeTrain.World; -using FreeTrain.World.Accounting; -using FreeTrain.World.Rail; -using FreeTrain.Util; -using FreeTrain.Util.Command; - -namespace FreeTrain.Framework -{ - /// <summary> - /// MDI Container Window - /// </summary> - public class MainWindow : Form - { - //なぜか知らないが起動直後にセーブデータを読み込むと、 - //この画像ファイルがPictureManagerに登録されていないのでエラーになる。 - //このクラスでは使わないけど、ここで参照すれば、起動時には常に登録される。 - //"RailRoads.bmp"なんかはそんなことないのに不思議。 - public MainWindow(string[] args, bool constructionMode) - { - mainWindow = this; // set the instance to this field - } - - /// <summary> - /// アプリケーションのメイン エントリ ポイントです。 - /// </summary> - [STAThread] - static void Main() - { - Application.Run(mainWindow); - } - - ... [truncated message content] |
From: <je...@us...> - 2008-04-04 20:57:26
|
Revision: 346 http://freetrain.svn.sourceforge.net/freetrain/?rev=346&view=rev Author: jendave Date: 2008-04-04 13:57:33 -0700 (Fri, 04 Apr 2008) Log Message: ----------- beginnings of a "play" button in the ControlCenter window Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/Land/LandController.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs branches/FreeTrainSDL/core/Framework/Core.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx branches/FreeTrainSDL/core/Framework/Splash.Designer.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/World/WorldDefinition.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/Program.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -171,7 +171,6 @@ { dragMode = false; Mouse.MousePosition = new Point(oldX, oldY); - Mouse.ShowCursor = true; } @@ -182,7 +181,10 @@ Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); Location xyz = qView.fromABToXYZ(ab, controller); - if (e.Button == MouseButton.PrimaryButton) controller.OnClick(null, xyz, ab); + if (e.Button == MouseButton.PrimaryButton) + { + controller.OnClick(null, xyz, ab); + } } } lastMouseState = e.ButtonPressed; @@ -196,7 +198,6 @@ } else { - //gui.checkMouseMovement(e.EventStruct.motion); if (controller != null) { Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); @@ -262,8 +263,6 @@ private void Go() { - - splashscreen = new Splash(); splashscreen.Show(); splashscreen.BringToFront(); Modified: branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -144,7 +144,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public virtual void UpdatePreview() { } } } Modified: branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -59,7 +59,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { if (this.picture.Image != null) this.picture.Image.Dispose(); Modified: branches/FreeTrainSDL/core/Controllers/Land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -162,7 +162,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { LandBuilderContribution builder = (LandBuilderContribution)indexSelector.currentItem; using (PreviewDrawer drawer = builder.createPreview(preview.Size)) Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -58,7 +58,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { using (PreviewDrawer drawer = new PreviewDrawer(preview.Size, new Size(3, 3), 0)) { Modified: branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -504,7 +504,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { if (this.currentMode == Mode.Station) onStationChanged(null, null); Modified: branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -90,7 +90,7 @@ /// /// </summary> /// <param name="source"></param> - /// <param name="loc"></param> + /// <param name="location"></param> /// <param name="ab"></param> public override void OnClick(MapViewWindow source, Location location, Point ab) { @@ -127,17 +127,21 @@ /// /// </summary> /// <param name="source"></param> - /// <param name="loc"></param> + /// <param name="location"></param> /// <param name="ab"></param> public override void OnRightClick(MapViewWindow source, Location location, Point ab) { if (anchor == unplaced) + { Close(); // cancel + } else { // cancel the anchor if (currentPosition != unplaced) + { WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); + } anchor = unplaced; UpdateDialog(); } @@ -147,7 +151,7 @@ /// /// </summary> /// <param name="view"></param> - /// <param name="loc"></param> + /// <param name="location"></param> /// <param name="ab"></param> public override void OnMouseMove(MapViewWindow view, Location location, Point ab) { @@ -155,7 +159,9 @@ { // update the screen if (currentPosition != unplaced) + { WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); + } currentPosition = location; WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); @@ -172,6 +178,16 @@ /// <summary> /// /// </summary> + /// <param name="e"></param> + protected override void OnDeactivate(EventArgs e) + { + base.OnDeactivate(e); + anchor = unplaced; + } + + /// <summary> + /// + /// </summary> public override void OnDetached() { anchor = unplaced; @@ -185,8 +201,14 @@ get { // the 2nd selection must go to the same height as the anchor. - if (anchor == unplaced) return RailRoadDisambiguator.theInstance; - else return sameLevelDisambiguator; + if (anchor == unplaced) + { + return RailRoadDisambiguator.theInstance; + } + else + { + return sameLevelDisambiguator; + } } } @@ -211,7 +233,9 @@ int cost; canvas.Tag = SingleRailRoad.ComputeRoute(anchor, currentPosition, out cost); if (canvas.Tag != null) + { Debug.WriteLine(((IDictionary)canvas.Tag).Count); + } } } @@ -220,8 +244,8 @@ /// </summary> /// <param name="view"></param> /// <param name="canvas"></param> - /// <param name="loc"></param> - /// <param name="pt"></param> + /// <param name="location"></param> + /// <param name="point"></param> public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location location, Point point) { IDictionary dic = (IDictionary)canvas.Tag; @@ -231,10 +255,12 @@ if (rp != null) { for (int j = WorldDefinition.World.getGroundLevel(location); j < location.z; j++) + { // TODO: ground level handling BridgePierVoxel.defaultSprite.drawAlpha( canvas.Surface, view.fromXYZToClient(location.x, location.y, j)); + } rp.drawAlpha(canvas.Surface, point); } Modified: branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -59,7 +59,7 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { PreviewDrawer drawer; Modified: branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -323,11 +323,10 @@ /// <summary> /// /// </summary> - public void UpdatePreview() + public override void UpdatePreview() { - /*using( PreviewDrawer drawer = selectedType.createPreview(preview.Size) ) + /*using( PreviewDrawer drawer = selectedType.createPreview(preview.Size) ) { - if( previewBitmap!=null ) previewBitmap.Dispose(); preview.Image = previewBitmap = drawer.createBitmap(); }*/ Modified: branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -25,7 +25,9 @@ using System.Drawing; using System.Text; using System.Windows.Forms; + using FreeTrain.Contributions.Sound; +using FreeTrain.Controllers; namespace FreeTrain.Framework @@ -33,7 +35,7 @@ /// <summary> /// /// </summary> - public partial class BGMPlaylist : Form + public partial class BGMPlaylist : AbstractControllerImpl { private bool isPlaying = false; /// <summary> Modified: branches/FreeTrainSDL/core/Framework/Core.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -59,6 +59,9 @@ /// <summary> Plug-ins. </summary> private static readonly PluginManager plugins = new PluginManager(); + /// <summary> + /// + /// </summary> public static PluginManager Plugins { get { return Core.plugins; } @@ -68,6 +71,9 @@ /// <summary> Global options. </summary> private static readonly GlobalOptions options = new GlobalOptions().load(); + /// <summary> + /// + /// </summary> public static GlobalOptions Options { get { return Core.options; } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -102,6 +102,7 @@ this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); + this.playButton = new System.Windows.Forms.ToolStripButton(); this.menuStrip.SuspendLayout(); this.toolStrip.SuspendLayout(); this.statusStrip.SuspendLayout(); @@ -458,7 +459,8 @@ this.printToolStripButton, this.printPreviewToolStripButton, this.toolStripSeparator2, - this.helpToolStripButton}); + this.helpToolStripButton, + this.playButton}); this.toolStrip.Location = new System.Drawing.Point(0, 24); this.toolStrip.Name = "toolStrip"; this.toolStrip.Size = new System.Drawing.Size(525, 25); @@ -516,6 +518,7 @@ this.printPreviewToolStripButton.Name = "printPreviewToolStripButton"; this.printPreviewToolStripButton.Size = new System.Drawing.Size(23, 22); this.printPreviewToolStripButton.Text = "Print Preview"; + this.printPreviewToolStripButton.Click += new System.EventHandler(this.printPreviewToolStripButton_Click); // // toolStripSeparator2 // @@ -547,6 +550,16 @@ this.toolStripStatusLabel.Size = new System.Drawing.Size(38, 17); this.toolStripStatusLabel.Text = "Status"; // + // playButton + // + this.playButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.playButton.Image = ((System.Drawing.Image)(resources.GetObject("playButton.Image"))); + this.playButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.playButton.Name = "playButton"; + this.playButton.Size = new System.Drawing.Size(23, 22); + this.playButton.Text = "toolStripButton1"; + this.playButton.Click += new System.EventHandler(this.playButton_Click); + // // MainWindowMDI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -623,8 +636,15 @@ private System.Windows.Forms.ToolStripButton printPreviewToolStripButton; private System.Windows.Forms.ToolStripButton helpToolStripButton; private System.Windows.Forms.ToolTip ToolTip; + /// <summary> + /// + /// </summary> public System.Windows.Forms.StatusStrip statusStrip; + /// <summary> + /// + /// </summary> public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; + private System.Windows.Forms.ToolStripButton playButton; } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -118,9 +118,13 @@ public void AttachController(IModalController newHandler) { if (controller == newHandler) + { return; // already activated + } if (controller != null) + { DetachController(); // deactive the current handler first + } controller = newHandler; controller.OnAttached(); @@ -135,7 +139,10 @@ /// </summary> public void DetachController() { - if (controller == null) return; + if (controller == null) + { + return; + } controller.OnDetached(); controller = null; @@ -248,5 +255,15 @@ AboutDialog aboutDialog = new AboutDialog(); aboutDialog.ShowDialog(); } + + private void printPreviewToolStripButton_Click(object sender, EventArgs e) + { + + } + + private void playButton_Click(object sender, EventArgs e) + { + MainWindowMDI.mainWindow.DetachController(); + } } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx 2008-04-04 20:57:33 UTC (rev 346) @@ -399,6 +399,21 @@ wTF/EP4JaStxoteu5NMAAAAASUVORK5CYII= </value> </data> + <data name="playButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL + U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI + VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ + QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4 + /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9 + cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j + 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR + dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb + NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE + s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC +</value> + </data> <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> Modified: branches/FreeTrainSDL/core/Framework/Splash.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Splash.Designer.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/Framework/Splash.Designer.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -46,6 +46,9 @@ private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.ImageList imageList; private System.Windows.Forms.ProgressBar progressBar; + /// <summary> + /// + /// </summary> public TextBox status; private System.ComponentModel.IContainer components; Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-04 20:57:33 UTC (rev 346) @@ -859,8 +859,8 @@ <SubType>Code</SubType> </Compile> <Compile Include="World\WorldDefinition.cs" /> - <Content Include="..\plugins\system\Plugin.xml"> - <Link>Plugin.xml</Link> + <Content Include="..\plugins\system\plugin.xml"> + <Link>plugin.xml</Link> </Content> <Content Include="Contributions\readme.txt" /> <Content Include="Res\Arrows.bmp" /> Modified: branches/FreeTrainSDL/core/World/WorldDefinition.cs =================================================================== --- branches/FreeTrainSDL/core/World/WorldDefinition.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/core/World/WorldDefinition.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -761,7 +761,7 @@ /// <summary> /// /// </summary> - /// <param name="v"></param> + /// <param name="voxel"></param> public void OnVoxelUpdated(Voxel voxel) { OnVoxelUpdated(voxel.location); Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs 2008-04-01 19:37:35 UTC (rev 345) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs 2008-04-04 20:57:33 UTC (rev 346) @@ -41,7 +41,6 @@ /// Controller that allows the user to /// place/remove cars. /// </summary> - [CLSCompliant(false)] public class ControllerForm : AbstractControllerImpl { private System.Windows.Forms.Label label1; @@ -366,7 +365,7 @@ this.Controls.Add(this.price); this.Name = "ControllerForm"; this.Text = "Half-tile Construction"; - this.Resize += new System.EventHandler(this.updateSize); + this.Resize += new System.EventHandler(this.UpdateSize); ((System.ComponentModel.ISupportInitialize)(this.preview)).EndInit(); this.group.ResumeLayout(false); this.ResumeLayout(false); @@ -377,7 +376,7 @@ /// <summary> /// /// </summary> - public bool isPlacing + public bool IsPlacing { get { @@ -394,7 +393,6 @@ } } - private int currentColor { get @@ -431,7 +429,7 @@ #region Event Handlers private void onTypeChanged(object sender, System.EventArgs e) { - idxDesign.count = currentGroup.size; + idxDesign.count = currentGroup.Size; onDesignChanged(sender, e); } @@ -508,7 +506,7 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected virtual void updateSize(object sender, System.EventArgs e) + protected virtual void UpdateSize(object sender, System.EventArgs e) { UpdatePreview(); } @@ -518,8 +516,7 @@ /// <summary> /// Called when a selection of the structure has changed. /// </summary> - [CLSCompliant(false)] - public void UpdatePreview() + public override void UpdatePreview() { using (PreviewDrawer drawer = currentContrib.createPreview(preview.Size)) { @@ -528,15 +525,20 @@ } } - #region SubGroup private class SubGroup : object { - public readonly string name; + private readonly string name; + + public string Name + { + get { return name; } + } + private ArrayList arr; - public SubGroup(string _name) + public SubGroup(string name) { - name = _name; + this.name = name; arr = new ArrayList(); } @@ -545,7 +547,7 @@ arr.Add(contrib); } - public int size + public int Size { get { return arr.Count; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-07 21:05:36
|
Revision: 347 http://freetrain.svn.sourceforge.net/freetrain/?rev=347&view=rev Author: jendave Date: 2008-04-07 14:05:40 -0700 (Mon, 07 Apr 2008) Log Message: ----------- rename methods and cleanup Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs branches/FreeTrainSDL/core/Controllers/Disambiguators.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainTrackingWindow.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx branches/FreeTrainSDL/core/Framework/ResourceUtil.cs branches/FreeTrainSDL/core/Framework/Sound/RepeatableSoundEffectImpl.cs branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs branches/FreeTrainSDL/core/Views/Map/MapView.cs branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs branches/FreeTrainSDL/core/World/Accounting/Debt.cs branches/FreeTrainSDL/core/World/Accounting/TransactionHistory.cs branches/FreeTrainSDL/core/World/Clock.cs branches/FreeTrainSDL/core/World/Cube.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/LandValue.cs branches/FreeTrainSDL/core/World/Development/ULV.cs branches/FreeTrainSDL/core/World/Land/LandVoxel.cs branches/FreeTrainSDL/core/World/RRCrossing.cs branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/Station.cs branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs branches/FreeTrainSDL/core/World/Rail/Train.cs branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs branches/FreeTrainSDL/core/World/Structs/Commercial.cs branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/StationListenerImpl.cs branches/FreeTrainSDL/core/World/Structs/Structure.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryCompany.cs branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryMarket.cs branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs branches/FreeTrainSDL/core/World/TimeLength.cs branches/FreeTrainSDL/core/World/Voxel.cs branches/FreeTrainSDL/core/World/WorldDefinition.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/Program.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -212,8 +212,8 @@ { if (qView != null) { - WorldDefinition.World.clock.tick(); - WorldDefinition.World.clock.tick(); + WorldDefinition.World.Clock.tick(); + WorldDefinition.World.Clock.tick(); sourceRect = new Sdl.SDL_Rect((short)ScrollPosition.X, (short)ScrollPosition.Y, (short)width, (short)height); dst = new Sdl.SDL_Rect(0, 0, (short)width, (short)height); @@ -227,7 +227,7 @@ { if (mainWindowMDI != null && WorldDefinition.World != null) { - mainWindowMDI.toolStripStatusLabel.Text = WorldDefinition.World.clock.displayString; + mainWindowMDI.toolStripStatusLabel.Text = WorldDefinition.World.Clock.displayString; } screen.Update(); } Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -153,7 +153,7 @@ /// <param name="cube"></param> protected override void onSelected(Cube cube) { - PThreeDimStructure s = WorldDefinition.World.getEntityAt(cube.corner) as PThreeDimStructure; + PThreeDimStructure s = WorldDefinition.World.GetEntityAt(cube.corner) as PThreeDimStructure; if (s == null || s.type != contrib) { MessageBox.Show("Wrong type"); Modified: branches/FreeTrainSDL/core/Controllers/Disambiguators.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Disambiguators.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Disambiguators.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -47,7 +47,7 @@ if (RailRoad.get(loc) != null) return true; // or if we hit the ground - if (WorldDefinition.World.getGroundLevel(loc) >= loc.z) return true; + if (WorldDefinition.World.GetGroundLevel(loc) >= loc.z) return true; return false; } @@ -71,7 +71,7 @@ /// <returns></returns> public bool IsSelectable(Location loc) { - return loc.z == WorldDefinition.World.getGroundLevel(loc); + return loc.z == WorldDefinition.World.GetGroundLevel(loc); } } Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -244,7 +244,7 @@ if (v == null) { // buy it - AccountGenre.Subsidiaries.Spend(WorldDefinition.World.landValue[new Location(x, y, z)]); + AccountGenre.Subsidiaries.Spend(WorldDefinition.World.LandValue[new Location(x, y, z)]); new LandPropertyVoxel(new Location(x, y, z)); } } @@ -277,7 +277,7 @@ if (v == null) // cost for the land - r += WorldDefinition.World.landValue[new Location(x, y, z)]; + r += WorldDefinition.World.LandValue[new Location(x, y, z)]; } } return r; Modified: branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -254,7 +254,7 @@ RailPattern rp = (RailPattern)dic[location]; if (rp != null) { - for (int j = WorldDefinition.World.getGroundLevel(location); j < location.z; j++) + for (int j = WorldDefinition.World.GetGroundLevel(location); j < location.z; j++) { // TODO: ground level handling BridgePierVoxel.defaultSprite.drawAlpha( Modified: branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -361,7 +361,7 @@ else { // it is always allowed to place it on or under ground - if (WorldDefinition.World.getGroundLevel(loc) >= loc.z) + if (WorldDefinition.World.GetGroundLevel(loc) >= loc.z) return true; // if the new rail road is at the edge of existing rail, @@ -454,7 +454,7 @@ { if (i == 2) loc.z++; - for (int j = WorldDefinition.World.getGroundLevel(loc); j < Z; j++) + for (int j = WorldDefinition.World.GetGroundLevel(loc); j < Z; j++) // TODO: ground level handling BridgePierVoxel.defaultSprite.drawAlpha( canvas, view.fromXYZToClient(loc.x, loc.y, j)); Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -69,7 +69,7 @@ // refresh the list list.BeginUpdate(); list.Items.Clear(); - foreach (TrainController tc in WorldDefinition.World.trainControllers) + foreach (TrainController tc in WorldDefinition.World.TrainControllers) { if (tc.contribution == null) continue; // those are system controllers list.Items.Add(createListViewItem(tc)); @@ -276,7 +276,7 @@ TrainController tc = contrib.newController( string.Format("New diagram{0}", iota++)); //! string.Format("新しいダイヤグラム{0}",iota++)); - WorldDefinition.World.trainControllers.add(tc); + WorldDefinition.World.TrainControllers.add(tc); // update GUI list.Items.Add(createListViewItem(tc)); @@ -302,7 +302,7 @@ { // update data structure // TODO: what will happen to trains that are controlled by this train controller? - WorldDefinition.World.trainControllers.remove(selectedItem); + WorldDefinition.World.TrainControllers.remove(selectedItem); // update GUI list.Items.Remove(list.SelectedItems[0]); Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -66,7 +66,7 @@ this.label1.Text = Translation.GetString("CONTROLLER_TRAIN_NAME"); this.Text = Translation.GetString("CONTROLLER_TRAIN_PLACE"); - controllerCombo.DataSource = WorldDefinition.World.trainControllers; + controllerCombo.DataSource = WorldDefinition.World.TrainControllers; tree.ItemMoved = new ItemMovedHandler(onItemDropped); //this.FormBorderStyle = FormBorderStyle.SizableToolWindow; @@ -99,9 +99,9 @@ tree.BeginUpdate(); tree.Nodes.Clear(); - TreeNode root = createNode(WorldDefinition.World.rootTrainGroup); + TreeNode root = createNode(WorldDefinition.World.RootTrainGroup); tree.Nodes.Add(root); - populate(WorldDefinition.World.rootTrainGroup, root.Nodes); + populate(WorldDefinition.World.RootTrainGroup, root.Nodes); tree.ExpandAll(); tree.EndUpdate(); Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainTrackingWindow.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainTrackingWindow.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainTrackingWindow.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -229,7 +229,7 @@ private void buttonSelect_Click(object sender, EventArgs e) { ContextMenu m = new ContextMenu(); - populateMenu(m.MenuItems, WorldDefinition.World.rootTrainGroup); + populateMenu(m.MenuItems, WorldDefinition.World.RootTrainGroup); m.Show(buttonSelect, new Point(0, buttonSelect.Height)); } Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -44,13 +44,13 @@ { InitializeComponent(); //handler = new OptionChangedHandler(updatePreview); - WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(updatePreview); + WorldDefinition.World.ViewOptions.OnViewOptionChanged += new OptionChangedHandler(updatePreview); Bitmap bmp = ResourceUtil.LoadSystemBitmap("DayNight.bmp"); buttonImages.TransparentColor = bmp.GetPixel(0, 0); buttonImages.Images.AddStrip(bmp); - tbDay.Pushed = (WorldDefinition.World.viewOptions.nightSpriteMode == NightSpriteMode.AlwaysDay); - tbNight.Pushed = (WorldDefinition.World.viewOptions.nightSpriteMode == NightSpriteMode.AlwaysNight); + tbDay.Pushed = (WorldDefinition.World.ViewOptions.nightSpriteMode == NightSpriteMode.AlwaysDay); + tbNight.Pushed = (WorldDefinition.World.ViewOptions.nightSpriteMode == NightSpriteMode.AlwaysNight); // organize trains into a tree IDictionary types = new SortedList(); @@ -215,7 +215,7 @@ { // buy trains for (int i = 0; i < (int)count.Value; i++) - new Train(WorldDefinition.World.rootTrainGroup, + new Train(WorldDefinition.World.RootTrainGroup, (int)length.Value, selectedTrain); FreeTrain.Framework.Sound.SoundEffectManager @@ -234,9 +234,9 @@ if (e.Button == tb) { if (tb.Pushed) - WorldDefinition.World.viewOptions.nightSpriteMode = (NightSpriteMode)tb.Tag; + WorldDefinition.World.ViewOptions.nightSpriteMode = (NightSpriteMode)tb.Tag; else - WorldDefinition.World.viewOptions.nightSpriteMode = NightSpriteMode.AlignClock; + WorldDefinition.World.ViewOptions.nightSpriteMode = NightSpriteMode.AlignClock; } else { @@ -247,7 +247,7 @@ private void TrainTradingDialog_Closed(object sender, System.EventArgs e) { - WorldDefinition.World.viewOptions.OnViewOptionChanged -= new OptionChangedHandler(updatePreview); + WorldDefinition.World.ViewOptions.OnViewOptionChanged -= new OptionChangedHandler(updatePreview); } void TrainTradingDialogLoad(object sender, EventArgs e) Modified: branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -64,7 +64,7 @@ protected StructPlacementController(StructureGroupGroup groupGroup) { InitializeComponent(); - WorldDefinition.World.viewOptions.OnViewOptionChanged += new OptionChangedHandler(UpdatePreview); + WorldDefinition.World.ViewOptions.OnViewOptionChanged += new OptionChangedHandler(UpdatePreview); previewBitmap = null; // load station type list structType.DataSource = groupGroup; @@ -77,7 +77,7 @@ /// <param name="disposing"></param> protected override void Dispose(bool disposing) { - WorldDefinition.World.viewOptions.OnViewOptionChanged -= new OptionChangedHandler(UpdatePreview); + WorldDefinition.World.ViewOptions.OnViewOptionChanged -= new OptionChangedHandler(UpdatePreview); if (disposing && components != null) components.Dispose(); base.Dispose(disposing); Modified: branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -180,7 +180,7 @@ Voxel baseVoxel = w[loc]; - int glevel = w.getGroundLevel(loc); + int glevel = w.GetGroundLevel(loc); if (loc.z != glevel) return false; //mountain can be placed only at the ground level @@ -194,12 +194,12 @@ Location l = new Location(loc.x + x, loc.y + y, loc.z); Direction d = Direction.get(1 - x * 2, -y * 2 - 1); // corner to modify - if (w.isOutsideWorld(l)) + if (w.IsOutsideWorld(l)) continue; // it's OK if it's beyond the border Voxel v = w[l]; - if (glevel != w.getGroundLevel(l)) + if (glevel != w.GetGroundLevel(l)) return false; // different ground level if (v == null) @@ -220,7 +220,7 @@ } } - if (WorldDefinition.World.isOutsideWorld(loc)) + if (WorldDefinition.World.IsOutsideWorld(loc)) return false; return true; @@ -288,7 +288,7 @@ } else { - int glevel = world.getGroundLevel(loc); + int glevel = world.GetGroundLevel(loc); if (glevel != loc.z && glevel != loc.z - 1) return false; if (loc.z == 0) @@ -315,7 +315,7 @@ } } - if (WorldDefinition.World.isOutsideWorld(loc)) + if (WorldDefinition.World.IsOutsideWorld(loc)) return false; return true; Modified: branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -91,7 +91,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - int idx = (WorldDefinition.World.viewOptions.useNightView) ? 1 : 0; + int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; surface.bltColorTransform(pt, picture.surface, origin, size, srcColors[idx], dstColors[idx], false); } Modified: branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -67,7 +67,7 @@ pt.X -= offset.X; pt.Y -= offset.Y; - int idx = (WorldDefinition.World.viewOptions.useNightView) ? 1 : 0; + int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; surface.bltHueTransform(pt, picture.surface, origin, size, RedTarget, GreenTarget, BlueTarget); Modified: branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -228,8 +228,8 @@ { WorldDefinition world = WorldDefinition.World; // reload the surface - Clock c = world.clock; - loaders[(int)c.season, (world.viewOptions.useNightView) ? 1 : 0].Load(ref _surface); + Clock c = world.Clock; + loaders[(int)c.season, (world.ViewOptions.useNightView) ? 1 : 0].Load(ref _surface); //_surface.sourceColorKey = key; dirty = false; } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -99,10 +99,11 @@ this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.helpToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.playButton = new System.Windows.Forms.ToolStripButton(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.playButton = new System.Windows.Forms.ToolStripButton(); + this.pauseButton = new System.Windows.Forms.ToolStripButton(); this.menuStrip.SuspendLayout(); this.toolStrip.SuspendLayout(); this.statusStrip.SuspendLayout(); @@ -460,7 +461,8 @@ this.printPreviewToolStripButton, this.toolStripSeparator2, this.helpToolStripButton, - this.playButton}); + this.playButton, + this.pauseButton}); this.toolStrip.Location = new System.Drawing.Point(0, 24); this.toolStrip.Name = "toolStrip"; this.toolStrip.Size = new System.Drawing.Size(525, 25); @@ -534,6 +536,16 @@ this.helpToolStripButton.Size = new System.Drawing.Size(23, 22); this.helpToolStripButton.Text = "Help"; // + // playButton + // + this.playButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.playButton.Image = ((System.Drawing.Image)(resources.GetObject("playButton.Image"))); + this.playButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.playButton.Name = "playButton"; + this.playButton.Size = new System.Drawing.Size(23, 22); + this.playButton.Text = "Play"; + this.playButton.Click += new System.EventHandler(this.playButton_Click); + // // statusStrip // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -550,15 +562,15 @@ this.toolStripStatusLabel.Size = new System.Drawing.Size(38, 17); this.toolStripStatusLabel.Text = "Status"; // - // playButton + // pauseButton // - this.playButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.playButton.Image = ((System.Drawing.Image)(resources.GetObject("playButton.Image"))); - this.playButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.playButton.Name = "playButton"; - this.playButton.Size = new System.Drawing.Size(23, 22); - this.playButton.Text = "toolStripButton1"; - this.playButton.Click += new System.EventHandler(this.playButton_Click); + this.pauseButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); + this.pauseButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.pauseButton.Name = "pauseButton"; + this.pauseButton.Size = new System.Drawing.Size(23, 22); + this.pauseButton.Text = "Pause"; + this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click); // // MainWindowMDI // @@ -645,6 +657,7 @@ /// </summary> public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; private System.Windows.Forms.ToolStripButton playButton; + private System.Windows.Forms.ToolStripButton pauseButton; } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -265,5 +265,11 @@ { MainWindowMDI.mainWindow.DetachController(); } + + private void pauseButton_Click(object sender, EventArgs e) + { + //MainWindowMDI.mainWindow.CurrentController = MainWindowMDI.mainWindow.br + //MainWindowMDI.mainWindow.AttachController(MainWindowMDI.mainWindow.CurrentController); + } } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx 2008-04-07 21:05:40 UTC (rev 347) @@ -414,6 +414,21 @@ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC </value> </data> + <data name="pauseButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL + U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI + VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ + QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4 + /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9 + cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j + 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR + dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb + NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE + s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC +</value> + </data> <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> Modified: branches/FreeTrainSDL/core/Framework/ResourceUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/ResourceUtil.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/ResourceUtil.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -182,7 +182,7 @@ /// <returns></returns> public static ISprite getGroundChip(WorldDefinition w) { - if (w.clock.season != Season.Winter) + if (w.Clock.season != Season.Winter) return groundChips[0]; else return groundChips[1]; Modified: branches/FreeTrainSDL/core/Framework/Sound/RepeatableSoundEffectImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Sound/RepeatableSoundEffectImpl.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Framework/Sound/RepeatableSoundEffectImpl.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -92,7 +92,7 @@ /*if( countOverlap()+queue < concurrentPlaybackMax )*/ if (queue++ == 0) - WorldDefinition.World.clock.endOfTurnHandlers += new EventHandler(onTurnEnd); + WorldDefinition.World.Clock.endOfTurnHandlers += new EventHandler(onTurnEnd); } // called at the end of turn Modified: branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs =================================================================== --- branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -98,7 +98,7 @@ get { if (nightSpriteMode == NightSpriteMode.AlignClock) - return WorldDefinition.World.clock.dayOrNight == DayNight.Night; + return WorldDefinition.World.Clock.dayOrNight == DayNight.Night; else return nightSpriteMode == NightSpriteMode.AlwaysNight; } Modified: branches/FreeTrainSDL/core/Views/Map/MapView.cs =================================================================== --- branches/FreeTrainSDL/core/Views/Map/MapView.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Views/Map/MapView.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -478,7 +478,7 @@ } else { - int h = height - WorldDefinition.World.waterLevel; + int h = height - WorldDefinition.World.WaterLevel; if (h == 0) this.Text = "Water level"; //! if( h==0 ) this.Text = "地表"; else this.Text = h.ToString(); Modified: branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -292,7 +292,7 @@ public bool IsVisible(Location loc) { // find the bounding box in (A,B) axes - return WorldDefinition.World.getBoundingBox(loc).IntersectsWith(this.visibleRect); + return WorldDefinition.World.GetBoundingBox(loc).IntersectsWith(this.visibleRect); } /// <summary> @@ -317,7 +317,7 @@ /// <param name="loc"></param> public void OnUpdateVoxel(Location loc) { - Rectangle boundingBox = world.getBoundingBox(loc); + Rectangle boundingBox = world.GetBoundingBox(loc); if (boundingBox.IntersectsWith(this.visibleRect)) { dirtyRect.add(boundingBox); @@ -384,11 +384,11 @@ // the same rectangle in the client coordinates Rectangle rectClient = fromABToClient(rectAB); - int waterLevel = world.waterLevel; + int waterLevel = world.WaterLevel; bool noHeightCut = (HeightCutHeight == world.Size.z - 1); Color waterSurfaceColor = waterSurfaceDayColor; - if (world.viewOptions.useNightView) + if (world.ViewOptions.useNightView) waterSurfaceColor = ColorMap.getNightColor(waterSurfaceColor); rectAB.Inflate(20, 20); Modified: branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -60,9 +60,9 @@ { if (_history == null) { - _history = (TransactionHistory)WorldDefinition.World.otherObjects[this]; + _history = (TransactionHistory)WorldDefinition.World.OtherObjects[this]; if (_history == null) - WorldDefinition.World.otherObjects.Add(this, _history = new TransactionHistory()); + WorldDefinition.World.OtherObjects.Add(this, _history = new TransactionHistory()); } return _history; Modified: branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -53,7 +53,7 @@ { get { - return WorldDefinition.World.account; + return WorldDefinition.World.Account; } } Modified: branches/FreeTrainSDL/core/World/Accounting/Debt.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/Debt.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Accounting/Debt.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -41,7 +41,7 @@ this.genre = genre; manager.addDebt(this); - WorldDefinition.World.clock.registerOneShot(new ClockHandler(onDue), span); + WorldDefinition.World.Clock.registerOneShot(new ClockHandler(onDue), span); } @@ -57,7 +57,7 @@ /// <summary> TimeLength before the due date </summary> public TimeLength span { - get { return due - WorldDefinition.World.clock; } + get { return due - WorldDefinition.World.Clock; } } /// <summary> @@ -70,6 +70,6 @@ manager.removeDebt(this); } - private AccountManager manager { get { return WorldDefinition.World.account; } } + private AccountManager manager { get { return WorldDefinition.World.Account; } } } } Modified: branches/FreeTrainSDL/core/World/Accounting/TransactionHistory.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/TransactionHistory.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Accounting/TransactionHistory.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -54,7 +54,7 @@ private long _dayTotal; private long _monthTotal; private long _yearTotal; - private readonly Clock clock = WorldDefinition.World.clock; + private readonly Clock clock = WorldDefinition.World.Clock; internal Recorder() { Modified: branches/FreeTrainSDL/core/World/Clock.cs =================================================================== --- branches/FreeTrainSDL/core/World/Clock.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Clock.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -119,7 +119,7 @@ /// </summary> public void registerOneShot(ClockHandler handler, Time time) { - registerOneShot(handler, time - WorldDefinition.World.clock); + registerOneShot(handler, time - WorldDefinition.World.Clock); } Modified: branches/FreeTrainSDL/core/World/Cube.cs =================================================================== --- branches/FreeTrainSDL/core/World/Cube.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Cube.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -181,7 +181,7 @@ { for (int y = y1; y < my; y++) { - if (WorldDefinition.World.getGroundLevel(x, y) != z1) + if (WorldDefinition.World.GetGroundLevel(x, y) != z1) return false; if (WorldDefinition.World[x, y, z1] is MountainVoxel) return false; Modified: branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -151,10 +151,10 @@ /// </summary> private void doClock() { - Clock c = WorldDefinition.World.clock; + Clock c = WorldDefinition.World.Clock; if (c.hour == 0) { - foreach (Station s in WorldDefinition.World.stations) + foreach (Station s in WorldDefinition.World.Stations) { if (s.ScoreTrains > 0) { @@ -266,10 +266,10 @@ { if (strength <= 0) break; - Clock c = WorldDefinition.World.clock; + Clock c = WorldDefinition.World.Clock; if (c.hour < vie) scaning = pickPlace(4); - if (scaning != Location.Unplaced && WorldDefinition.World.isInsideWorld(scaning)) + if (scaning != Location.Unplaced && WorldDefinition.World.IsInsideWorld(scaning)) phase++; else strength += strength * (1 - F_StrDiffuse) / 7; @@ -277,8 +277,8 @@ break; case Phase.SelectStruct1: { - Debug.Assert(WorldDefinition.World.isInsideWorld(scaning)); - int minVal = (int)(WorldDefinition.World.landValue[scaning] * F_LandPriceScale); + Debug.Assert(WorldDefinition.World.IsInsideWorld(scaning)); + int minVal = (int)(WorldDefinition.World.LandValue[scaning] * F_LandPriceScale); int maxVal = Math.Max(minVal + 15, (int)(minVal * 1.2)); //maxVal = Math.Max(maxVal,(int)Math.Pow(strength,F_MaxPricePower)); Debug.WriteLine(string.Format("target price: {0} to {1}", minVal, maxVal), "devalgo"); @@ -322,7 +322,7 @@ { //bool OK = true; - if (WorldDefinition.World.isOutsideWorld(plan.cube) || !plan.cube.isOnGround) + if (WorldDefinition.World.IsOutsideWorld(plan.cube) || !plan.cube.isOnGround) { phase = Phase.Start; break; @@ -330,7 +330,7 @@ IEntity[] es = plan.cube.getEntities(); foreach (IEntity e in es) { - if (!IsReplaceable(e, WorldDefinition.World.landValue[scaning])) + if (!IsReplaceable(e, WorldDefinition.World.LandValue[scaning])) { strength += (int)Math.Pow(plan.value, 1.0 / F_MaxPricePower); phase = Phase.Start; @@ -417,10 +417,10 @@ // then randomly pick nearby voxel loc.x = Rand(loc.x, amp); loc.y = Rand(loc.y, amp); - loc.z = w.getGroundLevel(loc); - if (w.isOutsideWorld(loc)) + loc.z = w.GetGroundLevel(loc); + if (w.IsOutsideWorld(loc)) continue; - if (loc.z < w.waterLevel) continue;// below water + if (loc.z < w.WaterLevel) continue;// below water Voxel v = w[loc]; if (v != null) { Modified: branches/FreeTrainSDL/core/World/Development/LandValue.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/LandValue.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Development/LandValue.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -44,7 +44,7 @@ /// <param name="w"></param> public LandValue(WorldDefinition w) { - w.otherObjects["{51CD7E24-4296-4043-B58D-A654AB71F121}"] = this; + w.OtherObjects["{51CD7E24-4296-4043-B58D-A654AB71F121}"] = this; H = w.Size.x; V = w.Size.y; @@ -59,7 +59,7 @@ // register the event notification so that we can update rho correctly w.onVoxelChanged += new VoxelChangeListener(updateRho); - w.clock.registerRepeated(new ClockHandler(next), TimeLength.fromHours(UPDATE_FREQUENCY)); + w.Clock.registerRepeated(new ClockHandler(next), TimeLength.fromHours(UPDATE_FREQUENCY)); } /// <summary> "tempratures" for each (h,v) </summary> @@ -210,7 +210,7 @@ hasMountain = true; } - bool hasSea = WorldDefinition.World.getGroundLevelFromHV(h, v) < WorldDefinition.World.waterLevel; + bool hasSea = WorldDefinition.World.getGroundLevelFromHV(h, v) < WorldDefinition.World.WaterLevel; if (roadFound != null) { Modified: branches/FreeTrainSDL/core/World/Development/ULV.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -77,14 +77,14 @@ WorldDefinition world = WorldDefinition.World; Set s = new Set(); - if (z < world.waterLevel) return null; // underwater + if (z < world.WaterLevel) return null; // underwater for (int x = cube.x1; x < mx; x++) { for (int y = cube.y1; y < my; y++) { - if (world.getGroundLevel(x, y) != z) + if (world.GetGroundLevel(x, y) != z) return null; // not on the ground Voxel v = world[x, y, z]; @@ -101,7 +101,7 @@ } } - landValue += world.landValue[new Location(x, y, z)]; + landValue += world.LandValue[new Location(x, y, z)]; } } Modified: branches/FreeTrainSDL/core/World/Land/LandVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Land/LandVoxel.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Land/LandVoxel.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -38,7 +38,7 @@ : base(loc) { Debug.Assert(canBeBuilt(loc)); - Debug.Assert(loc.z == WorldDefinition.World.getGroundLevel(loc)); + Debug.Assert(loc.z == WorldDefinition.World.GetGroundLevel(loc)); } /// <summary> /// @@ -87,7 +87,7 @@ /// </summary> public static bool canBeBuilt(Location loc) { - if (WorldDefinition.World.getGroundLevel(loc) != loc.z) + if (WorldDefinition.World.GetGroundLevel(loc) != loc.z) return false; // can only be placed on the ground return WorldDefinition.World.isReusable(loc); } Modified: branches/FreeTrainSDL/core/World/RRCrossing.cs =================================================================== --- branches/FreeTrainSDL/core/World/RRCrossing.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/RRCrossing.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -140,11 +140,11 @@ } private void registerTimer() { - int min = FLASH_FREQUENCY-(WorldDefinition.World.clock.minutes%FLASH_FREQUENCY); + int min = FLASH_FREQUENCY-(WorldDefinition.World.Clock.minutes%FLASH_FREQUENCY); if(min==0) min=FLASH_FREQUENCY; if( currentState!=State.Open ) // register the handler while the Xing is closed. - WorldDefinition.World.clock.registerOneShot( new ClockHandler(followUp), TimeLength.fromMinutes(min) ); + WorldDefinition.World.Clock.registerOneShot( new ClockHandler(followUp), TimeLength.fromMinutes(min) ); } public void followUp() { @@ -205,7 +205,7 @@ if( currentState!=State.Closed ) return (int)currentState; else - return ((WorldDefinition.World.clock.minutes/FLASH_FREQUENCY)%2==0)?2:3; + return ((WorldDefinition.World.Clock.minutes/FLASH_FREQUENCY)%2==0)?2:3; } } Modified: branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -82,7 +82,7 @@ return; // if we can, do it - for (int z = WorldDefinition.World.getGroundLevel(loc); z < loc.z; z++) + for (int z = WorldDefinition.World.GetGroundLevel(loc); z < loc.z; z++) { Activator.CreateInstance( (z == loc.z - 1) ? topBridgeType : otherBridgeType, Modified: branches/FreeTrainSDL/core/World/Rail/Platform.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -49,7 +49,7 @@ this.name = string.Format("Platform {0,2:d}", iota++); //! this.name = string.Format("ホーム{0,2:d}",iota++); this.bellSound = DepartureBellContribution.DEFAULT; - WorldDefinition.World.clock.registerRepeated(new ClockHandler(onClockPerDay), TimeLength.ONEDAY); + WorldDefinition.World.Clock.registerRepeated(new ClockHandler(onClockPerDay), TimeLength.ONEDAY); // attach to the nearby station. foreach (IPlatformHost h in listHosts()) @@ -168,7 +168,7 @@ /// </summary> public virtual void remove() { - WorldDefinition.World.clock.unregister(new ClockHandler(onClockPerDay)); + WorldDefinition.World.Clock.unregister(new ClockHandler(onClockPerDay)); if (onEntityRemoved != null) onEntityRemoved(this, null); } /// <summary> Modified: branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -79,7 +79,7 @@ /// </summary> public static RailStationaryStructure get(Location loc) { - return WorldDefinition.World.getEntityAt(loc) as RailStationaryStructure; + return WorldDefinition.World.GetEntityAt(loc) as RailStationaryStructure; } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -142,8 +142,8 @@ /// <param name="loc"></param> private static int calcRailRoadCost(Location loc, Direction d1, Direction d2) { - int waterLevel = WorldDefinition.World.waterLevel; - int glevel = WorldDefinition.World.getGroundLevel(loc); + int waterLevel = WorldDefinition.World.WaterLevel; + int glevel = WorldDefinition.World.GetGroundLevel(loc); // int multiplier = Math.Max( loc.z-World.world.waterLevel, 1 ); int multiplier = Math.Abs(loc.z - glevel) + 1; @@ -308,7 +308,7 @@ here = here.toward(there); } - return cost * RAILROAD_DESTRUCTION_UNIT_COST * Math.Max(1, here.z - world.waterLevel); + return cost * RAILROAD_DESTRUCTION_UNIT_COST * Math.Max(1, here.z - world.WaterLevel); } /// <summary> Modified: branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -213,7 +213,7 @@ for (int i = 0; i < 4; i++) { - if (_base.z < WorldDefinition.World.getGroundLevel(_base)) + if (_base.z < WorldDefinition.World.GetGroundLevel(_base)) { new SlopeRailRoad(entity, TrafficVoxel.getOrCreate( _base.x, _base.y, _base.z + (i / 2)), @@ -267,7 +267,7 @@ : base(entity, x, y, z) { - int glevel = WorldDefinition.World.getGroundLevel(location); + int glevel = WorldDefinition.World.GetGroundLevel(location); drawSurfaceBelow = !(idx < 2 && glevel >= z); drawSurfaceAbove = !(idx >= 2 && glevel >= z + 1); } @@ -296,7 +296,7 @@ : base(entity, x, y, z) { - int glevel = WorldDefinition.World.getGroundLevel(location); + int glevel = WorldDefinition.World.GetGroundLevel(location); drawSurfaceBelow = !(idx < 2 && glevel >= z); drawSurfaceAbove = !(idx >= 2 && glevel >= z + 1); sprite = s; @@ -363,7 +363,7 @@ _base += dir; } - return SLOPE_CONSTRUCTION_UNIT_COST * Math.Max(1, _base.z - WorldDefinition.World.waterLevel); + return SLOPE_CONSTRUCTION_UNIT_COST * Math.Max(1, _base.z - WorldDefinition.World.WaterLevel); } /// <summary> /// @@ -404,7 +404,7 @@ loc += dir; if (Car.get(loc) != null) return 0; - return SLOPE_DESTRUCTION_UNIT_COST * Math.Max(1, loc.z - WorldDefinition.World.waterLevel); + return SLOPE_DESTRUCTION_UNIT_COST * Math.Max(1, loc.z - WorldDefinition.World.WaterLevel); } /// <summary> Modified: branches/FreeTrainSDL/core/World/Rail/Station.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Station.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/Station.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -53,9 +53,9 @@ this._name = string.Format("ST{0,2:d}", iota++); if (wloc.world == WorldDefinition.World) { - WorldDefinition.World.stations.add(this); - WorldDefinition.World.clock.registerRepeated(new ClockHandler(clockHandlerHour), TimeLength.fromHours(1)); - WorldDefinition.World.clock.registerRepeated(new ClockHandler(clockHandlerDay), TimeLength.fromHours(24)); + WorldDefinition.World.Stations.add(this); + WorldDefinition.World.Clock.registerRepeated(new ClockHandler(clockHandlerHour), TimeLength.fromHours(1)); + WorldDefinition.World.Clock.registerRepeated(new ClockHandler(clockHandlerDay), TimeLength.fromHours(24)); } Distance r = new Distance(REACH_RANGE, REACH_RANGE, REACH_RANGE); @@ -131,13 +131,13 @@ public override void remove() { - WorldDefinition.World.clock.unregister(new ClockHandler(clockHandlerHour)); - WorldDefinition.World.clock.unregister(new ClockHandler(clockHandlerDay)); + WorldDefinition.World.Clock.unregister(new ClockHandler(clockHandlerHour)); + WorldDefinition.World.Clock.unregister(new ClockHandler(clockHandlerDay)); // first, remove this station from the list of all stations. // this will allow disconnected structures to find the next // nearest station. - WorldDefinition.World.stations.remove(this); + WorldDefinition.World.Stations.remove(this); // notify listeners foreach (IStationListener l in listeners) @@ -372,7 +372,7 @@ import.AddAmount(r); trains.AddAmount(1); Debug.WriteLine(string.Format("devQ on unload v={0} for {1} passengers.", import.LastWeek / 24, r)); - WorldDefinition.World.landValue.addQ(location, Math.Min((float)(import.LastWeek / 24), r)); + WorldDefinition.World.LandValue.addQ(location, Math.Min((float)(import.LastWeek / 24), r)); accumulatedUnloadedPassengers += r; GlobalTrafficMonitor.TheInstance.NotifyPassengerTransport(this, r); } @@ -396,7 +396,7 @@ gonePassengers += pass; accumulatedLoadedPassengers += pass; - WorldDefinition.World.landValue.addQ(location, pass); + WorldDefinition.World.LandValue.addQ(location, pass); Debug.WriteLine(name + ": # of passengers gone (up to) " + gonePassengers); tr.loadPassengers(this, pass); @@ -448,7 +448,7 @@ /// </summary> public static Station get(Location loc) { - return WorldDefinition.World.getEntityAt(loc) as Station; + return WorldDefinition.World.GetEntityAt(loc) as Station; } /// <summary> /// @@ -487,7 +487,7 @@ thisweek += Math.Pow(today, 1 / LogFactor); yesterday = today; today = 0; - Clock c = WorldDefinition.World.clock; + Clock c = WorldDefinition.World.Clock; if (c.dayOfWeek == 6) { lastweek = Math.Pow(thisweek / 7, LogFactor); @@ -508,7 +508,7 @@ /// </summary> public double ThisWeek { - get { return Math.Pow(thisweek / (WorldDefinition.World.clock.dayOfWeek + 1), LogFactor); } + get { return Math.Pow(thisweek / (WorldDefinition.World.Clock.dayOfWeek + 1), LogFactor); } } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -122,7 +122,7 @@ return false; // rail is running } - if (WorldDefinition.World.getGroundLevel(here) >= here.z) + if (WorldDefinition.World.GetGroundLevel(here) >= here.z) return false; // must be all raised if (here == to) return true; Modified: branches/FreeTrainSDL/core/World/Rail/Train.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -186,7 +186,7 @@ car.remove(); // make sure that we don't have any pending event - WorldDefinition.World.clock.unregister(new ClockHandler(clockHandler)); + WorldDefinition.World.Clock.unregister(new ClockHandler(clockHandler)); State = TrainStates.Unplaced; } @@ -299,7 +299,7 @@ private void registerTimer(TimeLength time) { - WorldDefinition.World.clock.registerOneShot(new ClockHandler(clockHandler), time); + WorldDefinition.World.Clock.registerOneShot(new ClockHandler(clockHandler), time); } /// <summary> Counter that remembers the # of consecutive times this train is told to stop. </summary> @@ -547,7 +547,7 @@ Location newLoc = state.location + go; newLoc.z += rr.ZDiff(state.direction); - if (WorldDefinition.World.isBorderOfWorld(newLoc)) + if (WorldDefinition.World.IsBorderOfWorld(newLoc)) { // go outside the world return new CarState.Outside(newLoc, go, OUTSIDE_COUNTER_INITIAL_VALUE); Modified: branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -158,7 +158,7 @@ public override bool canBeBuilt(Location from, Location to) { if (from == to) return false; - if (from.z < WorldDefinition.World.waterLevel) return false; // below the water level + if (from.z < WorldDefinition.World.WaterLevel) return false; // below the water level Debug.Assert(from.z == to.z); Modified: branches/FreeTrainSDL/core/World/Structs/Commercial.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/Commercial.cs 2008-04-04 20:57:33 UTC (rev 346) +++ branches/FreeTrainSDL/core/World/Structs/Commercial.cs 2008-04-07 21:05:40 UTC (rev 347) @@ -94,7 +94,7 @@ { get { - return WorldDefinition.World.landValue[baseLocation + type.size / 2] * type.size.x * type.size.y; + return WorldDefinition.World.LandValue[baseLocation + type.size / 2] * type.size.x * type.size.y; } } /// <summary> @@ -148,7 +148,7 @@ /// </summary> public static Commercial get(Location loc) { - return WorldDefinition.World.getEntityAt(loc) as Commercial; + return WorldDefinition.World.GetEntityAt(loc) as Commercial; } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/... [truncated message content] |
From: <je...@us...> - 2008-04-08 07:17:35
|
Revision: 348 http://freetrain.svn.sourceforge.net/freetrain/?rev=348&view=rev Author: jendave Date: 2008-04-08 00:17:40 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Remove SIZE file. It was redundant with the standard Size struct Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Population/AgriculturalPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/OfficePopulation.cs branches/FreeTrainSDL/core/Contributions/Population/ResidentialPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/RestaurantPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/ShopperPopulation.cs branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/Contributions/Train/AbstractTrainContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Train/AsymTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/SymTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/TrainCarContribution.cs branches/FreeTrainSDL/core/Framework/Graphics/DefaultSpriteLoaderContributionImpl.cs branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs branches/FreeTrainSDL/core/World/Cube.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/LandPlan.cs branches/FreeTrainSDL/core/World/Location.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs Removed Paths: ------------- branches/FreeTrainSDL/core/World/SIZE.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -45,14 +45,14 @@ protected FixedSizeStructureContribution(XmlElement e) : base(e) { - _price = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); - SIZE sz = XmlUtil.parseSize(XmlUtil.selectSingleNode(e, "size").InnerText); - int height = int.Parse(XmlUtil.selectSingleNode(e, "height").InnerText); + Size sz = XmlUtil.ParseSize(XmlUtil.SelectSingleNode(e, "size").InnerText); + int height = int.Parse(XmlUtil.SelectSingleNode(e, "height").InnerText); this.size = new Distance(sz, height); _ppa = _price / Math.Max(1, size.x * size.y); - XmlElement spr = (XmlElement)XmlUtil.selectSingleNode(e, "sprite"); + XmlElement spr = (XmlElement)XmlUtil.SelectSingleNode(e, "sprite"); sprites = PluginUtil.getSpriteLoader(spr).load3D(spr, size.x, size.y, height); } /// <summary> @@ -65,12 +65,12 @@ public FixedSizeStructureContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main) { - _price = master.unitPrice; - int height = master.maxHeight; + _price = master.UnitPrice; + int height = master.MaxHeight; if (opposite) - size = new Distance(master.size.y, master.size.x, height); + size = new Distance(master.Size.Height, master.Size.Width, height); else - this.size = new Distance(master.size, height); + this.size = new Distance(master.Size, height); _ppa = _price / Math.Max(1, size.x * size.y); sprites = PluginUtil.getSpriteLoader(pic).load3D(pic, size.x, size.y, height); } Modified: branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -40,18 +40,18 @@ /// <summary> /// /// </summary> - int unitPrice { get; } + int UnitPrice { get; } /// <summary> /// /// </summary> - SIZE size { get; } + Size Size { get; set;} /// <summary> /// /// </summary> - int minHeight { get; } + int MinHeight { get; } /// <summary> /// /// </summary> - int maxHeight { get; } + int MaxHeight { get; } } } Modified: branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -43,7 +43,7 @@ : base(e) { picture = new Picture( - (XmlElement)XmlUtil.selectSingleNode(e, "picture"), + (XmlElement)XmlUtil.SelectSingleNode(e, "picture"), this.id); // picture object will register itself to the manager. } Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -157,7 +157,7 @@ _name = (nameNode != null) ? nameNode.InnerText : (groupNode != null ? groupNode.InnerText : null); if (name == null) throw new FormatException("<name> and <group> are both missing"); - _price = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); _computerCannotBuild = (e.SelectSingleNode("computerCannotBuild") != null); _playerCannotBuild = (e.SelectSingleNode("playerCannotBuild") != null); Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -51,9 +51,9 @@ if (gridNode == null) _grid = new Size(1, 1); else - _grid = XmlUtil.parseSize(gridNode.InnerText); + _grid = XmlUtil.ParseSize(gridNode.InnerText); - _price = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); } private readonly Size _grid; Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -45,7 +45,7 @@ : base(e) { ArrayList array = new ArrayList(); - string[] guids = XmlUtil.selectSingleNode(e, "lands").InnerText.Split(' ', '\t', '\r', '\n'); + string[] guids = XmlUtil.SelectSingleNode(e, "lands").InnerText.Split(' ', '\t', '\r', '\n'); for (int i = 0; i < guids.Length; i++) { if (guids[i].Length != 0) Modified: branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -46,7 +46,7 @@ : base(e) { // picture - XmlElement spr = (XmlElement)XmlUtil.selectSingleNode(e, "sprite"); + XmlElement spr = (XmlElement)XmlUtil.SelectSingleNode(e, "sprite"); sprite = PluginUtil.getSpriteLoader(spr).load2D(spr, 1, 1, 0)[0, 0]; } Modified: branches/FreeTrainSDL/core/Contributions/Population/AgriculturalPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/AgriculturalPopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/AgriculturalPopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ /// </summary> /// <param name="e"></param> public AgriculturalPopulation(XmlElement e) - : this(int.Parse(XmlUtil.selectSingleNode(e, "base").InnerText)) { } + : this(int.Parse(XmlUtil.SelectSingleNode(e, "base").InnerText)) { } // TODO: parameter calibration private static readonly int[] weekdayDistribution = new int[]{ Modified: branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -46,7 +46,7 @@ /// <param name="e"></param> public ConstantPopulation(XmlElement e) { - this.population = int.Parse(XmlUtil.selectSingleNode(e, "base").InnerText); + this.population = int.Parse(XmlUtil.SelectSingleNode(e, "base").InnerText); } private readonly int population; Modified: branches/FreeTrainSDL/core/Contributions/Population/OfficePopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/OfficePopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/OfficePopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ /// </summary> /// <param name="e"></param> public OfficePopulation(XmlElement e) - : this(int.Parse(XmlUtil.selectSingleNode(e, "base").InnerText)) { } + : this(int.Parse(XmlUtil.SelectSingleNode(e, "base").InnerText)) { } private static readonly int[] weekdayDistribution = new int[]{ 10, 5, 5, 5, 5, 5, // 0:00- 5:00 Modified: branches/FreeTrainSDL/core/Contributions/Population/ResidentialPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/ResidentialPopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/ResidentialPopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ /// </summary> /// <param name="e"></param> public ResidentialPopulation(XmlElement e) - : this(int.Parse(XmlUtil.selectSingleNode(e, "base").InnerText)) { } + : this(int.Parse(XmlUtil.SelectSingleNode(e, "base").InnerText)) { } private static readonly int[] weekdayDistribution = new int[]{ 10, 5, 5, 5, 5, 5, // 0:00- 5:00 Modified: branches/FreeTrainSDL/core/Contributions/Population/RestaurantPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/RestaurantPopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/RestaurantPopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ /// </summary> /// <param name="e"></param> public RestaurantPopulation(XmlElement e) - : this(int.Parse(XmlUtil.selectSingleNode(e, "base").InnerText)) { } + : this(int.Parse(XmlUtil.SelectSingleNode(e, "base").InnerText)) { } private static readonly int[] weekdayDistribution = new int[]{ 0, 0, 0, 0, 0, 0, // 0:00- 5:00 Modified: branches/FreeTrainSDL/core/Contributions/Population/ShopperPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/ShopperPopulation.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Population/ShopperPopulation.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ /// </summary> /// <param name="e"></param> public ShopperPopulation( XmlElement e ) - : this( int.Parse( XmlUtil.selectSingleNode(e,"base").InnerText) ) {} + : this( int.Parse( XmlUtil.SelectSingleNode(e,"base").InnerText) ) {} private static readonly int[] weekdayDistribution = new int[]{ 0, 0, 0, 0, 0, 0, // 0:00- 5:00 Modified: branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -42,11 +42,11 @@ : base(e) { - name = XmlUtil.selectSingleNode(e, "name").InnerText; + name = XmlUtil.SelectSingleNode(e, "name").InnerText; - string href = XmlUtil.selectSingleNode(e, "sound/@href").InnerText; + string href = XmlUtil.SelectSingleNode(e, "sound/@href").InnerText; sound = new RepeatableSoundEffectImpl( - ResourceUtil.loadSound(XmlUtil.resolve(e, href))); + ResourceUtil.loadSound(XmlUtil.Resolve(e, href))); } /// <summary> name of this sound </summary> Modified: branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -43,7 +43,7 @@ public RailAccessoryContribution(XmlElement e) : base(e) { - _name = XmlUtil.selectSingleNode(e, "name").InnerText; + _name = XmlUtil.SelectSingleNode(e, "name").InnerText; } Modified: branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ public StationContribution(XmlElement e) : base(e) { - operationCost = int.Parse(XmlUtil.selectSingleNode(e, "operationCost").InnerText); + operationCost = int.Parse(XmlUtil.SelectSingleNode(e, "operationCost").InnerText); } /// <summary> Operation cost of this station per day. </summary> Modified: branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -47,8 +47,8 @@ protected AbstractRoadContributionImpl(XmlElement e) : base(e) { - _name = XmlUtil.selectSingleNode(e, "name").InnerText; - description = XmlUtil.selectSingleNode(e, "description").InnerText; + _name = XmlUtil.SelectSingleNode(e, "name").InnerText; + description = XmlUtil.SelectSingleNode(e, "description").InnerText; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -46,8 +46,8 @@ // load resource, but don't dispose it as sprites will still refer to this surface. Picture pic = getPicture(e); - XmlElement picture = (XmlElement)XmlUtil.selectSingleNode(e, "picture"); - Size sz = XmlUtil.parseSize(picture.Attributes["size"].Value); + XmlElement picture = (XmlElement)XmlUtil.SelectSingleNode(e, "picture"); + Size sz = XmlUtil.ParseSize(picture.Attributes["size"].Value); int offsetY = int.Parse(picture.Attributes["offset"].Value); flatSprites = new ISprite[16]; Modified: branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -37,10 +37,10 @@ public BGMContribution(XmlElement e) : base(e) { - this.name = XmlUtil.selectSingleNode(e, "name").InnerText; + this.name = XmlUtil.SelectSingleNode(e, "name").InnerText; - XmlElement href = (XmlElement)XmlUtil.selectSingleNode(e, "href"); - fileName = XmlUtil.resolve(href, href.InnerText).LocalPath; + XmlElement href = (XmlElement)XmlUtil.SelectSingleNode(e, "href"); + fileName = XmlUtil.Resolve(href, href.InnerText).LocalPath; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -46,19 +46,19 @@ public VarHeightBuildingContribution(XmlElement e) : base(e) { - _price = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); - size = XmlUtil.parseSize(XmlUtil.selectSingleNode(e, "size").InnerText); - _ppa = _price / Math.Max(1, size.x * size.y); - minHeight = int.Parse(XmlUtil.selectSingleNode(e, "minHeight").InnerText); - maxHeight = int.Parse(XmlUtil.selectSingleNode(e, "maxHeight").InnerText); + size = XmlUtil.ParseSize(XmlUtil.SelectSingleNode(e, "size").InnerText); + _ppa = _price / Math.Max(1, size.Width * size.Height); + minHeight = int.Parse(XmlUtil.SelectSingleNode(e, "minHeight").InnerText); + maxHeight = int.Parse(XmlUtil.SelectSingleNode(e, "maxHeight").InnerText); - XmlElement pics = (XmlElement)XmlUtil.selectSingleNode(e, "pictures"); + XmlElement pics = (XmlElement)XmlUtil.SelectSingleNode(e, "pictures"); tops = loadSpriteSets(pics.SelectNodes("top")); bottoms = loadSpriteSets(pics.SelectNodes("bottom")); - XmlElement m = (XmlElement)XmlUtil.selectSingleNode(pics, "middle"); + XmlElement m = (XmlElement)XmlUtil.SelectSingleNode(pics, "middle"); middle = PluginUtil.getSpriteLoader(m).load2D(m, size, 16); } /// <summary> @@ -71,24 +71,24 @@ public VarHeightBuildingContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main) { - _price = master.unitPrice; + _price = master.UnitPrice; if (opposite) - size = new SIZE(master.size.y, master.size.x); + size = new Size(master.Size.Height, master.Size.Width); else - size = master.size; - _ppa = _price / Math.Max(1, size.x * size.y); - minHeight = master.minHeight; - maxHeight = master.maxHeight; + size = master.Size; + _ppa = _price / Math.Max(1, size.Width * size.Height); + minHeight = master.MinHeight; + maxHeight = master.MaxHeight; tops = loadSpriteSets(pic.SelectNodes("top")); bottoms = loadSpriteSets(pic.SelectNodes("bottom")); - XmlElement m = (XmlElement)XmlUtil.selectSingleNode(pic, "middle"); + XmlElement m = (XmlElement)XmlUtil.SelectSingleNode(pic, "middle"); XmlAttribute a = m.Attributes["overlay"]; if (a != null && a.InnerText.Equals("true")) overlay = true; - middle = PluginUtil.getSpriteLoader(m).load2D(m, size, size.x * 8); + middle = PluginUtil.getSpriteLoader(m).load2D(m, size, size.Width * 8); } /// <summary> /// @@ -107,7 +107,7 @@ int idx = 0; foreach (XmlElement e in list) { - sprites[idx++] = PluginUtil.getSpriteLoader(e).load2D(e, size, size.x * 8); + sprites[idx++] = PluginUtil.getSpriteLoader(e).load2D(e, size, size.Width * 8); } return sprites; } @@ -155,7 +155,7 @@ } /// <summary> Size of the basement of this structure in voxel by voxel. </summary> - public readonly SIZE size; + public readonly Size size; /// <summary> Range of the possible height of the structure in voxel unit. </summary> public readonly int minHeight, maxHeight; @@ -188,8 +188,8 @@ public bool canBeBuilt(Location baseLoc, int height) { for (int z = 0; z < height; z++) - for (int y = 0; y < size.y; y++) - for (int x = 0; x < size.x; x++) + for (int y = 0; y < size.Height; y++) + for (int x = 0; x < size.Width; x++) if (WorldDefinition.World[baseLoc.x + x, baseLoc.y + y, baseLoc.z + z] != null) return false; @@ -269,10 +269,10 @@ /// <returns></returns> public WorldDefinition CreatePreviewWorld(Size minsizePixel, IDictionary options) { - Distance d = new Distance(size.x * 2 + 1, size.y * 2 + 1, maxHeight); + Distance d = new Distance(size.Width * 2 + 1, size.Height * 2 + 1, maxHeight); WorldDefinition w = WorldDefinition.CreatePreviewWorld(minsizePixel, d); - int v = w.Size.y - size.y - 2; - Location l = w.toXYZ((w.Size.x - size.x - size.y - 1) / 2, v, 0); + int v = w.Size.y - size.Height - 2; + Location l = w.toXYZ((w.Size.x - size.Width - size.Height - 1) / 2, v, 0); create(new WorldLocator(w, l), maxHeight, false); l = w.toXYZ((w.Size.x) / 2, v, 0); create(new WorldLocator(w, l), minHeight, false); Modified: branches/FreeTrainSDL/core/Contributions/Train/AbstractTrainContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/AbstractTrainContributionImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/AbstractTrainContributionImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -38,16 +38,16 @@ protected AbstractTrainContributionImpl(XmlElement e) : base(e.Attributes["id"].Value) { - _companyName = XmlUtil.selectSingleNode(e, "company").InnerText; - _typeName = XmlUtil.selectSingleNode(e, "type").InnerText; - _nickName = XmlUtil.selectSingleNode(e, "name").InnerText; - _description = XmlUtil.selectSingleNode(e, "description").InnerText; - _author = XmlUtil.selectSingleNode(e, "author").InnerText; + _companyName = XmlUtil.SelectSingleNode(e, "company").InnerText; + _typeName = XmlUtil.SelectSingleNode(e, "type").InnerText; + _nickName = XmlUtil.SelectSingleNode(e, "name").InnerText; + _description = XmlUtil.SelectSingleNode(e, "description").InnerText; + _author = XmlUtil.SelectSingleNode(e, "author").InnerText; - _price = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); // TODO: pictures - string speedStr = XmlUtil.selectSingleNode(e, "speed").InnerText.ToLower(); + string speedStr = XmlUtil.SelectSingleNode(e, "speed").InnerText.ToLower(); switch (speedStr) { case "slow": Modified: branches/FreeTrainSDL/core/Contributions/Train/AsymTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/AsymTrainCarImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/AsymTrainCarImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -50,11 +50,11 @@ levelSprites = new ISprite[16]; slopeSprites = new ISprite[8]; - XmlElement sprite = (XmlElement)XmlUtil.selectSingleNode(e, "sprite"); + XmlElement sprite = (XmlElement)XmlUtil.SelectSingleNode(e, "sprite"); Picture picture = getPicture(sprite); SpriteFactory factory = SpriteFactory.getSpriteFactory(sprite); - Point origin = XmlUtil.parsePoint(sprite.Attributes["origin"].Value); + Point origin = XmlUtil.ParsePoint(sprite.Attributes["origin"].Value); for (int i = 0; i < 16; i++) { Modified: branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -60,7 +60,7 @@ public ColoredTrainCarImpl(XmlElement e) : base(e) { - XmlElement colorMap = (XmlElement)XmlUtil.selectSingleNode(e, "colorMap"); + XmlElement colorMap = (XmlElement)XmlUtil.SelectSingleNode(e, "colorMap"); Color cb = getColor(colorMap, "base"); Color cl1 = getColor(colorMap, "line1"); // used to be "stripe" @@ -137,7 +137,7 @@ private static Color getColor(XmlElement e, string name) { // TODO: better error handling - string value = ((XmlAttribute)XmlUtil.selectSingleNode(e, '@' + name)).Value; + string value = ((XmlAttribute)XmlUtil.SelectSingleNode(e, '@' + name)).Value; string[] cmp = value.Split(','); return Color.FromArgb(int.Parse(cmp[0]), int.Parse(cmp[1]), int.Parse(cmp[2])); } @@ -240,7 +240,7 @@ public ColoredTrainPictureContribution(XmlElement e) : base(e) { - this.name = XmlUtil.selectSingleNode(e, "name").InnerText; + this.name = XmlUtil.SelectSingleNode(e, "name").InnerText; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -40,7 +40,7 @@ public ParamTrainImpl(XmlElement e) : base(e) { - composition = (XmlElement)XmlUtil.selectSingleNode(e, "composition"); + composition = (XmlElement)XmlUtil.SelectSingleNode(e, "composition"); } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -41,7 +41,7 @@ public PatternTrainImpl(XmlElement e) : base(e) { - config = (XmlElement)XmlUtil.selectSingleNode(e, "config"); + config = (XmlElement)XmlUtil.SelectSingleNode(e, "config"); } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -45,7 +45,7 @@ : base(e.Attributes["id"].Value, 0) { - XmlElement b = (XmlElement)XmlUtil.selectSingleNode(e, "base"); + XmlElement b = (XmlElement)XmlUtil.SelectSingleNode(e, "base"); baseId = b.Attributes["carRef"].Value; } Modified: branches/FreeTrainSDL/core/Contributions/Train/SymTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/SymTrainCarImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/SymTrainCarImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -47,11 +47,11 @@ levelSprites = new ISprite[8]; slopeSprites = new ISprite[4]; - XmlElement sprite = (XmlElement)XmlUtil.selectSingleNode(e,"sprite"); + XmlElement sprite = (XmlElement)XmlUtil.SelectSingleNode(e,"sprite"); Picture picture = getPicture(sprite); SpriteFactory factory = SpriteFactory.getSpriteFactory(sprite); - Point origin = XmlUtil.parsePoint( sprite.Attributes["origin"].Value ); + Point origin = XmlUtil.ParsePoint( sprite.Attributes["origin"].Value ); for( int i=0; i<8; i++ ) { Point sprOrigin = new Point( i*32 +origin.X, origin.Y ); Modified: branches/FreeTrainSDL/core/Contributions/Train/TrainCarContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/TrainCarContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Contributions/Train/TrainCarContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -40,7 +40,7 @@ public TrainCarContribution(XmlElement e) : base(e) { - _capacity = int.Parse(XmlUtil.selectSingleNode(e, "capacity").InnerText); + _capacity = int.Parse(XmlUtil.SelectSingleNode(e, "capacity").InnerText); } /// <summary> /// Modified: branches/FreeTrainSDL/core/Framework/Graphics/DefaultSpriteLoaderContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/DefaultSpriteLoaderContributionImpl.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Graphics/DefaultSpriteLoaderContributionImpl.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -50,8 +50,8 @@ return SpriteFactory.getSpriteFactory(sprite).createSprite( getPicture(sprite), new Point(0, h), - XmlUtil.parsePoint(XmlUtil.selectSingleNode(sprite, "@origin").InnerText), - size == null ? new Size(32, 32) : XmlUtil.parseSize(size.Value)); + XmlUtil.ParsePoint(XmlUtil.SelectSingleNode(sprite, "@origin").InnerText), + size == null ? new Size(32, 32) : XmlUtil.ParseSize(size.Value)); } @@ -70,7 +70,7 @@ ISprite[,] sprites = new ISprite[X, Y]; - Point origin = XmlUtil.parsePoint(sprite.Attributes["origin"].Value); + Point origin = XmlUtil.ParsePoint(sprite.Attributes["origin"].Value); int h = height; XmlAttribute att = sprite.Attributes["offset"]; if (att != null) @@ -111,7 +111,7 @@ ISprite[, ,] sprites = new ISprite[X, Y, Z]; - Point origin = XmlUtil.parsePoint(sprite.Attributes["origin"].Value); + Point origin = XmlUtil.ParsePoint(sprite.Attributes["origin"].Value); int h = ((Z << 1) + (X - 1)) << 3; // calculate default offset XmlAttribute att = sprite.Attributes["offset"]; if (att != null) Modified: branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -108,7 +108,7 @@ this.id = _id; // // obtain the size of the bitmap - string baseFileName = XmlUtil.resolve(pic, pic.Attributes["src"].Value).LocalPath; + string baseFileName = XmlUtil.Resolve(pic, pic.Attributes["src"].Value).LocalPath; // this.size = getBitmapSize(baseFileName); ISurfaceLoader[,] specifiedLoaders = new ISurfaceLoader[4, 2]; @@ -138,7 +138,7 @@ if (src != null) { ISurfaceLoader overrideLoader = new BitmapSurfaceLoader( - XmlUtil.resolve(ovr, src.Value).LocalPath); + XmlUtil.Resolve(ovr, src.Value).LocalPath); specifiedLoaders[s, 0] = overrideLoader; } specifiedLoaders[s, 1] = getNightOverride(ovr); @@ -156,7 +156,7 @@ string when = ovr.Attributes["when"].Value; if (when.Equals("night")) return new BitmapSurfaceLoader( - XmlUtil.resolve(ovr, ovr.Attributes["src"].Value).LocalPath); + XmlUtil.Resolve(ovr, ovr.Attributes["src"].Value).LocalPath); else return null; } Modified: branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -146,7 +146,7 @@ /// <returns>non-null valid object.</returns> protected Picture getPicture(XmlElement sprite) { - XmlElement pic = (XmlElement)XmlUtil.selectSingleNode(sprite, "picture"); + XmlElement pic = (XmlElement)XmlUtil.SelectSingleNode(sprite, "picture"); XmlAttribute r = pic.Attributes["ref"]; if (r != null) Modified: branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -45,7 +45,7 @@ public DynamicContributionFactory(XmlElement e) : this(PluginUtil.loadTypeFromManifest( - (XmlElement)XmlUtil.selectSingleNode(e, "implementation"))) { } + (XmlElement)XmlUtil.SelectSingleNode(e, "implementation"))) { } private readonly Type baseType; Modified: branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -42,7 +42,7 @@ public FixedClassContributionFactory(XmlElement e) : this(PluginUtil.loadTypeFromManifest( - (XmlElement)XmlUtil.selectSingleNode(e, "implementation"))) { } + (XmlElement)XmlUtil.SelectSingleNode(e, "implementation"))) { } private readonly Type concreteType; /// <summary> Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -108,13 +108,13 @@ doc = loadManifest(dirName); XmlElement root = doc.DocumentElement; - _title = XmlUtil.selectSingleNode(root, "title").InnerText; - _homepage = XmlUtil.selectSingleNode(root, "homepage").InnerText; + _title = XmlUtil.SelectSingleNode(root, "title").InnerText; + _homepage = XmlUtil.SelectSingleNode(root, "homepage").InnerText; if (root.SelectSingleNode("author") == null) _author = ""; else - _author = XmlUtil.selectSingleNode(root, "author").InnerText; + _author = XmlUtil.SelectSingleNode(root, "author").InnerText; Debug.WriteLine("loading plug-in: " + title); Debug.WriteLine(" base dir: " + dirName); @@ -135,7 +135,7 @@ { // load a contribution factory - string contributionName = XmlUtil.selectSingleNode(contrib, "name").InnerText; + string contributionName = XmlUtil.SelectSingleNode(contrib, "name").InnerText; IContributionFactory factory = (IContributionFactory)PluginUtil.loadObjectFromManifest(contrib); Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -47,7 +47,7 @@ /// </summary> public static object loadObjectFromManifest(XmlElement contrib) { - XmlElement el = (XmlElement)XmlUtil.selectSingleNode(contrib, "class"); + XmlElement el = (XmlElement)XmlUtil.SelectSingleNode(contrib, "class"); Type t = loadTypeFromManifest(el); try @@ -84,7 +84,7 @@ else { // load the class from the specified assembly - Uri codeBase = XmlUtil.resolve(e, e.Attributes["codebase"].Value); + Uri codeBase = XmlUtil.Resolve(e, e.Attributes["codebase"].Value); if (!codeBase.IsFile) throw new FormatException("Designated codebase is not a filename: " + codeBase); Modified: branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -36,18 +36,20 @@ /// Performs a node selection and throws an exception if it's not found. /// </summary> /// <exception cref="XmlException"></exception> - public static XmlNode selectSingleNode(XmlNode node, string xpath) + public static XmlNode SelectSingleNode(XmlNode node, string xpath) { XmlNode n = node.SelectSingleNode(xpath); if (n == null) + { throw new XmlException("unable to find " + xpath, null); + } return n; } /// <summary> /// Resolves a relative URI. /// </summary> - public static Uri resolve(XmlNode context, string relative) + public static Uri Resolve(XmlNode context, string relative) { return new Uri(new Uri(context.BaseURI), relative); } @@ -56,7 +58,7 @@ /// </summary> /// <param name="text"></param> /// <returns></returns> - public static Point parsePoint(string text) + public static Point ParsePoint(string text) { try { @@ -73,12 +75,12 @@ /// </summary> /// <param name="text"></param> /// <returns></returns> - public static SIZE parseSize(string text) + public static Size ParseSize(string text) { try { int idx = text.IndexOf(','); - return new SIZE(int.Parse(text.Substring(0, idx)), int.Parse(text.Substring(idx + 1))); + return new Size(int.Parse(text.Substring(0, idx)), int.Parse(text.Substring(idx + 1))); } catch (Exception e) { Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-08 07:17:40 UTC (rev 348) @@ -801,9 +801,6 @@ <Compile Include="World\RRCrossing.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="World\SIZE.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="World\SparseVoxelArray.cs"> <SubType>Code</SubType> </Compile> @@ -1037,4 +1034,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -37,7 +37,7 @@ public AccountGenre(XmlElement e) : base(e) { - name = XmlUtil.selectSingleNode(e, "name").InnerText; + name = XmlUtil.SelectSingleNode(e, "name").InnerText; WorldDefinition.onNewWorld += new EventHandler(onNewWorld); } Modified: branches/FreeTrainSDL/core/World/Cube.cs =================================================================== --- branches/FreeTrainSDL/core/World/Cube.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Cube.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -73,8 +73,8 @@ /// <param name="_corner"></param> /// <param name="sz"></param> /// <param name="z"></param> - public Cube(Location _corner, SIZE sz, int z) - : this(_corner, sz.x, sz.y, z) { } + public Cube(Location _corner, Size sz, int z) + : this(_corner, sz.Width, sz.Height, z) { } #region factory methods /// <summary> Modified: branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -19,6 +19,7 @@ #endregion LICENSE using System; +using System.Drawing; using System.Collections; using System.Diagnostics; using FreeTrain.Contributions.Common; @@ -371,9 +372,9 @@ if (entity is LandBuilderContribution) { LandBuilderContribution lbc = entity as LandBuilderContribution; - SIZE size = new SIZE(Rand(F_LandAveSize, F_LandFlexSize), Rand(F_LandAveSize, F_LandFlexSize)); + Size size = new Size(Rand(F_LandAveSize, F_LandFlexSize), Rand(F_LandAveSize, F_LandFlexSize)); p = new LandPlan(lbc, dev, scaning, size); - finalPrice = lbc.price * size.x * size.y; + finalPrice = lbc.price * size.Width * size.Height; } else if (entity is CommercialStructureContribution) { Modified: branches/FreeTrainSDL/core/World/Development/LandPlan.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/LandPlan.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Development/LandPlan.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -19,6 +19,7 @@ #endregion LICENSE using System; +using System.Drawing; using FreeTrain.Contributions.Land; namespace FreeTrain.World.Development @@ -31,10 +32,10 @@ { private readonly LandBuilderContribution contrib; private readonly Location loc; - private readonly SIZE size; + private readonly Size size; - internal LandPlan( LandBuilderContribution _contrib, IULVFactory factory, Location _loc, SIZE _size ) - : base(factory.create(new Cube(_loc,_size.x,_size.y,0))) { + internal LandPlan( LandBuilderContribution _contrib, IULVFactory factory, Location _loc, Size _size ) + : base(factory.create(new Cube(_loc,_size.Width,_size.Height, 0))) { this.contrib = _contrib; this.loc = _loc; this.size = _size; @@ -42,10 +43,10 @@ public override int value { get { return contrib.price*4; } } - public override Cube cube { get { return new Cube(loc,size.x,size.y,1); } } + public override Cube cube { get { return new Cube(loc,size.Width,size.Height,1); } } public override void build() { - contrib.create(loc,loc+new Distance(size.x-1,size.y-1,0),false); // inclusive + contrib.create(loc,loc+new Distance(size.Width-1,size.Height-1,0),false); // inclusive } } Modified: branches/FreeTrainSDL/core/World/Location.cs =================================================================== --- branches/FreeTrainSDL/core/World/Location.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Location.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -347,7 +347,7 @@ /// </summary> /// <param name="sz"></param> /// <param name="_z"></param> - public Distance(SIZE sz, int _z) { x = sz.x; y = sz.y; z = _z; } + public Distance(Size sz, int _z) { x = sz.Width; y = sz.Height; z = _z; } /// <summary> /// Deleted: branches/FreeTrainSDL/core/World/SIZE.cs =================================================================== --- branches/FreeTrainSDL/core/World/SIZE.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/SIZE.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -1,84 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; - -namespace FreeTrain.World -{ - /// <summary> - /// Better "Size" class. - /// </summary> - [Serializable] - public struct SIZE - { - /// <summary> - /// - /// </summary> - /// <param name="sz"></param> - public SIZE(Size sz) - : this(sz.Width, sz.Height) - { - } - /// <summary> - /// - /// </summary> - /// <param name="_x"></param> - /// <param name="_y"></param> - public SIZE(int _x, int _y) - { - this.x = _x; - this.y = _y; - } - - /// <summary> - /// - /// </summary> - public int x; - /// <summary> - /// - /// </summary> - public int y; - - /// <summary> - /// Area of this size. - /// </summary> - public int area - { - get - { - return x * y; - } - } - /// <summary> - /// - /// </summary> - public bool is1 { get { return x == 1 && y == 1; } } - /// <summary> - /// - /// </summary> - /// <param name="sz"></param> - /// <returns></returns> - public static implicit operator Size(SIZE sz) - { - return new Size(sz.x, sz.y); - } - } -} Modified: branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -49,8 +49,8 @@ this.type = _type; this.height = _height; - int Y = type.size.y; - int X = type.size.x; + int Y = type.size.Height; + int X = type.size.Width; int Z = height; this.baseLocation = wloc.location; @@ -115,7 +115,7 @@ { get { - return WorldDefinition.World.LandValue[baseLocation + new Distance(type.size, 0) / 2] * type.size.x * type.size.y; + return WorldDefinition.World.LandValue[baseLocation + new Distance(type.size, 0) / 2] * type.size.Width * type.size.Height; } } /// <summary> Modified: branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -50,15 +50,15 @@ : base(e) { // pictures - XmlElement sprite = (XmlElement)XmlUtil.selectSingleNode(e, "sprite"); + XmlElement sprite = (XmlElement)XmlUtil.SelectSingleNode(e, "sprite"); Picture picture = getPicture(sprite); - Point origin = XmlUtil.parsePoint(sprite.Attributes["origin"].Value); + Point origin = XmlUtil.ParsePoint(sprite.Attributes["origin"].Value); int offset = int.Parse(sprite.Attributes["offset"].Value); Size sz = new Size(32, 16 + offset); Point sprOrigin0 = new Point(origin.X, origin.Y); Point sprOrigin1 = new Point(32 + origin.X, origin.Y); - XmlElement splist = (XmlElement)XmlUtil.selectSingleNode(sprite, "variations"); + XmlElement splist = (XmlElement)XmlUtil.SelectSingleNode(sprite, "variations"); colorVariations = 0; IEnumerator ienum = splist.ChildNodes.GetEnumerator(); while (ienum.MoveNext()) colorVariations++; Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -84,14 +84,14 @@ try { - _unitPrice = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); + _unitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); } catch { _unitPrice = 0; } - _size = new SIZE(1, 1); + Size = new Size(1, 1); _minHeight = 2; _maxHeight = 0; Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -43,20 +43,20 @@ /// /// </summary> [Serializable] - public enum SpriteTableType : int - { + public enum SpriteTableType : int + { /// <summary> /// /// </summary> - UNKNOWN, + UNKNOWN, /// <summary> /// /// </summary> - BASIC, + BASIC, /// <summary> /// /// </summary> - VARHEIGHT + VARHEIGHT }; /// <summary> @@ -89,7 +89,7 @@ /// <summary> /// /// </summary> - public int unitPrice { get { return _unitPrice; } } + public int UnitPrice { get { return _unitPrice; } } /// <summary> /// /// </summary> @@ -103,27 +103,36 @@ /// </summary> public override double pricePerArea { get { return _areaPrice; } } - /// <summary> size of this structur. </summary> - [CLSCompliant(false)] - protected SIZE _size; + private Size size; + /// <summary> /// /// </summary> - [CLSCompliant(false)] - public SIZE size { get { return _size; } } + public Size Size + { + get + { + return size; + } + set + { + size = value; + } + } + /// <summary> valid for variable height structure only. </summary> [CLSCompliant(false)] protected int _minHeight; /// <summary> /// /// </summary> - public int minHeight { get { return _minHeight; } } + public int MinHeight { get { return _minHeight; } } /// <summary> used as well as fixed height structure. </summary> protected int _maxHeight; /// <summary> /// /// </summary> - public int maxHeight { get { return _maxHeight; } } + public int MaxHeight { get { return _maxHeight; } } /// <summary> sprite table type of this structure. </summary> protected SpriteTableType stType = SpriteTableType.UNKNOWN; /// <summary> @@ -266,9 +275,9 @@ _design = "default"; } - _unitPrice = int.Parse(XmlUtil.selectSingleNode(e, "price").InnerText); - _size = XmlUtil.parseSize(XmlUtil.selectSingleNode(e, "size").InnerText); - _areaPrice = _unitPrice / Math.Max(1, size.x * size.y); + _unitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + size = XmlUtil.ParseSize(XmlUtil.SelectSingleNode(e, "size").InnerText); + _areaPrice = _unitPrice / Math.Max(1, size.Width * size.Height); _minHeight = 2; try @@ -284,7 +293,7 @@ catch { // if maxHeight tag is nod find, height tag must be exist. - _maxHeight = int.Parse(XmlUtil.selectSingleNode(e, "height").InnerText); + _maxHeight = int.Parse(XmlUtil.SelectSingleNode(e, "height").InnerText); } } /// <summary> Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs 2008-04-07 21:05:40 UTC (rev 347) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs 2008-04-08 07:17:40 UTC (rev 348) @@ -228,7 +228,7 @@ CommercialStructureContribution csContrib = (CommercialStructureContribution)current.current; if (csContrib.size.volume > 0) // eliminate dummy contribution { - CompletionHandler handler = new CompletionHandler(csContrib, loc, current.maxHeight, true); + CompletionHandler handler = new CompletionHandler(csContrib, loc, current.MaxHeight, true); new ConstructionSite(loc, new EventHandler(handler.handle), csContrib.size); } } @@ -243,7 +243,7 @@ public bool canBeBuilt(Location baseLoc) { int height; - SIZE size; + Size size; if (current.current is VarHeightBuildingContribution) ... [truncated message content] |
From: <je...@us...> - 2008-04-08 08:01:21
|
Revision: 349 http://freetrain.svn.sourceforge.net/freetrain/?rev=349&view=rev Author: jendave Date: 2008-04-08 01:01:22 -0700 (Tue, 08 Apr 2008) Log Message: ----------- renaming many methods Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs branches/FreeTrainSDL/core/Contributions/Common/IEntityBuilder.cs branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/Controllers/Land/LandController.cs branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/LandPlan.cs branches/FreeTrainSDL/core/World/Development/VarHeightBuildingPlan.cs branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs branches/FreeTrainSDL/core/World/Structs/Commercial.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/PopulatedStructure.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -81,7 +81,7 @@ /// <summary> /// /// </summary> - public override int price { get { return _price; } } + public override int Price { get { return _price; } } /// <summary> /// /// </summary> @@ -90,7 +90,7 @@ /// <summary> /// /// </summary> - public override double pricePerArea { get { return _ppa; } } + public override double PricePerArea { get { return _ppa; } } /// <summary> @@ -152,7 +152,7 @@ /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, size); drawer.drawCenter(sprites); @@ -163,7 +163,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { return new FixedSizeStructurePlacementController(this, site); } @@ -172,7 +172,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { return new FixedSizeStructureRemovalController(this, site); } Modified: branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Common/IAbstractStructure.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -40,7 +40,7 @@ /// <summary> /// /// </summary> - int UnitPrice { get; } + int UnitPrice { get; set;} /// <summary> /// /// </summary> @@ -48,10 +48,10 @@ /// <summary> /// /// </summary> - int MinHeight { get; } + int MinHeight { get; set;} /// <summary> /// /// </summary> - int MaxHeight { get; } + int MaxHeight { get; set;} } } Modified: branches/FreeTrainSDL/core/Contributions/Common/IEntityBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/IEntityBuilder.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Common/IEntityBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -35,52 +35,52 @@ /// <summary> /// Population of this structure, or null if this structure is not populated. /// </summary> - BasePopulation population { get; } + BasePopulation Population { get; } /// <summary> /// True if the computer (the development algorithm) is not allowed to /// build this structure. /// </summary> // TODO: make IEntityBuilder responsible for creating a new Plan object. - bool computerCannotBuild { get; } + bool ComputerCannotBuild { get; } /// <summary> /// True if the player is not allowed to build this structure. /// </summary> - bool playerCannotBuild { get; } + bool PlayerCannotBuild { get; } /// <summary> /// Name of this entity builder. Primarily used as the display name. /// Doesn't need to be unique. /// </summary> - string name { get; } + string Name { get; } /// <summary> /// /// </summary> - int price { get; } + int Price { get; set;} /// <summary> /// price par area (minimum). /// </summary> - double pricePerArea { get; } + double PricePerArea { get; set;} /// <summary> /// Creates a preview /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - PreviewDrawer createPreview(Size pixelSize); + PreviewDrawer CreatePreview(Size pixelSize); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - IModalController createBuilder(IControllerSite site); + IModalController CreateBuilder(IControllerSite site); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - IModalController createRemover(IControllerSite site); + IModalController CreateRemover(IControllerSite site); } } Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -51,7 +51,7 @@ { core = new EntityBuilderInternal(e, this.id); XmlNode groupNode = e.SelectSingleNode("group"); - string groupName = (groupNode != null) ? groupNode.InnerText : core.name; + string groupName = (groupNode != null) ? groupNode.InnerText : core.Name; group = getGroup(groupName); group.add(this); @@ -75,9 +75,18 @@ /// <summary> /// /// </summary> - public readonly StructureGroup group; + private readonly StructureGroup group; /// <summary> + /// + /// </summary> + public StructureGroup Group + { + get { return group; } + } + + + /// <summary> /// Implemented by the derived class and /// used to determine which group this structure should go. /// </summary> @@ -87,56 +96,76 @@ /// Name of this entity builder. Primarily used as the display name. /// Doesn't need to be unique. /// </summary> - public virtual string name { get { return core.name; } } + public virtual string Name { get { return core.Name; } } /// <summary> /// /// </summary> - public virtual BasePopulation population { get { return core.population; } } + public virtual BasePopulation Population { get { return core.Population; } } /// <summary> /// True if the computer (the development algorithm) is not allowed to /// build this structure. /// </summary> // TODO: make EntityBuilderContribution responsible for creating a new Plan object. - public bool computerCannotBuild { get { return core.computerCannotBuild; } } + public bool ComputerCannotBuild { get { return core.ComputerCannotBuild; } } /// <summary> /// True if the player is not allowed to build this structure. /// </summary> - public bool playerCannotBuild { get { return core.playerCannotBuild; } } + public bool PlayerCannotBuild { get { return core.PlayerCannotBuild; } } /// <summary> /// /// </summary> - public virtual int price { get { return core.price; } } + public virtual int Price + { + get + { + return core.Price; + } + set + { + core.Price = value; + } + } /// <summary> /// price par area (minimum). /// </summary> - public virtual double pricePerArea { get { return core.pricePerArea; } } + public virtual double PricePerArea + { + get + { + return core.PricePerArea; + } + set + { + core.PricePerArea = value; + } + } /// <summary> /// Creates a preview /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - public virtual PreviewDrawer createPreview(Size pixelSize) { return core.createPreview(pixelSize); } + public virtual PreviewDrawer CreatePreview(Size pixelSize) { return core.CreatePreview(pixelSize); } /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual IModalController createBuilder(IControllerSite site) { return core.createBuilder(site); } + public virtual IModalController CreateBuilder(IControllerSite site) { return core.CreateBuilder(site); } /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual IModalController createRemover(IControllerSite site) { return core.createRemover(site); } + public virtual IModalController CreateRemover(IControllerSite site) { return core.CreateRemover(site); } /// <summary> /// /// </summary> /// <returns></returns> - public override string ToString() { return core.name; } + public override string ToString() { return core.Name; } /// <summary> /// @@ -155,9 +184,9 @@ XmlNode groupNode = e.SelectSingleNode("group"); _name = (nameNode != null) ? nameNode.InnerText : (groupNode != null ? groupNode.InnerText : null); - if (name == null) + if (Name == null) throw new FormatException("<name> and <group> are both missing"); - _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); _computerCannotBuild = (e.SelectSingleNode("computerCannotBuild") != null); _playerCannotBuild = (e.SelectSingleNode("playerCannotBuild") != null); @@ -172,43 +201,60 @@ private readonly bool _computerCannotBuild; private readonly bool _playerCannotBuild; private readonly string _name; - /// <summary> - /// - /// </summary> - [CLSCompliant(false)] - protected readonly int _price; + int price; #region IEntityBuilder o /// <summary> /// /// </summary> - public BasePopulation population { get { return _population; } } + public BasePopulation Population { get { return _population; } } /// <summary> /// /// </summary> - public bool computerCannotBuild { get { return _computerCannotBuild; } } + public bool ComputerCannotBuild { get { return _computerCannotBuild; } } /// <summary> /// /// </summary> - public bool playerCannotBuild { get { return _playerCannotBuild; } } + public bool PlayerCannotBuild { get { return _playerCannotBuild; } } /// <summary> /// /// </summary> - public string name { get { return _name; } } + public string Name { get { return _name; } } /// <summary> /// /// </summary> - public int price { get { return _price; } } + public int Price + { + get + { + return price; + } + + set + { + price = value; + } + } /// <summary> /// /// </summary> - public virtual double pricePerArea { get { return _price; } } + public virtual double PricePerArea + { + get + { + return price; + } + set + { + double price = value; + } + } /// <summary> /// /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - public virtual FreeTrain.Framework.Graphics.PreviewDrawer createPreview(System.Drawing.Size pixelSize) + public virtual FreeTrain.Framework.Graphics.PreviewDrawer CreatePreview(System.Drawing.Size pixelSize) { throw new NotImplementedException(); } @@ -217,7 +263,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual FreeTrain.Controllers.IModalController createBuilder(FreeTrain.Controllers.IControllerSite site) + public virtual FreeTrain.Controllers.IModalController CreateBuilder(FreeTrain.Controllers.IControllerSite site) { throw new NotImplementedException(); } @@ -226,7 +272,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public virtual FreeTrain.Controllers.IModalController createRemover(FreeTrain.Controllers.IControllerSite site) + public virtual FreeTrain.Controllers.IModalController CreateRemover(FreeTrain.Controllers.IControllerSite site) { throw new NotImplementedException(); } @@ -249,7 +295,7 @@ /// <returns></returns> public object GetRealObject(StreamingContext context) { - return ((StructureContribution)PluginManager.theInstance.getContribution(id)).population; + return ((StructureContribution)PluginManager.theInstance.getContribution(id)).Population; } } } Modified: branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -99,7 +99,7 @@ /// <summary> /// Creates the preview image of the land builder. /// </summary> - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { return new PreviewDrawer(pixelSize, new Size(10, 10), 0); } @@ -108,9 +108,9 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { - return createRemover(site); + return CreateRemover(site); } } Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -68,11 +68,11 @@ /// <summary> /// /// </summary> - public override int price { get { return _price; } } + public override int Price { get { return _price; } } /// <summary> /// /// </summary> - public override double pricePerArea { get { return _price; } } + public override double PricePerArea { get { return _price; } } /// <summary> /// /// </summary> @@ -141,7 +141,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -92,7 +92,7 @@ /// <summary> /// Creates the preview image of the land builder. /// </summary> - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, new Size(10, 10), 0); @@ -107,7 +107,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getLandSprite)); } Modified: branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -75,7 +75,7 @@ /// <summary> /// Creates the preview image of the land builder. /// </summary> - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, new Size(10, 10), 0); @@ -90,7 +90,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); } Modified: branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Rail/RailAccessoryContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -35,7 +35,7 @@ [Serializable] public abstract class RailAccessoryContribution : Contribution, IEntityBuilder { - private readonly string _name; + private readonly string name; /// <summary> /// /// </summary> @@ -43,7 +43,7 @@ public RailAccessoryContribution(XmlElement e) : base(e) { - _name = XmlUtil.SelectSingleNode(e, "name").InnerText; + name = XmlUtil.SelectSingleNode(e, "name").InnerText; } @@ -54,45 +54,65 @@ /// <summary> /// /// </summary> - public virtual string name { get { return _name; } } + public virtual string Name { get { return name; } } /// <summary> /// /// </summary> - public virtual BasePopulation population { get { return null; } } + public virtual BasePopulation Population { get { return null; } } /// <summary> /// /// </summary> - public virtual int price { get { return 0; } } + public virtual int Price + { + get + { + return 0; + } + set + { + int price = value; + } + } /// <summary> /// /// </summary> - public virtual double pricePerArea { get { return 0; } } + public virtual double PricePerArea + { + get + { + return 0; + } + set + { + double price = value; + } + } /// <summary> /// /// </summary> - public bool computerCannotBuild { get { return false; } } + public bool ComputerCannotBuild { get { return false; } } /// <summary> /// /// </summary> - public bool playerCannotBuild { get { return true; } } + public bool PlayerCannotBuild { get { return true; } } /// <summary> /// /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - public abstract FreeTrain.Framework.Graphics.PreviewDrawer createPreview(System.Drawing.Size pixelSize); + public abstract FreeTrain.Framework.Graphics.PreviewDrawer CreatePreview(System.Drawing.Size pixelSize); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public abstract FreeTrain.Controllers.IModalController createBuilder(FreeTrain.Controllers.IControllerSite site); + public abstract FreeTrain.Controllers.IModalController CreateBuilder(FreeTrain.Controllers.IControllerSite site); /// <summary> /// /// </summary> /// <param name="site"></param> /// <returns></returns> - public abstract FreeTrain.Controllers.IModalController createRemover(FreeTrain.Controllers.IControllerSite site); + public abstract FreeTrain.Controllers.IModalController CreateRemover(FreeTrain.Controllers.IControllerSite site); #endregion } Modified: branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -118,7 +118,7 @@ /// <summary> /// /// </summary> - public override int price { get { return _price; } } + public override int Price { get { return _price; } } /// <summary> /// /// </summary> @@ -127,7 +127,7 @@ /// <summary> /// /// </summary> - public override double pricePerArea { get { return _price; } } + public override double PricePerArea { get { return _price; } } /// <summary>Sprite sets.</summary> private readonly ISprite[][,] tops, bottoms; @@ -200,7 +200,7 @@ /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, size, tops.Length + bottoms.Length + 1/*middle*/ ); @@ -245,7 +245,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { // TODO throw new NotImplementedException(); @@ -255,7 +255,7 @@ /// </summary> /// <param name="site"></param> /// <returns></returns> - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { // TODO throw new NotImplementedException(); Modified: branches/FreeTrainSDL/core/Controllers/Land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -165,7 +165,7 @@ public override void UpdatePreview() { LandBuilderContribution builder = (LandBuilderContribution)indexSelector.currentItem; - using (PreviewDrawer drawer = builder.createPreview(preview.Size)) + using (PreviewDrawer drawer = builder.CreatePreview(preview.Size)) { if (previewBitmap != null) previewBitmap.Dispose(); preview.Image = previewBitmap = drawer.createBitmap(); Modified: branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -42,7 +42,7 @@ this.loc = _loc; } - public override int value { get { return contrib.price; } } + public override int value { get { return contrib.Price; } } public override Cube cube { get { return Cube.createExclusive(loc,contrib.size); } } Modified: branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -50,7 +50,7 @@ { if (contrib is IEntityBuilder) { - if (((IEntityBuilder)contrib).computerCannotBuild) + if (((IEntityBuilder)contrib).ComputerCannotBuild) continue; else { @@ -102,13 +102,13 @@ do { n = (n + 1) >> 1; - int ppa = (int)((IEntityBuilder)array[p]).pricePerArea; + int ppa = (int)((IEntityBuilder)array[p]).PricePerArea; if (ppa >= price) p = Math.Max(0, p - n); else p = Math.Min(array.Count - 1, p + n); } while (n > 1); - if (price > (int)((IEntityBuilder)array[p]).pricePerArea) + if (price > (int)((IEntityBuilder)array[p]).PricePerArea) p++; // Debug.Write(string.Format("First for {0} is at {1} ;",price,p)); // Debug.WriteLine(string.Format("which is {0} -> {1} <- {2}",((IEntityBuilder)array[Math.Max(0,p-1)]).pricePerArea,((IEntityBuilder)array[p]).pricePerArea,((IEntityBuilder)array[Math.Min(array.Count-1,p+1)]).pricePerArea)); @@ -127,14 +127,14 @@ do { n = (n + 1) >> 1; - int ppa = (int)((IEntityBuilder)array[p]).pricePerArea; + int ppa = (int)((IEntityBuilder)array[p]).PricePerArea; if (ppa <= price) p = Math.Min(array.Count - 1, p + n); else p = Math.Max(0, p - n); } while (n > 1); int p1 = Math.Min(array.Count - 1, p + 1); - if (price == (int)((IEntityBuilder)array[p1]).pricePerArea) + if (price == (int)((IEntityBuilder)array[p1]).PricePerArea) p = p1; // Debug.Write(string.Format("Last for {0} is at {1} ;",price,p)); // Debug.WriteLine(string.Format("which is {0} -> {1} <- {2}",((IEntityBuilder)array[Math.Max(0,p-1)]).pricePerArea,((IEntityBuilder)array[p]).pricePerArea,((IEntityBuilder)array[Math.Min(array.Count-1,p+1)]).pricePerArea)); @@ -374,20 +374,20 @@ LandBuilderContribution lbc = entity as LandBuilderContribution; Size size = new Size(Rand(F_LandAveSize, F_LandFlexSize), Rand(F_LandAveSize, F_LandFlexSize)); p = new LandPlan(lbc, dev, scaning, size); - finalPrice = lbc.price * size.Width * size.Height; + finalPrice = lbc.Price * size.Width * size.Height; } else if (entity is CommercialStructureContribution) { CommercialStructureContribution csb = entity as CommercialStructureContribution; p = new CommercialStructurePlan(csb, dev, scaning); - finalPrice = entity.price; + finalPrice = entity.Price; } else if (entity is VarHeightBuildingContribution) { VarHeightBuildingContribution vhbc = entity as VarHeightBuildingContribution; int h = vhbc.minHeight; int h2 = vhbc.maxHeight; - int price = vhbc.price * h; + int price = vhbc.Price * h; Cube tmp = new Cube(scaning, vhbc.size, h); int cost = 0; foreach (IEntity e in tmp.getEntities()) @@ -395,7 +395,7 @@ while (price < cost && h < h2) { if (price < cost) - price += vhbc.price; + price += vhbc.Price; h++; } p = new VarHeightBuildingPlan(vhbc, dev, scaning, h); @@ -477,7 +477,7 @@ IEntityBuilder e2 = y as IEntityBuilder; if (e1 != null && e2 != null) { - return Math.Sign(e1.pricePerArea - e2.pricePerArea); + return Math.Sign(e1.PricePerArea - e2.PricePerArea); } } catch (Exception e) Modified: branches/FreeTrainSDL/core/World/Development/LandPlan.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/LandPlan.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Development/LandPlan.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -41,7 +41,7 @@ this.size = _size; } - public override int value { get { return contrib.price*4; } } + public override int value { get { return contrib.Price*4; } } public override Cube cube { get { return new Cube(loc,size.Width,size.Height,1); } } Modified: branches/FreeTrainSDL/core/World/Development/VarHeightBuildingPlan.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/VarHeightBuildingPlan.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Development/VarHeightBuildingPlan.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -43,7 +43,7 @@ this.h = h; } - public override int value { get { return contrib.price*h; } } + public override int value { get { return contrib.Price*h; } } public override Cube cube { get { return new Cube(loc,contrib.size,h); } } Modified: branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -43,8 +43,8 @@ { this.contrib = contrib; - if (contrib.population != null) - this.stationListener = new StationListenerImpl(contrib.population, loc); + if (contrib.Population != null) + this.stationListener = new StationListenerImpl(contrib.Population, loc); } /// <summary> /// @@ -57,7 +57,7 @@ /// <summary> /// /// </summary> - public override int entityValue { get { return contrib.price; } } + public override int entityValue { get { return contrib.Price; } } private readonly StationListenerImpl stationListener; Modified: branches/FreeTrainSDL/core/World/Structs/Commercial.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/Commercial.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Structs/Commercial.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -84,7 +84,7 @@ { get { - return type.price; + return type.Price; } } /// <summary> @@ -136,7 +136,7 @@ /// <summary> /// /// </summary> - public override string name { get { return type.name; } } + public override string name { get { return type.Name; } } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -75,7 +75,7 @@ /// <summary> /// /// </summary> - public override int entityValue { get { return type.price; } } + public override int entityValue { get { return type.Price; } } /// <summary> /// /// </summary> @@ -98,7 +98,7 @@ /// <summary> /// /// </summary> - public override string name { get { return type.name; } } + public override string name { get { return type.Name; } } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Structs/PopulatedStructure.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/PopulatedStructure.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Structs/PopulatedStructure.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -42,8 +42,8 @@ public PopulatedStructure( FixedSizeStructureContribution type, WorldLocator wloc ) : base(type,wloc) { - if( type.population!=null && wloc.world==WorldDefinition.World) - stationListener = new StationListenerImpl( type.population, wloc.location ); + if( type.Population!=null && wloc.world==WorldDefinition.World) + stationListener = new StationListenerImpl( type.Population, wloc.location ); } /// <summary> Modified: branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -65,9 +65,9 @@ if (wloc.world == WorldDefinition.World) this.subsidiary = new SubsidiaryCompany(this, initiallyOwned); - if (type.population != null) + if (type.Population != null) stationListener = new StationListenerImpl( - new MultiplierPopulation(height, type.population), baseLocation); + new MultiplierPopulation(height, type.Population), baseLocation); } /// <summary> Voxels that form this structure </summary> @@ -97,7 +97,7 @@ /// <summary> /// /// </summary> - public override string name { get { return type.name; } } + public override string name { get { return type.Name; } } /// <summary> /// /// </summary> @@ -105,7 +105,7 @@ { get { - return type.price * height; + return type.Price * height; } } /// <summary> @@ -146,7 +146,7 @@ { get { - return height * type.price; + return height * type.Price; } } /// <summary> Modified: branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -116,7 +116,7 @@ /// <param name="pixelSize"></param> /// <returns></returns> [CLSCompliant(false)] - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, new Size(10, 1), 0); for (int x = 9; x >= 0; x--) @@ -133,7 +133,7 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { return new ControllerImpl(this, site, false); } @@ -143,7 +143,7 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { return new ControllerImpl(this, site, true); } Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -62,39 +62,39 @@ { XmlNode xn = e.SelectSingleNode("structure"); if (xn != null) - _categories = new StructCategories(xn, this.id); + Categories = new StructCategories(xn, this.id); else - _categories = new StructCategories(); + Categories = new StructCategories(); - if (_categories.Count == 0) + if (Categories.Count == 0) { StructCategory.Root.Entries.Add(this.id); - _categories.Add(StructCategory.Root); + Categories.Add(StructCategory.Root); } try { - _design = e.SelectSingleNode("design").InnerText; + Design = e.SelectSingleNode("design").InnerText; } catch { //! _design = "標準"; - _design = "default"; + Design = "default"; } try { - _unitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + UnitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); } catch { - _unitPrice = 0; + UnitPrice = 0; } Size = new Size(1, 1); - _minHeight = 2; - _maxHeight = 0; + MinHeight = 2; + MaxHeight = 0; } /// <summary> Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -48,15 +48,15 @@ /// <summary> /// /// </summary> - UNKNOWN, + Unknown, /// <summary> /// /// </summary> - BASIC, + Basic, /// <summary> /// /// </summary> - VARHEIGHT + VarHeight }; /// <summary> @@ -69,40 +69,84 @@ /// <summary> /// /// </summary> - protected static readonly Char[] spliter = new Char[] { '|' }; - /// <summary> sub type of this structure. </summary> - [CLSCompliant(false)] - protected StructCategories _categories; + private static readonly Char[] splitter = new Char[] { '|' }; + /// <summary> /// /// </summary> - public StructCategories categories { get { return _categories; } } + protected static Char[] Splitter + { + get { return GenericStructureContribution.splitter; } + } + /// <summary> sub type of this structure. </summary> - [CLSCompliant(false)] - protected string _design; + private StructCategories categories; /// <summary> /// /// </summary> - public string design { get { return _design; } } - /// <summary> unit price of this structure. equals to whole price for fixed height. </summary> - protected int _unitPrice; + public StructCategories Categories + { + get + { + return categories; + } + set + { + categories = value; + } + } + /// <summary> sub type of this structure. </summary> + private string design; /// <summary> /// /// </summary> - public int UnitPrice { get { return _unitPrice; } } + public string Design + { + get + { + return design; + } + set + { + design = value; + } + } + /// <summary> unit price of this structure. equals to whole price for fixed height. </summary> + int unitPrice; /// <summary> /// /// </summary> - public override int price { get { return _unitPrice; } } - /// <summary> - /// - /// </summary> - protected int _areaPrice; - /// <summary> - /// - /// </summary> - public override double pricePerArea { get { return _areaPrice; } } + public int UnitPrice + { + get + { + return unitPrice; + } + set + { + unitPrice = value; + } + } + ///// <summary> + ///// + ///// </summary> + //int pricePerArea; + ///// <summary> + ///// + ///// </summary> + //public override double PricePerArea + //{ + // get + // { + // return pricePerArea; + // } + // set + // { + // pricePerArea = value; + // } + //} + private Size size; /// <summary> @@ -121,24 +165,44 @@ } /// <summary> valid for variable height structure only. </summary> - [CLSCompliant(false)] - protected int _minHeight; + int minHeight; /// <summary> /// /// </summary> - public int MinHeight { get { return _minHeight; } } + public int MinHeight + { + get + { + return minHeight; + } + set + { + minHeight = value; + } + } /// <summary> used as well as fixed height structure. </summary> - protected int _maxHeight; + private int maxHeight; /// <summary> /// /// </summary> - public int MaxHeight { get { return _maxHeight; } } + public int MaxHeight + { + get + { + return maxHeight; + } + set + { + maxHeight = value; + } + } + /// <summary> sprite table type of this structure. </summary> - protected SpriteTableType stType = SpriteTableType.UNKNOWN; + SpriteTableType stType = SpriteTableType.Unknown; /// <summary> /// /// </summary> - public SpriteTableType patternType { get { return stType; } } + public SpriteTableType PatternType { get { return stType; } } internal Contribution[,] contribs; /// <summary> @@ -232,7 +296,7 @@ /// <returns></returns> public override string ToString() { - return name; + return Name; } /// <summary> @@ -255,45 +319,45 @@ { XmlNode xn = e.SelectSingleNode("structure"); if (xn != null) - _categories = new StructCategories(xn, this.id); + categories = new StructCategories(xn, this.id); else - _categories = new StructCategories(); + categories = new StructCategories(); - if (_categories.Count == 0) + if (categories.Count == 0) { StructCategory.Root.Entries.Add(this.id); - _categories.Add(StructCategory.Root); + categories.Add(StructCategory.Root); } try { - _design = e.SelectSingleNode("design").InnerText; + design = e.SelectSingleNode("design").InnerText; } catch { //! _design = "標準"; - _design = "default"; + design = "default"; } - _unitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + unitPrice = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); size = XmlUtil.ParseSize(XmlUtil.SelectSingleNode(e, "size").InnerText); - _areaPrice = _unitPrice / Math.Max(1, size.Width * size.Height); + PricePerArea = unitPrice / Math.Max(1, size.Width * size.Height); - _minHeight = 2; + minHeight = 2; try { - _maxHeight = int.Parse(e.SelectSingleNode("maxHeight").InnerText); + maxHeight = int.Parse(e.SelectSingleNode("maxHeight").InnerText); try { // if minHeight is not defined, use default. - _minHeight = int.Parse(e.SelectSingleNode("minHeight").InnerText); + minHeight = int.Parse(e.SelectSingleNode("minHeight").InnerText); } catch { } } catch { // if maxHeight tag is nod find, height tag must be exist. - _maxHeight = int.Parse(XmlUtil.SelectSingleNode(e, "height").InnerText); + maxHeight = int.Parse(XmlUtil.SelectSingleNode(e, "height").InnerText); } } /// <summary> @@ -321,10 +385,10 @@ { switch (stType) { - case SpriteTableType.UNKNOWN: - stType = SpriteTableType.BASIC; + case SpriteTableType.Unknown: + stType = SpriteTableType.Basic; break; - case SpriteTableType.BASIC: + case SpriteTableType.Basic: break; default: throw new FormatException("<sprite> tag is not available together with <pictures> or <sprites> tags."); @@ -335,10 +399,10 @@ { switch (stType) { - case SpriteTableType.UNKNOWN: - stType = SpriteTableType.VARHEIGHT; + case SpriteTableType.Unknown: + stType = SpriteTableType.VarHeight; break; - case SpriteTableType.VARHEIGHT: + case SpriteTableType.VarHeight: break; default: throw new FormatException("<" + child.Name + "> tag is not available together with <sprite> tag."); @@ -388,7 +452,7 @@ { bool opposite = (sprite.Attributes["opposite"] != null && sprite.Attributes["opposite"].Value.Equals("true")); Contribution newContrib; - if (stType == SpriteTableType.VARHEIGHT) + if (stType == SpriteTableType.VarHeight) { foreach (XmlNode child in sprite.ChildNodes) child.AppendChild(color.Clone()); @@ -415,7 +479,7 @@ if (cn.Name.Equals("direction")) { string front = cn.Attributes["front"].Value; - string[] dirs = front.ToUpper().Split(spliter); + string[] dirs = front.ToUpper().Split(splitter); for (int i = 0; i < dirs.Length; i++) { c++; @@ -467,9 +531,9 @@ /// <param name="pixelSize"></param> /// <returns></returns> [CLSCompliant(false)] - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { - return current.createPreview(pixelSize); + return current.CreatePreview(pixelSize); } /// <summary> /// @@ -477,9 +541,9 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { - return current.createBuilder(site); + return current.CreateBuilder(site); } /// <summary> /// @@ -487,9 +551,9 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { - return current.createRemover(site); + return current.CreateRemover(site); } } Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -355,7 +355,7 @@ } else { - using (PreviewDrawer drawer = current.current.createPreview(previewBox.Size)) + using (PreviewDrawer drawer = current.current.CreatePreview(previewBox.Size)) { if (previewBitmap != null) previewBitmap.Dispose(); @@ -832,7 +832,7 @@ { GenericStructureContribution contrib = (GenericStructureContribution)PluginManager.theInstance.getContribution((string)cat.Entries[i]); - string key = contrib.name; + string key = contrib.Name; if (!worktable.ContainsKey(key)) { typeBox.Items.Add(contrib); @@ -858,7 +858,7 @@ for (int i = 0; i < n; i++) { GenericStructureContribution contrib = arrCont[i]; - string key = contrib.name; + string key = contrib.Name; if (!typeMap.ContainsKey(key)) { typeBox.Items.Add(contrib); @@ -880,7 +880,7 @@ if (current.current is VarHeightBuildingContribution) { VarHeightBuildingContribution vhb = (VarHeightBuildingContribution)current.current; - p = vhb.price * (int)numHeight.Value; + p = vhb.Price * (int)numHeight.Value; } else p = current.UnitPrice; @@ -895,20 +895,20 @@ { string buf = ""; - int n = current.categories.Count; - buf += current.categories[0].name; + int n = current.Categories.Count; + buf += current.Categories[0].name; for (int i = 1; i < n; i++) - buf += ";" + current.categories[i].name; + buf += ";" + current.Categories[i].name; buf += "\nMax population:"; //! buf += "\n最大人口:"; - if (current.population == null) + if (current.Population == null) buf += "N/A"; else { if (current.current is VarHeightBuildingContribution) - buf += current.population.residents * (int)numHeight.Value; + buf += current.Population.residents * (int)numHeight.Value; else - buf += current.population.residents; + buf += current.Population.residents; } return buf; @@ -928,7 +928,7 @@ IEnumerator ie = designMap.GetEnumerator(); int i = 0; while (ie.MoveNext()) - subNames[i++] = ((GenericStructureContribution)ie.Current).design; + subNames[i++] = ((GenericStructureContribution)ie.Current).Design; selectorDesign.count = designMap.Count; bool b = (selectorDesign.count > 1); Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -220,7 +220,7 @@ RoadAccessoryContribution builder = (RoadAccessoryContribution)typeBox.SelectedItem; if (builder != null) { - using (PreviewDrawer drawer = builder.createPreview(preview.Size)) + using (PreviewDrawer drawer = builder.CreatePreview(preview.Size)) { if (previewBitmap != null) previewBitmap.Dispose(); preview.Image = previewBitmap = drawer.createBitmap(); Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -69,7 +69,7 @@ /// <param name="pixelSize"></param> /// <returns></returns> [CLSCompliant(false)] - public override PreviewDrawer createPreview(Size pixelSize) + public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, new Size(10, 1), 0); for (int x = 9; x >= 0; x--) @@ -86,7 +86,7 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createBuilder(IControllerSite site) + public override IModalController CreateBuilder(IControllerSite site) { return new ControllerImpl(this, site, false); } @@ -96,7 +96,7 @@ /// <param name="site"></param> /// <returns></returns> [CLSCompliant(false)] - public override IModalController createRemover(IControllerSite site) + public override IModalController CreateRemover(IControllerSite site) { return new ControllerImpl(this, site, true); } Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs 2008-04-08 07:17:40 UTC (rev 348) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs 2008-04-08 08:01:22 UTC (rev 349) @@ -437,8 +437,8 @@ { idxColor.count = currentContrib.colors.size; idxColor2.count = currentContrib.getHighlihtPatternCount(); - namelabel.Text = currentContrib.name; - price.cost = currentContrib.price; + namelabel.Text = currentContrib.Name; + price.cost = currentContrib.Price; onButtonClicked(sender, e); onColorChanged(sender, e); onColor2Changed(... [truncated message content] |
From: <je...@us...> - 2008-04-08 16:58:38
|
Revision: 350 http://freetrain.svn.sourceforge.net/freetrain/?rev=350&view=rev Author: jendave Date: 2008-04-08 09:56:34 -0700 (Tue, 08 Apr 2008) Log Message: ----------- lots of renaming. Split out multiple classes from single files Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/IPreviewWorldBuilder.cs branches/FreeTrainSDL/core/Contributions/Common/LineContribution.cs branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/StructureGroup.cs branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/Contributions/Train/AbstractTrainContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Train/AsymTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/SymTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/TrainCarContribution.cs branches/FreeTrainSDL/core/Contributions/Train/TrainContribution.cs branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/SpecialPurposeRailController.cs branches/FreeTrainSDL/core/Controllers/Rail/StationPassagewayController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Controllers/Structs/FixedSizeStructController.cs branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/Framework/Core.cs branches/FreeTrainSDL/core/Framework/Graphics/AlphaBlendSpriteSet.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorLibrary.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/DefaultSpriteLoaderContributionImpl.cs branches/FreeTrainSDL/core/Framework/Graphics/DirectSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/ISprite.cs branches/FreeTrainSDL/core/Framework/Graphics/NullSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs branches/FreeTrainSDL/core/Framework/Graphics/SimpleSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactory.cs branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactoryContribution.cs branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginSerializationBinder.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/Views/WeatherOverlayImpl.cs branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/LandPlan.cs branches/FreeTrainSDL/core/World/Development/VarHeightBuildingPlan.cs branches/FreeTrainSDL/core/World/Land/LandPropertyVoxel.cs branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs branches/FreeTrainSDL/core/World/RRCrossing.cs branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/World/Rail/BridgeRail.cs branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs branches/FreeTrainSDL/core/World/Rail/PassagewayRail.cs branches/FreeTrainSDL/core/World/Rail/RailRoad.cs branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs branches/FreeTrainSDL/core/World/Rail/ThinPlatform.cs branches/FreeTrainSDL/core/World/Rail/Train.cs branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs branches/FreeTrainSDL/core/World/Structs/Commercial.cs branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCar.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSprite.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigDialog.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Added Paths: ----------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs branches/FreeTrainSDL/core/Contributions/Common/StructureGroupGroup.cs Removed Paths: ------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -45,16 +45,17 @@ protected FixedSizeStructureContribution(XmlElement e) : base(e) { - _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + this.Price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); Size sz = XmlUtil.ParseSize(XmlUtil.SelectSingleNode(e, "size").InnerText); int height = int.Parse(XmlUtil.SelectSingleNode(e, "height").InnerText); this.size = new Distance(sz, height); - _ppa = _price / Math.Max(1, size.x * size.y); + this.PricePerArea = this.Price / Math.Max(1, size.x * size.y); XmlElement spr = (XmlElement)XmlUtil.SelectSingleNode(e, "sprite"); sprites = PluginUtil.getSpriteLoader(spr).load3D(spr, size.x, size.y, height); } + /// <summary> /// /// </summary> @@ -65,43 +66,41 @@ public FixedSizeStructureContribution(IAbstractStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main) { - _price = master.UnitPrice; + this.Price = master.UnitPrice; int height = master.MaxHeight; if (opposite) size = new Distance(master.Size.Height, master.Size.Width, height); else this.size = new Distance(master.Size, height); - _ppa = _price / Math.Max(1, size.x * size.y); + this.PricePerArea = this.Price / Math.Max(1, size.x * size.y); sprites = PluginUtil.getSpriteLoader(pic).load3D(pic, size.x, size.y, height); } - /// <summary>Price of this structure.</summary> - [CLSCompliant(false)] - protected readonly int _price; // TODO: should be moved up /// <summary> - /// + /// Sprite set to draw this structure. Indexed as [x,y,z] + /// and may contain null if there's no need to draw that voxel. /// </summary> - public override int Price { get { return _price; } } + private readonly ISprite[, ,] sprites; + /// <summary> /// /// </summary> - [CLSCompliant(false)] - protected readonly double _ppa; - /// <summary> - /// - /// </summary> - public override double PricePerArea { get { return _ppa; } } + public ISprite[, ,] Sprites + { + get { return sprites; } + } + /// <summary> Size of this structure in voxel by voxel. </summary> + private readonly Distance size; /// <summary> - /// Sprite set to draw this structure. Indexed as [x,y,z] - /// and may contain null if there's no need to draw that voxel. + /// /// </summary> - public readonly ISprite[, ,] sprites; + public Distance Size + { + get { return size; } + } - /// <summary> Size of this structure in voxel by voxel. </summary> - public readonly Distance size; - /// <summary> /// Creates a new instance of this structure type to the specified location. /// </summary> @@ -110,43 +109,45 @@ /// structure is initially owned or not. Otherwise this flag has no effect. /// </param> /// <param name="baseLoc"></param> - public Structure create(Location baseLoc, bool initiallyOwned) + public Structure Create(Location baseLoc, bool initiallyOwned) { - return create(new WorldLocator(WorldDefinition.World, baseLoc), initiallyOwned); + return Create(new WorldLocator(WorldDefinition.World, baseLoc), initiallyOwned); } + /// <summary> /// /// </summary> /// <param name="wloc"></param> /// <param name="initiallyOwned"></param> /// <returns></returns> - public abstract Structure create(WorldLocator wloc, bool initiallyOwned); + public abstract Structure Create(WorldLocator wloc, bool initiallyOwned); - // this method differs from the create method in its return type. - // delegates are so inflexible that we have to do this kind of adjustment. - /// <summary> - /// - /// </summary> - /// <param name="baseLoc"></param> - public void create2(Location baseLoc) - { - create(new WorldLocator(WorldDefinition.World, baseLoc), false); - } + //// this method differs from the create method in its return type. + //// delegates are so inflexible that we have to do this kind of adjustment. + ///// <summary> + ///// + ///// </summary> + ///// <param name="baseLoc"></param> + //public void create2(Location baseLoc) + //{ + // Create(new WorldLocator(WorldDefinition.World, baseLoc), false); + //} /// <summary> /// Returns true iff this structure can be built at the specified location. /// </summary> - public abstract bool canBeBuilt(Location baseLoc, ControlMode cm); + public abstract bool CanBeBuilt(Location baseLoc, ControlMode cm); /// <summary> /// /// </summary> /// <param name="d"></param> /// <returns></returns> - public ISprite getSprite(Distance d) + public ISprite GetSprite(Distance d) { return sprites[d.x, d.y, d.z]; } + /// <summary> /// /// </summary> @@ -158,6 +159,7 @@ drawer.drawCenter(sprites); return drawer; } + /// <summary> /// /// </summary> @@ -167,6 +169,7 @@ { return new FixedSizeStructurePlacementController(this, site); } + /// <summary> /// /// </summary> @@ -176,6 +179,7 @@ { return new FixedSizeStructureRemovalController(this, site); } + #region IPreviewWorldBuilder o /// <summary> /// @@ -187,7 +191,7 @@ { WorldDefinition w = WorldDefinition.CreatePreviewWorld(minsizePixel, size); Location l = w.toXYZ((w.Size.x - size.x + size.y) / 2, w.Size.y - size.y - 2, 0); - create(new WorldLocator(w, l), false); + Create(new WorldLocator(w, l), false); return w; } Deleted: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureController.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -1,166 +0,0 @@ -#region LICENSE -/* - * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#endregion LICENSE - -using System; -using System.Drawing; -using System.Windows.Forms; -using FreeTrain.Controllers; -using FreeTrain.Framework; -using FreeTrain.Framework.Graphics; -using FreeTrain.Views; -using FreeTrain.World; -using FreeTrain.World.Structs; - -namespace FreeTrain.Contributions.Common -{ - /// <summary> - /// FixedSizeStructureController - /// </summary> - public class FixedSizeStructurePlacementController : CubeSelectorController, IMapOverlay - { - /// <summary> - /// - /// </summary> - protected readonly FixedSizeStructureContribution contrib; - - private readonly AlphaBlendSpriteSet alphaSprites; - - - /// <summary> - /// - /// </summary> - /// <param name="_contrib"></param> - /// <param name="_site"></param> - public FixedSizeStructurePlacementController(FixedSizeStructureContribution _contrib, IControllerSite _site) - : base(_contrib.size, _site) - { - this.contrib = _contrib; - this.alphaSprites = new AlphaBlendSpriteSet(contrib.sprites); - } - /// <summary> - /// - /// </summary> - /// <param name="cube"></param> - protected override void onSelected(Cube cube) - { - if (contrib.canBeBuilt(cube.corner, ControlMode.Player)) - { - MessageBox.Show("Can not build"); - //! MessageBox.Show("設置できません"); - } - else - { - CompletionHandler handler = new CompletionHandler(contrib, cube.corner, true); - new ConstructionSite(cube.corner, new EventHandler(handler.handle), contrib.size); - } - } - /// <summary> - /// - /// </summary> - public override void OnDetached() - { - alphaSprites.Dispose(); - } - - /// <summary> - /// - /// </summary> - /// <param name="view"></param> - /// <param name="surface"></param> - public void DrawBefore(QuarterViewDrawer view, DrawContext surface) { } - /// <summary> - /// - /// </summary> - /// <param name="view"></param> - /// <param name="canvas"></param> - /// <param name="loc"></param> - /// <param name="pt"></param> - public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) - { - if (currentCube.contains(loc)) - alphaSprites.getSprite(loc - this.location).drawAlpha(canvas.Surface, pt); - } - /// <summary> - /// - /// </summary> - /// <param name="view"></param> - /// <param name="surface"></param> - public void DrawAfter(QuarterViewDrawer view, DrawContext surface) { } - - - [Serializable] - private class CompletionHandler - { - internal CompletionHandler(FixedSizeStructureContribution contribution, Location loc, bool owned) - { - this.contribution = contribution; - this.loc = loc; - this.owned = owned; - } - private readonly FixedSizeStructureContribution contribution; - private readonly Location loc; - private readonly bool owned; - /// <summary> - /// - /// </summary> - /// <param name="sender"></param> - /// <param name="args"></param> - public void handle(object sender, EventArgs args) - { - contribution.create(loc, owned); - } - } - } - /// <summary> - /// - /// </summary> - public class FixedSizeStructureRemovalController : CubeSelectorController - { - /// <summary> - /// - /// </summary> - protected readonly FixedSizeStructureContribution contrib; - /// <summary> - /// - /// </summary> - /// <param name="_contrib"></param> - /// <param name="_site"></param> - public FixedSizeStructureRemovalController(FixedSizeStructureContribution _contrib, IControllerSite _site) - : base(_contrib.size, _site) - { - this.contrib = _contrib; - } - /// <summary> - /// - /// </summary> - /// <param name="cube"></param> - protected override void onSelected(Cube cube) - { - PThreeDimStructure s = WorldDefinition.World.GetEntityAt(cube.corner) as PThreeDimStructure; - if (s == null || s.type != contrib) - { - MessageBox.Show("Wrong type"); - //! MessageBox.Show("種類が違います"); - return; - } - s.remove(); - } - } -} Added: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs (rev 0) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -0,0 +1,141 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Drawing; +using System.Windows.Forms; +using FreeTrain.Controllers; +using FreeTrain.Framework; +using FreeTrain.Framework.Graphics; +using FreeTrain.Views; +using FreeTrain.World; +using FreeTrain.World.Structs; + +namespace FreeTrain.Contributions.Common +{ + /// <summary> + /// FixedSizeStructureController + /// </summary> + public class FixedSizeStructurePlacementController : CubeSelectorController, IMapOverlay + { + /// <summary> + /// + /// </summary> + private readonly FixedSizeStructureContribution contrib; + + /// <summary> + /// + /// </summary> + protected FixedSizeStructureContribution Contrib + { + get { return contrib; } + } + + private readonly AlphaBlendSpriteSet alphaSprites; + + /// <summary> + /// + /// </summary> + /// <param name="contrib"></param> + /// <param name="site"></param> + public FixedSizeStructurePlacementController(FixedSizeStructureContribution contrib, IControllerSite site) + : base(contrib.Size, site) + { + this.contrib = contrib; + this.alphaSprites = new AlphaBlendSpriteSet(this.contrib.Sprites); + } + + /// <summary> + /// + /// </summary> + /// <param name="cube"></param> + protected override void OnSelected(Cube cube) + { + if (contrib.CanBeBuilt(cube.corner, ControlMode.Player)) + { + MessageBox.Show("Can not build"); + //! MessageBox.Show("設置できません"); + } + else + { + CompletionHandler handler = new CompletionHandler(contrib, cube.corner, true); + new ConstructionSite(cube.corner, new EventHandler(handler.handle), contrib.Size); + } + } + + /// <summary> + /// + /// </summary> + public override void OnDetached() + { + alphaSprites.Dispose(); + } + + /// <summary> + /// + /// </summary> + /// <param name="view"></param> + /// <param name="surface"></param> + public void DrawBefore(QuarterViewDrawer view, DrawContext surface) { } + + /// <summary> + /// + /// </summary> + /// <param name="view"></param> + /// <param name="canvas"></param> + /// <param name="loc"></param> + /// <param name="pt"></param> + public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) + { + if (currentCube.contains(loc)) + alphaSprites.getSprite(loc - this.location).DrawAlpha(canvas.Surface, pt); + } + + /// <summary> + /// + /// </summary> + /// <param name="view"></param> + /// <param name="surface"></param> + public void DrawAfter(QuarterViewDrawer view, DrawContext surface) { } + + [Serializable] + private class CompletionHandler + { + internal CompletionHandler(FixedSizeStructureContribution contribution, Location loc, bool owned) + { + this.contribution = contribution; + this.loc = loc; + this.owned = owned; + } + private readonly FixedSizeStructureContribution contribution; + private readonly Location loc; + private readonly bool owned; + /// <summary> + /// + /// </summary> + /// <param name="sender"></param> + /// <param name="args"></param> + public void handle(object sender, EventArgs args) + { + contribution.Create(loc, owned); + } + } + } +} Property changes on: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Added: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs (rev 0) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -0,0 +1,70 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Drawing; +using System.Windows.Forms; +using FreeTrain.Controllers; +using FreeTrain.Framework; +using FreeTrain.Framework.Graphics; +using FreeTrain.Views; +using FreeTrain.World; +using FreeTrain.World.Structs; + +namespace FreeTrain.Contributions.Common +{ + /// <summary> + /// + /// </summary> + public class FixedSizeStructureRemovalController : CubeSelectorController + { + /// <summary> + /// + /// </summary> + protected readonly FixedSizeStructureContribution contrib; + + /// <summary> + /// + /// </summary> + /// <param name="contrib"></param> + /// <param name="site"></param> + public FixedSizeStructureRemovalController(FixedSizeStructureContribution contrib, IControllerSite site) + : base(contrib.Size, site) + { + this.contrib = contrib; + } + + /// <summary> + /// + /// </summary> + /// <param name="cube"></param> + protected override void OnSelected(Cube cube) + { + PThreeDimStructure s = WorldDefinition.World.GetEntityAt(cube.corner) as PThreeDimStructure; + if (s == null || s.type != contrib) + { + MessageBox.Show("Wrong type"); + //! MessageBox.Show("種類が違います"); + return; + } + s.remove(); + } + } +} Property changes on: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Modified: branches/FreeTrainSDL/core/Contributions/Common/IPreviewWorldBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/IPreviewWorldBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/IPreviewWorldBuilder.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -33,9 +33,9 @@ /// <summary> /// /// </summary> - /// <param name="minsizePixel"></param> + /// <param name="minSizePixel"></param> /// <param name="options"></param> /// <returns></returns> - WorldDefinition CreatePreviewWorld(Size minsizePixel, IDictionary options); + WorldDefinition CreatePreviewWorld(Size minSizePixel, IDictionary options); } } Modified: branches/FreeTrainSDL/core/Contributions/Common/LineContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/LineContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/LineContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -41,37 +41,38 @@ /// <summary> /// Returns true if rails can be built between the two given locations /// </summary> - public abstract bool canBeBuilt(Location loc1, Location loc2); + public abstract bool CanBeBuilt(Location loc1, Location loc2); /// <summary> /// Builds rail roads between the two given locations. /// This method will be called only when canBeBuilt(loc1,loc2) returns true. /// </summary> - public abstract void build(Location loc1, Location loc2); + public abstract void Build(Location loc1, Location loc2); /// <summary> /// Removes this special rail road between the given two locations. /// It is not an error for some other kinds of rail to appear in between /// these two. /// </summary> - public abstract void remove(Location loc1, Location loc2); + public abstract void Remove(Location loc1, Location loc2); /// <summary> /// Gets the name of this special rail. /// </summary> - public abstract string name { get; } + public abstract string Name { get; } /// <summary> /// Gets a one line description of this rail. /// </summary> - public abstract string oneLineDescription { get; } + public abstract string OneLineDescription { get; } /// <summary> /// Gets the bitmap that will be used in the construction dialog. /// Should reload a fresh copy every time this method is called. /// The caller should dispose the object if it becomes unnecessary. /// </summary> - public abstract Bitmap previewBitmap { get; } + public abstract Bitmap PreviewBitmap { get; } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/PictureContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -34,17 +34,26 @@ /// <summary> /// /// </summary> - public readonly Picture picture; + private readonly Picture picture; + /// <summary> /// /// </summary> + public Picture Picture + { + get { return picture; } + } + + /// <summary> + /// + /// </summary> /// <param name="e"></param> public PictureContribution(XmlElement e) : base(e) { picture = new Picture( (XmlElement)XmlUtil.SelectSingleNode(e, "picture"), - this.id); + this.Id); // picture object will register itself to the manager. } } Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -41,7 +41,6 @@ [Serializable] public abstract class StructureContribution : Contribution, IEntityBuilder { - /// <summary> /// Parses a structure contribution from a DOM node. /// </summary> @@ -49,13 +48,14 @@ protected StructureContribution(XmlElement e) : base(e) { - core = new EntityBuilderInternal(e, this.id); + core = new EntityBuilderInternal(e, this.Id); XmlNode groupNode = e.SelectSingleNode("group"); string groupName = (groupNode != null) ? groupNode.InnerText : core.Name; - group = getGroup(groupName); - group.add(this); + group = GetGroup(groupName); + group.Add(this); } + /// <summary> /// /// </summary> @@ -68,13 +68,24 @@ core = original; group = original.group; } + /// <summary> /// /// </summary> - internal protected IEntityBuilder core; + private IEntityBuilder core; + /// <summary> /// /// </summary> + protected internal IEntityBuilder Core + { + get { return core; } + set { core = value; } + } + + /// <summary> + /// + /// </summary> private readonly StructureGroup group; /// <summary> @@ -85,18 +96,18 @@ get { return group; } } - /// <summary> /// Implemented by the derived class and /// used to determine which group this structure should go. /// </summary> - protected abstract StructureGroup getGroup(string name); + protected abstract StructureGroup GetGroup(string name); /// <summary> /// Name of this entity builder. Primarily used as the display name. /// Doesn't need to be unique. /// </summary> public virtual string Name { get { return core.Name; } } + /// <summary> /// /// </summary> @@ -113,6 +124,7 @@ /// True if the player is not allowed to build this structure. /// </summary> public bool PlayerCannotBuild { get { return core.PlayerCannotBuild; } } + /// <summary> /// /// </summary> @@ -149,6 +161,7 @@ /// <param name="pixelSize"></param> /// <returns></returns> public virtual PreviewDrawer CreatePreview(Size pixelSize) { return core.CreatePreview(pixelSize); } + /// <summary> /// /// </summary> @@ -196,7 +209,6 @@ new PopulationReferenceImpl(ownerId)); } - private readonly BasePopulation _population; private readonly bool _computerCannotBuild; private readonly bool _playerCannotBuild; @@ -288,6 +300,7 @@ { internal PopulationReferenceImpl(string id) { this.id = id; } private string id; + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureGroup.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureGroup.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -32,102 +32,56 @@ /// <summary> /// /// </summary> - /// <param name="_name"></param> - public StructureGroup(string _name) + /// <param name="name"></param> + public StructureGroup(string name) { - this.name = _name; + this.name = name; } /// <summary> Name of this group. </summary> - public string name; + private string name; /// <summary> /// /// </summary> + public string Name + { + get { return name; } + set { name = value; } + } + + /// <summary> + /// + /// </summary> /// <param name="sc"></param> - public void add(StructureContribution sc) + public void Add(StructureContribution sc) { base.List.Add(sc); } + /// <summary> /// /// </summary> /// <param name="idx"></param> /// <returns></returns> - public StructureContribution get(int idx) + public StructureContribution Get(int idx) { return (StructureContribution)base.List[idx]; } + /// <summary> /// /// </summary> /// <param name="sc"></param> - public void remove(StructureContribution sc) + public void Remove(StructureContribution sc) { base.List.Remove(sc); } + /// <summary> /// /// </summary> /// <returns></returns> public override string ToString() { return name; } } - - /// <summary> - /// Group of StructureGroups. - /// - /// This object implements IListSource to support data-binding. - /// </summary> - public class StructureGroupGroup : IListSource - { - /// <summary> - /// - /// </summary> - public StructureGroupGroup() { } - /// <summary> - /// - /// </summary> - protected readonly Hashtable core = new Hashtable(); - // used for data-binding - /// <summary> - /// - /// </summary> - protected readonly ArrayList list = new ArrayList(); - /// <summary> - /// - /// </summary> - /// <param name="name"></param> - /// <returns></returns> - public StructureGroup this[string name] - { - get - { - StructureGroup g = (StructureGroup)core[name]; - if (g == null) - { - core[name] = g = new StructureGroup(name); - list.Add(g); - } - - return g; - } - } - /// <summary> - /// - /// </summary> - /// <returns></returns> - public IEnumerator getEnumerator() - { - return core.Values.GetEnumerator(); - } - /// <summary> - /// - /// </summary> - /// <returns></returns> - public IList GetList() { return list; } - /// <summary> - /// - /// </summary> - public bool ContainsListCollection { get { return true; } } - } } Added: branches/FreeTrainSDL/core/Contributions/Common/StructureGroupGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureGroupGroup.cs (rev 0) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureGroupGroup.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -0,0 +1,90 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Collections; +using System.ComponentModel; + +namespace FreeTrain.Contributions.Common +{ + /// <summary> + /// Group of StructureGroups. + /// + /// This object implements IListSource to support data-binding. + /// </summary> + public class StructureGroupGroup : IListSource + { + /// <summary> + /// + /// </summary> + public StructureGroupGroup() { } + + /// <summary> + /// + /// </summary> + protected readonly Hashtable core = new Hashtable(); + + // used for data-binding + /// <summary> + /// + /// </summary> + protected readonly ArrayList list = new ArrayList(); + + /// <summary> + /// + /// </summary> + /// <param name="name"></param> + /// <returns></returns> + public StructureGroup this[string name] + { + get + { + StructureGroup g = (StructureGroup)core[name]; + if (g == null) + { + core[name] = g = new StructureGroup(name); + list.Add(g); + } + + return g; + } + } + + /// <summary> + /// + /// </summary> + /// <returns></returns> + public IEnumerator getEnumerator() + { + return core.Values.GetEnumerator(); + } + + /// <summary> + /// + /// </summary> + /// <returns></returns> + public IList GetList() { return list; } + + /// <summary> + /// + /// </summary> + public bool ContainsListCollection { get { return true; } } + } +} Property changes on: branches/FreeTrainSDL/core/Contributions/Common/StructureGroupGroup.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Modified: branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -51,7 +51,7 @@ /// <summary> /// Gets the land that should be used to fill (x,y) within [x1,y1]-[x2,y2] (inclusive). /// </summary> - public override void create(int x1, int y1, int x2, int y2, int z, bool owned) + public override void Create(int x1, int y1, int x2, int y2, int z, bool owned) { bulldoze(new Location(x1, y1, z), new Location(x2, y2, z)); WorldDefinition.World.OnVoxelUpdated(new Cube(x1, y1, z, x2 - x1 + 1, y2 - y1 + 1, 1)); Modified: branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -63,7 +63,7 @@ /// <param name="loc2"></param> protected override void onRectSelected(Location loc1, Location loc2) { - contrib.create(loc1, loc2, true); + contrib.Create(loc1, loc2, true); } /// <summary> /// @@ -83,7 +83,7 @@ if (loc.z != currentLoc.z) return; if (anchor != UNPLACED && loc.inBetween(anchor, currentLoc)) - spriteBuilder().drawAlpha(canvas.Surface, pt); + spriteBuilder().DrawAlpha(canvas.Surface, pt); } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -49,39 +49,30 @@ { XmlNode gridNode = e.SelectSingleNode("grid"); if (gridNode == null) - _grid = new Size(1, 1); + grid = new Size(1, 1); else - _grid = XmlUtil.ParseSize(gridNode.InnerText); + grid = XmlUtil.ParseSize(gridNode.InnerText); - _price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); + this.Price = int.Parse(XmlUtil.SelectSingleNode(e, "price").InnerText); } - private readonly Size _grid; + private readonly Size grid; + /// <summary> /// /// </summary> - public Size Grid { get { return _grid; } } + public Size Grid { get { return grid; } } - /// <summary> Price of the land per voxel. </summary> - [CLSCompliant(false)] - protected readonly int _price; /// <summary> /// /// </summary> - public override int Price { get { return _price; } } - /// <summary> - /// - /// </summary> - public override double PricePerArea { get { return _price; } } - /// <summary> - /// - /// </summary> /// <param name="name"></param> /// <returns></returns> - protected override StructureGroup getGroup(string name) + protected override StructureGroup GetGroup(string name) { return (StructureGroup)PluginManager.theInstance.landBuilderGroup[name]; } + /// <summary> /// /// </summary> @@ -91,12 +82,12 @@ /// <param name="y2"></param> /// <param name="z"></param> /// <param name="owned"></param> - public abstract void create(int x1, int y1, int x2, int y2, int z, bool owned); + public abstract void Create(int x1, int y1, int x2, int y2, int z, bool owned); /// <summary> /// Fills the specified region with lands. /// </summary> - public void create(Location loc1, Location loc2, bool owned) + public void Create(Location loc1, Location loc2, bool owned) { Debug.Assert(loc1.z == loc2.z); int z = loc1.z; @@ -105,37 +96,38 @@ int wx, wy; if (loc1.x > loc2.x) { - wx = Math.Max(loc1.x - loc2.x, _grid.Width - 1); + wx = Math.Max(loc1.x - loc2.x, grid.Width - 1); maxx = loc1.x; - minx = maxx - wx + wx % _grid.Width; + minx = maxx - wx + wx % grid.Width; } else { - wx = Math.Max(loc2.x - loc1.x, _grid.Width - 1); + wx = Math.Max(loc2.x - loc1.x, grid.Width - 1); minx = loc1.x; - maxx = minx + wx - wx % _grid.Width; + maxx = minx + wx - wx % grid.Width; } if (loc1.y > loc2.y) { - wy = Math.Max(loc1.y - loc2.y, _grid.Height - 1); + wy = Math.Max(loc1.y - loc2.y, grid.Height - 1); maxy = loc1.y; - miny = maxy - wy + wy % _grid.Height; + miny = maxy - wy + wy % grid.Height; } else { - wy = Math.Max(loc2.y - loc1.y, _grid.Height - 1); + wy = Math.Max(loc2.y - loc1.y, grid.Height - 1); miny = loc1.y; - maxy = miny + wy - wy % _grid.Height; + maxy = miny + wy - wy % grid.Height; } - create(minx, miny, maxx, maxy, z, owned); + Create(minx, miny, maxx, maxy, z, owned); } /// <summary> Creates a single patch. </summary> - public void create(Location loc, bool owned) + public void Create(Location loc, bool owned) { - create(loc, loc, owned); + Create(loc, loc, owned); } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -33,9 +33,9 @@ /// <summary> /// /// </summary> - /// <param name="_name"></param> - public LandBuilderGroup(string _name) - : base(_name) + /// <param name="name"></param> + public LandBuilderGroup(string name) + : base(name) { } /// <summary> @@ -43,7 +43,7 @@ /// </summary> /// <param name="idx"></param> /// <returns></returns> - public new LandBuilderContribution get(int idx) + public LandBuilderContribution Get(int idx) { return (LandBuilderContribution)base.List[idx]; } @@ -51,7 +51,7 @@ /// /// </summary> /// <param name="sc"></param> - public void remove(LandBuilderContribution sc) + public void Remove(LandBuilderContribution sc) { base.List.Remove(sc); } @@ -59,7 +59,7 @@ /// /// </summary> /// <returns></returns> - public override string ToString() { return name; } + public override string ToString() { return Name; } } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -76,7 +76,7 @@ /// <param name="y2"></param> /// <param name="z"></param> /// <param name="owned"></param> - public override void create(int x1, int y1, int x2, int y2, int z, bool owned) + public override void Create(int x1, int y1, int x2, int y2, int z, bool owned) { for (int x = x1; x <= x2; x++) { Modified: branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -57,7 +57,7 @@ /// <summary> /// Gets the land that should be used to fill (x,y) within [x1,y1]-[x2,y2] (inclusive). /// </summary> - public override void create(int x1, int y1, int x2, int y2, int z, bool owned) + public override void Create(int x1, int y1, int x2, int y2, int z, bool owned) { for (int x = x1; x <= x2; x++) { Modified: branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -44,7 +44,7 @@ /// </summary> /// <param name="name"></param> /// <returns></returns> - protected override StructureGroup getGroup(string name) + protected override StructureGroup GetGroup(string name) { return PluginManager.theInstance.railStationaryGroup[name]; } @@ -54,7 +54,7 @@ /// <param name="wLoc"></param> /// <param name="initiallyOwned"></param> /// <returns></returns> - public override Structure create(WorldLocator wLoc, bool initiallyOwned) + public override Structure Create(WorldLocator wLoc, bool initiallyOwned) { return new RailStationaryStructure(this, wLoc); } @@ -64,9 +64,9 @@ /// <param name="baseLoc"></param> /// <param name="cm"></param> /// <returns></returns> - public override bool canBeBuilt(Location baseLoc, ControlMode cm) + public override bool CanBeBuilt(Location baseLoc, ControlMode cm) { - return RailStationaryStructure.canBeBuilt(baseLoc, size, cm); + return RailStationaryStructure.canBeBuilt(baseLoc, Size, cm); } } Modified: branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -51,7 +51,7 @@ /// </summary> /// <param name="name"></param> /// <returns></returns> - protected override StructureGroup getGroup(string name) + protected override StructureGroup GetGroup(string name) { return PluginManager.theInstance.stationGroup[name]; } @@ -61,7 +61,7 @@ /// <param name="wLoc"></param> /// <param name="initiallyOwned"></param> /// <returns></returns> - public override Structure create(WorldLocator wLoc, bool initiallyOwned) + public override Structure Create(WorldLocator wLoc, bool initiallyOwned) { return new Station(this, wLoc); } @@ -71,9 +71,9 @@ /// <param name="baseLoc"></param> /// <param name="cm"></param> /// <returns></returns> - public override bool canBeBuilt(Location baseLoc, ControlMode cm) + public override bool CanBeBuilt(Location baseLoc, ControlMode cm) { - return Station.canBeBuilt(baseLoc, size, cm); + return Station.canBeBuilt(baseLoc, Size, cm); } } } Modified: branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -41,7 +41,7 @@ : base(e) { // load resource, but don't dispose it as sprites will still refer to this surface. - Picture picture = getPicture(e); + Picture picture = GetPicture(e); sprites = new ISprite[3]; for (int i = 0; i < 3; i++) Modified: branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -62,7 +62,7 @@ /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> - public override bool canBeBuilt(Location from, Location to) + public override bool CanBeBuilt(Location from, Location to) { if (from == to) return false; @@ -94,9 +94,9 @@ /// </summary> /// <param name="from"></param> /// <param name="to"></param> - public override void build(Location from, Location to) + public override void Build(Location from, Location to) { - Debug.Assert(canBeBuilt(from, to)); + Debug.Assert(CanBeBuilt(from, to)); Direction d = from.getDirectionTo(to); @@ -136,7 +136,7 @@ /// </summary> /// <param name="here"></param> /// <param name="to"></param> - public override void remove(Location here, Location to) + public override void Remove(Location here, Location to) { if (here == to) return; @@ -155,7 +155,7 @@ /// <summary> /// /// </summary> - public override string name + public override string Name { get { @@ -165,7 +165,7 @@ /// <summary> /// /// </summary> - public override string oneLineDescription + public override string OneLineDescription { get { @@ -176,7 +176,7 @@ /// <summary> /// /// </summary> - public override Bitmap previewBitmap + public override Bitmap PreviewBitmap { get { @@ -236,7 +236,7 @@ /// <param name="pt"></param> public override void drawBefore(DrawContext display, Point pt) { - contribution.getSprite(pattern.dirs).draw(display.Surface, pt); + contribution.getSprite(pattern.dirs).Draw(display.Surface, pt); } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -44,7 +44,7 @@ : base(e) { // load resource, but don't dispose it as sprites will still refer to this surface. - Picture pic = getPicture(e); + Picture pic = GetPicture(e); XmlElement picture = (XmlElement)XmlUtil.SelectSingleNode(e, "picture"); Size sz = XmlUtil.ParseSize(picture.Attributes["size"].Value); Modified: branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs 2008-04-08 08:01:22 UTC (rev 349) +++ branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs 2008-04-08 16:56:34 UTC (rev 350) @@ -55,7 +55,7 @@ /// </summary> /// <param name="name"></param> /// <returns></returns> - protected override StructureGroup getGroup(string name) + protected override StructureGroup GetGroup(string name) { return PluginManager.theInstance.commercialStructureGroup[name]; } @@ -65,7 +65,7 @@ /// <param name="wLoc"></param> /// <param name="init... [truncated message content] |
From: <je...@us...> - 2008-04-08 17:59:07
|
Revision: 351 http://freetrain.svn.sourceforge.net/freetrain/?rev=351&view=rev Author: jendave Date: 2008-04-08 10:59:05 -0700 (Tue, 08 Apr 2008) Log Message: ----------- make it easier for Monodevelop to find the resource files Modified Paths: -------------- branches/FreeTrainSDL/core/FreeTrain.csproj Property Changed: ---------------- branches/FreeTrainSDL/plugins/Chiname.DummyCars/ branches/FreeTrainSDL/plugins/Chiname.Generic/ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/ Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-08 16:56:34 UTC (rev 350) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-08 17:59:05 UTC (rev 351) @@ -860,19 +860,45 @@ <Link>plugin.xml</Link> </Content> <Content Include="Contributions\readme.txt" /> - <Content Include="Res\Arrows.bmp" /> - <Content Include="Res\BridgePier.bmp" /> - <Content Include="Res\ConstructionBones.bmp" /> - <Content Include="Res\ConstructionFence.bmp" /> - <Content Include="Res\ConstructionGround.bmp" /> - <Content Include="Res\ConstructionWall.bmp" /> - <Content Include="Res\DayNight.bmp" /> - <Content Include="Res\EmptyChip.bmp" /> - <Content Include="Res\Item.bmp" /> - <Content Include="Res\RailRoads.bmp" /> - <Content Include="Res\Toolbar.bmp" /> - <Content Include="Res\ugslope.bmp" /> - <Content Include="Res\YardChip.bmp" /> + <Content Include="Res\Arrows.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\BridgePier.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\ConstructionBones.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\ConstructionFence.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\ConstructionGround.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\ConstructionWall.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\DayNight.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\EmptyChip.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\Item.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\RailRoads.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\Toolbar.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\ugslope.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Res\YardChip.bmp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> <EmbeddedResource Include="Contributions\Others\NewWorldDialog.resx"> <DependentUpon>NewWorldDialog.cs</DependentUpon> </EmbeddedResource> @@ -983,7 +1009,9 @@ <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.ja-JP.Designer.cs</LastGenOutput> </EmbeddedResource> - <EmbeddedResource Include="Res\splash.jpg" /> + <EmbeddedResource Include="Res\splash.jpg"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> <EmbeddedResource Include="Util\Command\CommandManager.resx"> <DependentUpon>CommandManager.cs</DependentUpon> </EmbeddedResource> Property changes on: branches/FreeTrainSDL/plugins/Chiname.DummyCars ___________________________________________________________________ Name: svn:ignore - Tao.Sdl.dll.config Tao.Sdl.dll SdlDotNet.dll.config SdlDotNet.dll FreeTrain.World.Road.DummyCars.dll.mdb FreeTrain.DummyCars.pidb FreeTrain.dll.mdb FreeTrain.dll FreeTrain.Controls.dll.mdb FreeTrain.Controls.dll ControllerForm.resources SDLGFX.net.xml DummyCars.dll DummyCars.pdb RoadAccessory.dll RoadAccessory.pdb RoadAccessory.XML SDLGFX.net.dll SDLGFX.net.pdb *.XML FreeTrain.DummyCars.dll FreeTrain.DummyCars.pdb FreeTrain.DummyCars.xml FreeTrain.RoadAccessory.dll FreeTrain.RoadAccessory.pdb FreeTrain.RoadAccessory.xml .plugin.xml.swp FreeTrain.World.Road.Accessory.dll FreeTrain.World.Road.Accessory.pdb FreeTrain.World.Road.DummyCars.dll FreeTrain.World.Road.DummyCars.pdb FreeTrain.World.Road.Accessory.xml FreeTrain.World.Road.DummyCars.xml obj + Tao.Sdl.dll.config Tao.Sdl.dll SdlDotNet.dll.config SdlDotNet.dll FreeTrain.World.Road.DummyCars.dll.mdb FreeTrain.DummyCars.pidb FreeTrain.dll.mdb FreeTrain.dll FreeTrain.Controls.dll.mdb FreeTrain.Controls.dll ControllerForm.resources SDLGFX.net.xml DummyCars.dll DummyCars.pdb RoadAccessory.dll RoadAccessory.pdb RoadAccessory.XML SDLGFX.net.dll SDLGFX.net.pdb *.XML FreeTrain.DummyCars.dll FreeTrain.DummyCars.pdb FreeTrain.DummyCars.xml FreeTrain.RoadAccessory.dll FreeTrain.RoadAccessory.pdb FreeTrain.RoadAccessory.xml .plugin.xml.swp FreeTrain.World.Road.Accessory.dll FreeTrain.World.Road.Accessory.pdb FreeTrain.World.Road.DummyCars.dll FreeTrain.World.Road.DummyCars.pdb FreeTrain.World.Road.Accessory.xml FreeTrain.World.Road.DummyCars.xml obj Res Property changes on: branches/FreeTrainSDL/plugins/Chiname.Generic ___________________________________________________________________ Name: svn:ignore - obj FreeTrain.ExpandedContributions.dll FreeTrain.ExpandedContributions.pdb FreeTrain.ExpandedContributions.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml *.tmp .plugin.xml.swp bin FreeTrain.Framework.Plugin.Generic.dll FreeTrain.Framework.Plugin.Generic.pdb FreeTrain.Framework.Plugin.Generic.xml + obj FreeTrain.ExpandedContributions.dll FreeTrain.ExpandedContributions.pdb FreeTrain.ExpandedContributions.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml *.tmp .plugin.xml.swp bin FreeTrain.Framework.Plugin.Generic.dll FreeTrain.Framework.Plugin.Generic.pdb FreeTrain.Framework.Plugin.Generic.xml Res Property changes on: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory ___________________________________________________________________ Name: svn:ignore - SDLGFX.net.xml DummyCars.dll DummyCars.pdb RoadAccessory.dll RoadAccessory.pdb RoadAccessory.XML SDLGFX.net.dll SDLGFX.net.pdb *.XML FreeTrain.DummyCars.dll FreeTrain.DummyCars.pdb FreeTrain.DummyCars.xml FreeTrain.RoadAccessory.dll FreeTrain.RoadAccessory.pdb FreeTrain.RoadAccessory.xml .plugin.xml.swp FreeTrain.World.Road.Accessory.dll FreeTrain.World.Road.Accessory.pdb FreeTrain.World.Road.DummyCars.dll FreeTrain.World.Road.DummyCars.pdb FreeTrain.World.Road.Accessory.xml FreeTrain.World.Road.DummyCars.xml obj + SDLGFX.net.xml DummyCars.dll DummyCars.pdb RoadAccessory.dll RoadAccessory.pdb RoadAccessory.XML SDLGFX.net.dll SDLGFX.net.pdb *.XML FreeTrain.DummyCars.dll FreeTrain.DummyCars.pdb FreeTrain.DummyCars.xml FreeTrain.RoadAccessory.dll FreeTrain.RoadAccessory.pdb FreeTrain.RoadAccessory.xml .plugin.xml.swp FreeTrain.World.Road.Accessory.dll FreeTrain.World.Road.Accessory.pdb FreeTrain.World.Road.DummyCars.dll FreeTrain.World.Road.DummyCars.pdb FreeTrain.World.Road.Accessory.xml FreeTrain.World.Road.DummyCars.xml obj Res Property changes on: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel ___________________________________________________________________ Name: svn:ignore - bin obj AxSHDocVw.dll FreeTrain.Controls.dll FreeTrain.Controls.pdb FreeTrain.Controls.xml FreeTrain.HalfVoxelStructure.dll FreeTrain.HalfVoxelStructure.pdb FreeTrain.HalfVoxelStructure.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml .plugin.xml.swp FreeTrain.World.Structs.HalfVoxelStructure.dll FreeTrain.World.Structs.HalfVoxelStructure.pdb FreeTrain.World.Structs.HalfVoxelStructure.xml + bin obj AxSHDocVw.dll FreeTrain.Controls.dll FreeTrain.Controls.pdb FreeTrain.Controls.xml FreeTrain.HalfVoxelStructure.dll FreeTrain.HalfVoxelStructure.pdb FreeTrain.HalfVoxelStructure.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml .plugin.xml.swp FreeTrain.World.Structs.HalfVoxelStructure.dll FreeTrain.World.Structs.HalfVoxelStructure.pdb FreeTrain.World.Structs.HalfVoxelStructure.xml Res Property changes on: branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain ___________________________________________________________________ Name: svn:ignore - bin obj FreeTrain.ColorTestTrain.dll FreeTrain.ColorTestTrain.pdb FreeTrain.ColorTestTrain.xml FreeTrain.World.Rail.ColorTestTrain.dll FreeTrain.World.Rail.ColorTestTrain.pdb FreeTrain.World.Rail.ColorTestTrain.xml + bin obj FreeTrain.ColorTestTrain.dll FreeTrain.ColorTestTrain.pdb FreeTrain.ColorTestTrain.xml FreeTrain.World.Rail.ColorTestTrain.dll FreeTrain.World.Rail.ColorTestTrain.pdb FreeTrain.World.Rail.ColorTestTrain.xml Res Property changes on: branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse ___________________________________________________________________ Name: svn:ignore - bin obj FreeTrain.VinylHouse.dll FreeTrain.VinylHouse.pdb FreeTrain.VinylHouse.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml .plugin.xml.swp FreeTrain.World.Land.VinylHouse.dll FreeTrain.World.Land.VinylHouse.pdb FreeTrain.World.Land.VinylHouse.xml + bin obj FreeTrain.VinylHouse.dll FreeTrain.VinylHouse.pdb FreeTrain.VinylHouse.xml SDLGFX.net.dll SDLGFX.net.pdb SDLGFX.net.xml .plugin.xml.swp FreeTrain.World.Land.VinylHouse.dll FreeTrain.World.Land.VinylHouse.pdb FreeTrain.World.Land.VinylHouse.xml Res This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-08 22:42:57
|
Revision: 353 http://freetrain.svn.sourceforge.net/freetrain/?rev=353&view=rev Author: jendave Date: 2008-04-08 15:34:08 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Some new dialogs in the Gui Modified Paths: -------------- branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.resx branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.Designer.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.resx branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.Designer.cs branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.resx branches/FreeTrainSDL/core/Framework/ConfigDialog.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/plugin.xml Added Paths: ----------- branches/FreeTrainSDL/gui/land.ico branches/FreeTrainSDL/gui/rail.ico branches/FreeTrainSDL/gui/train.ico Modified: branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.resx =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.resx 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.resx 2008-04-08 22:34:08 UTC (rev 353) @@ -249,6 +249,42 @@ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <value>164, 118</value> </data> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAHBUAAAEAGABgBwAAFgAAACgAAAAcAAAAKgAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AACqzM53mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3mZt3mZv///93mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6q + zM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM4AAAAA + AAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gAAAAAAACqzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM6qzM4AAAAAAAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gA + AAAAAACqzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6q + zM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6q + zM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM4AAAAA + AAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gAAAAAAACqzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM6qzM4AAAAAAAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gA + AAAAAACqzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6q + zM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6q + zM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM4AAAAA + AAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gAAAAAAACqzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM6qzM4AAAAAAAD///9md3gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///9md3gA + AAAAAACqzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6q + zM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6qzM6qzM6qzM7///9md3iqzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///////////////////////// + //////////////////////////////////////////////////////////////////////////8AAAB3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= +</value> + </data> <data name="$this.Text" xml:space="preserve"> <value>Railroad</value> </data> @@ -256,6 +292,6 @@ <value>RailRoadController</value> </data> <data name=">>$this.Type" xml:space="preserve"> - <value>FreeTrain.Controllers.AbstractControllerImpl, FreeTrain, Version=1.0.3012.24298, Culture=neutral, PublicKeyToken=bcc810b413ef8c1c</value> + <value>FreeTrain.Controllers.AbstractControllerImpl, FreeTrain, Version=1.0.3020.18062, Culture=neutral, PublicKeyToken=bcc810b413ef8c1c</value> </data> </root> \ No newline at end of file Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.Designer.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.Designer.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -254,6 +254,7 @@ this.ClientSize = new System.Drawing.Size(462, 222); this.Controls.Add(this.panel1); this.Controls.Add(this.panel2); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimumSize = new System.Drawing.Size(416, 195); this.Name = "TrainPlacementController"; this.Text = "Place Train"; Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.resx =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.resx 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.resx 2008-04-08 22:34:08 UTC (rev 353) @@ -172,4 +172,41 @@ AQEHAAEBBwABAQGABgABAQGABgABAwGAAQEEAAGAAf8BwAF/BAABwQH/AeAB/wQABP8EAAs= </value> </data> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAHBUAAAEAGABgBwAAFgAAACgAAAAcAAAAKgAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AACqzM53mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3mZt3mZv///93mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZsAAAB3mZt3mZv///+qzM6qzM6qzM53mZsAAAB3mZsAAAAAAAAAAAB3mZt3mZsAAAB3mZuq + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM4AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM4AAACqzM53mZt3mZt3mZsAAAAAAAAAAAAAAAB3mZt3mZt3mZuqzM4AAAAAAACqzM6q + zM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM53mZt3mZuqzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM53mZsAAAAAAAAAAACqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM4A + AAC67vG67vG67vG67vG67vF3mZu67vG67vG67vG67vG67vGqzM4AAABmd3gAAAAAAAAAAAAAAAAAAAAA + AAAAAAB3mZsAAAB3mZt3mZv///+qzM4AAAAJU+cJU+cJU+e67vF3mZt3mZt3mZu67vGqzM4JU+cJU+cJ + U+cAAABmd3h3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAB3mZt3mZv///+qzM4AAACqzM4JU+cJU+e6 + 7vG67vG67vG67vG67vGqzM4JU+eqzM4JU+cAAABmd3h3mZtmd3h3mZtmd3h3mZtmd3h3mZt3mZsAAAB3 + mZt3mZv///+qzM4AAACqzM4JU+cJU+e67vEJU+cAAAAAAAAJU+eqzM4JU+eqzM4JU+cAAAAAAAB3mZsA + AACqzM4AAACqzM4AAACqzM53mZsAAAB3mZt3mZv///+qzM4AAAAJU+cJU+cJU+e67vEJU+cJU+cJU+cJ + U+eqzM4JU+cJU+cJU+cAAAAAAAB3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAB3mZt3mZv///+qzM4A + AAC67vG67vG67vG67vG67vG67vG67vG67vG67vG67vG67vG67vEAAABmd3h3mZuqzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM4AAACqzM6qzM53mZt3mZt3mZt3mZt3mZt3mZt3mZuqzM6qzM66 + 7vEAAABmd3gAAAAAAAAAAAAAAAAAAAAAAAAAAAB3mZsAAAB3mZt3mZv///+qzM4AAAC67vG67vGqzM6q + zM6qzM6qzM6qzM6qzM6qzM667vG67vGqzM4AAAAAAAB3mZuqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM53mZt3mZt3mZt3mZt3mZt3mZsAAAB3mZt3mZt3mZt3mZt3mZt3mZsAAAB3mZuqzM6q + zM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM4AAAB3mZuqzM667vGqzM4AAACqzM66 + 7vGqzM6qzM53mZsAAAB3mZuqzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM4AAAAAAAB3mZt3mZsAAAB3mZt3mZt3mZsAAAAAAAB3mZuqzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM4AAAAAAAAAAAAAAAAAAAAAAAB3mZuqzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///////////////////////// + //////////////////////////////////////////////////////////////////////////8AAAB3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= +</value> + </data> </root> \ No newline at end of file Modified: branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.Designer.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.Designer.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -48,6 +48,7 @@ /// </summary> private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MountainController)); this.buttonUp = new System.Windows.Forms.RadioButton(); this.buttonDown = new System.Windows.Forms.RadioButton(); this.preview = new System.Windows.Forms.PictureBox(); @@ -63,7 +64,7 @@ this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonUp.Appearance = System.Windows.Forms.Appearance.Button; this.buttonUp.Checked = true; - this.buttonUp.Location = new System.Drawing.Point(4, 215); + this.buttonUp.Location = new System.Drawing.Point(4, 258); this.buttonUp.Name = "buttonUp"; this.buttonUp.Size = new System.Drawing.Size(56, 26); this.buttonUp.TabIndex = 2; @@ -75,7 +76,7 @@ // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonDown.Appearance = System.Windows.Forms.Appearance.Button; - this.buttonDown.Location = new System.Drawing.Point(60, 215); + this.buttonDown.Location = new System.Drawing.Point(153, 258); this.buttonDown.Name = "buttonDown"; this.buttonDown.Size = new System.Drawing.Size(56, 26); this.buttonDown.TabIndex = 4; @@ -90,7 +91,7 @@ this.preview.InitialImage = null; this.preview.Location = new System.Drawing.Point(4, 5); this.preview.Name = "preview"; - this.preview.Size = new System.Drawing.Size(112, 81); + this.preview.Size = new System.Drawing.Size(205, 81); this.preview.TabIndex = 3; this.preview.TabStop = false; // @@ -102,7 +103,7 @@ this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.label1.Location = new System.Drawing.Point(4, 93); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(112, 74); + this.label1.Size = new System.Drawing.Size(205, 117); this.label1.TabIndex = 6; this.label1.Text = "Press SHIFT and move mouse to quickly modify terrain."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -113,9 +114,9 @@ | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.selSize); this.groupBox1.Enabled = false; - this.groupBox1.Location = new System.Drawing.Point(4, 171); + this.groupBox1.Location = new System.Drawing.Point(4, 214); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(112, 38); + this.groupBox1.Size = new System.Drawing.Size(205, 38); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Target Size"; @@ -128,19 +129,19 @@ this.selSize.dataSource = null; this.selSize.Location = new System.Drawing.Point(6, 14); this.selSize.Name = "selSize"; - this.selSize.Size = new System.Drawing.Size(96, 17); + this.selSize.Size = new System.Drawing.Size(189, 17); this.selSize.TabIndex = 6; // // MountainController // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(120, 245); + this.ClientSize = new System.Drawing.Size(213, 288); this.Controls.Add(this.groupBox1); this.Controls.Add(this.label1); this.Controls.Add(this.buttonUp); this.Controls.Add(this.buttonDown); this.Controls.Add(this.preview); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MountainController"; this.Text = "Modify Terrain"; ((System.ComponentModel.ISupportInitialize)(this.preview)).EndInit(); Modified: branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.resx =================================================================== --- branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.resx 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Controllers/Terrain/MountainController.resx 2008-04-08 22:34:08 UTC (rev 353) @@ -117,4 +117,41 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAHBUAAAEAGABgBwAAFgAAACgAAAAcAAAAKgAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAB3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3mZt3mZv///93mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///93mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZuqzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///8AAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3mZt3mZuqzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM4AAABEmUBEmUBmu2NEmUBmu2NEmUBEmUBmu2NEmUBEmUBmu2NE + mUBEmUBEmUAAAAB3mZt3mZuqzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM4AAABEmUBEmUBm + u2NEmUBmu2NEmUBEmUBEmUBmu2Nmu2NEmUBmu2NEmUBEmUAAAAB3mZt3mZuqzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM4AAABmu2Nmu2Nmu2Nmu2NEmUBmu2NEmUBEmUBmu2Nmu2NEmUBmu2NEmUBE + mUAAAAB3mZt3mZuqzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM4AAABEmUBEmUBmu2Nmu2NE + mUBmu2NEmUBEmUBmu2Nmu2NEmUBEmUBmu2NEmUAAAAB3mZt3mZuqzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM6qzM6qzM4AAABmu2NEmUBmu2Nmu2NEmUBEmUBmu2NEmUBmu2Nmu2Nmu2NEmUBEmUBEmUAAAAB3 + mZt3mZt3mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3 + mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///+qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM53mZsAAAB3mZt3mZv///+qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6q + zM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM6qzM53mZsAAAB3mZt3mZv///////////////////////// + //////////////////////////////////////////////////////////////////////////8AAAB3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZt3 + mZt3mZt3mZt3mZt3mZt3mZt3mZt3mZuqzM4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= +</value> + </data> </root> \ No newline at end of file Modified: branches/FreeTrainSDL/core/Framework/ConfigDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/ConfigDialog.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Framework/ConfigDialog.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -127,6 +127,7 @@ this.buttonCancel.Size = new System.Drawing.Size(80, 26); this.buttonCancel.TabIndex = 1; this.buttonCancel.Text = "&Cancel"; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // groupBox1 // @@ -274,6 +275,9 @@ Close(); } - + private void buttonCancel_Click(object sender, EventArgs e) + { + this.Close(); + } } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -100,10 +100,11 @@ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.helpToolStripButton = new System.Windows.Forms.ToolStripButton(); this.playButton = new System.Windows.Forms.ToolStripButton(); + this.pauseButton = new System.Windows.Forms.ToolStripButton(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.pauseButton = new System.Windows.Forms.ToolStripButton(); + this.plugingListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip.SuspendLayout(); this.toolStrip.SuspendLayout(); this.statusStrip.SuspendLayout(); @@ -150,7 +151,7 @@ this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; this.newToolStripMenuItem.Name = "newToolStripMenuItem"; this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm); // @@ -160,14 +161,14 @@ this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; this.openToolStripMenuItem.Name = "openToolStripMenuItem"; this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.openToolStripMenuItem.Text = "&Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(137, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6); // // saveToolStripMenuItem // @@ -175,20 +176,20 @@ this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.saveToolStripMenuItem.Text = "&Save"; // // saveAsToolStripMenuItem // this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.saveAsToolStripMenuItem.Text = "Save &As"; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(137, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6); // // printToolStripMenuItem // @@ -196,7 +197,7 @@ this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; this.printToolStripMenuItem.Name = "printToolStripMenuItem"; this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.printToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.printToolStripMenuItem.Text = "&Print"; // // printPreviewToolStripMenuItem @@ -204,24 +205,24 @@ this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; - this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; // // printSetupToolStripMenuItem // this.printSetupToolStripMenuItem.Name = "printSetupToolStripMenuItem"; - this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.printSetupToolStripMenuItem.Text = "Print Setup"; // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(137, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(149, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click); // @@ -337,7 +338,8 @@ // toolsMenu // this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.optionsToolStripMenuItem}); + this.optionsToolStripMenuItem, + this.plugingListToolStripMenuItem}); this.toolsMenu.Name = "toolsMenu"; this.toolsMenu.Size = new System.Drawing.Size(44, 20); this.toolsMenu.Text = "&Tools"; @@ -345,8 +347,9 @@ // optionsToolStripMenuItem // this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(111, 22); + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.optionsToolStripMenuItem.Text = "&Options"; + this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); // // windowsMenu // @@ -546,6 +549,16 @@ this.playButton.Text = "Play"; this.playButton.Click += new System.EventHandler(this.playButton_Click); // + // pauseButton + // + this.pauseButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); + this.pauseButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.pauseButton.Name = "pauseButton"; + this.pauseButton.Size = new System.Drawing.Size(23, 22); + this.pauseButton.Text = "Pause"; + this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click); + // // statusStrip // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -562,15 +575,12 @@ this.toolStripStatusLabel.Size = new System.Drawing.Size(38, 17); this.toolStripStatusLabel.Text = "Status"; // - // pauseButton + // plugingListToolStripMenuItem // - this.pauseButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); - this.pauseButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.pauseButton.Name = "pauseButton"; - this.pauseButton.Size = new System.Drawing.Size(23, 22); - this.pauseButton.Text = "Pause"; - this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click); + this.plugingListToolStripMenuItem.Name = "plugingListToolStripMenuItem"; + this.plugingListToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.plugingListToolStripMenuItem.Text = "Plugin List"; + this.plugingListToolStripMenuItem.Click += new System.EventHandler(this.plugingListToolStripMenuItem_Click); // // MainWindowMDI // @@ -658,6 +668,7 @@ public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; private System.Windows.Forms.ToolStripButton playButton; private System.Windows.Forms.ToolStripButton pauseButton; + private System.Windows.Forms.ToolStripMenuItem plugingListToolStripMenuItem; } } Modified: branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -86,10 +86,7 @@ slopeRailRoadController.MdiParent = this; slopeRailRoadController.WindowState = FormWindowState.Maximized; slopeRailRoadController.Show(); - PluginListDialog pluginListDialog = new PluginListDialog(); - pluginListDialog.MdiParent = this; - pluginListDialog.WindowState = FormWindowState.Maximized; - pluginListDialog.Show(); + //RoadController roadController = new RoadController(); //roadController.MdiParent = mainWindowMDI; //roadController.Show(); @@ -156,7 +153,7 @@ private void ShowNewForm(object sender, EventArgs e) { // Create a new instance of the child form. - Form childForm = new Form(); + NewWorldDialog childForm = new NewWorldDialog(); // Make it a child of this MDI form before showing it. childForm.MdiParent = this; childForm.Text = "Window " + childFormNumber++; @@ -271,5 +268,20 @@ //MainWindowMDI.mainWindow.CurrentController = MainWindowMDI.mainWindow.br //MainWindowMDI.mainWindow.AttachController(MainWindowMDI.mainWindow.CurrentController); } + + private void optionsToolStripMenuItem_Click(object sender, EventArgs e) + { + ConfigDialog configDialog = new ConfigDialog(); + configDialog.MdiParent = this; + configDialog.Show(); + } + + private void plugingListToolStripMenuItem_Click(object sender, EventArgs e) + { + PluginListDialog pluginListDialog = new PluginListDialog(); + pluginListDialog.MdiParent = this; + pluginListDialog.WindowState = FormWindowState.Maximized; + pluginListDialog.Show(); + } } } Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs 2008-04-08 22:34:08 UTC (rev 353) @@ -32,7 +32,7 @@ public class PluginListDialog : System.Windows.Forms.Form { private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button buttonOk; private System.Windows.Forms.ListView list; private System.Windows.Forms.ColumnHeader titleColumn; private System.Windows.Forms.ColumnHeader authorColumn; @@ -76,7 +76,7 @@ "test"}, 0, System.Drawing.SystemColors.WindowText, System.Drawing.SystemColors.Window, new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)))); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PluginListDialog)); this.panel1 = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); + this.buttonOk = new System.Windows.Forms.Button(); this.list = new System.Windows.Forms.ListView(); this.titleColumn = new System.Windows.Forms.ColumnHeader(); this.authorColumn = new System.Windows.Forms.ColumnHeader(); @@ -87,23 +87,24 @@ // // panel1 // - this.panel1.Controls.Add(this.button1); + this.panel1.Controls.Add(this.buttonOk); this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(0, 232); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(424, 43); this.panel1.TabIndex = 0; // - // button1 + // buttonOk // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.button1.Location = new System.Drawing.Point(328, 9); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(88, 26); - this.button1.TabIndex = 0; - this.button1.Text = "&OK"; + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonOk.Location = new System.Drawing.Point(328, 9); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(88, 26); + this.buttonOk.TabIndex = 0; + this.buttonOk.Text = "&OK"; + this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); // // list // @@ -171,5 +172,10 @@ new string[] { p.title, p.author, p.homepage }, 0)); } } + + private void buttonOk_Click(object sender, EventArgs e) + { + this.Close(); + } } } Added: branches/FreeTrainSDL/gui/land.ico =================================================================== (Binary files differ) Property changes on: branches/FreeTrainSDL/gui/land.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/FreeTrainSDL/gui/rail.ico =================================================================== (Binary files differ) Property changes on: branches/FreeTrainSDL/gui/rail.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/FreeTrainSDL/gui/train.ico =================================================================== (Binary files differ) Property changes on: branches/FreeTrainSDL/gui/train.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/FreeTrainSDL/plugins/Chiname.DummyCars/plugin.xml =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.DummyCars/plugin.xml 2008-04-08 18:03:01 UTC (rev 352) +++ branches/FreeTrainSDL/plugins/Chiname.DummyCars/plugin.xml 2008-04-08 22:34:08 UTC (rev 353) @@ -1,23 +1,23 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<plug-in> - <title>Parking Area</title> - <!--//!<title>横断歩道</title> +<?xml version="1.0" encoding="UTF-8" ?> +<plug-in> + <title>Parking Area</title> + <!--//!<title>横断歩道</title> <title>駐車場</title>--> <author>C477</author> - <!--!<author>C477@2両目</author>--> - <homepage>http://www.rocket.ne.jp/~nao/</homepage> - - <contribution type="contribution" id="{0A73F9C6-BDCC-43DF-C477-E28B76058E8C}"> - <name>DummyCar</name> - <class name="FreeTrain.Framework.Plugin.FixedClassContributionFactory"/> - <implementation name="FreeTrain.World.Road.DummyCars.DummyCarContribution" - codebase="FreeTrain.World.Road.DummyCars.dll" /> - </contribution> - - <!-- temporary --> - <contribution type="menu" id="{BFC035E9-8B0E-41D6-C477-72F99D820290}"> - <class name="FreeTrain.World.Road.DummyCars.MenuContributionImpl" - codebase="FreeTrain.World.Road.DummyCars.dll" /> - </contribution> - -</plug-in> + <!--!<author>C477@2両目</author>--> + <homepage>http://www.rocket.ne.jp/~nao/</homepage> + + <contribution type="contribution" id="{0A73F9C6-BDCC-43DF-C477-E28B76058E8C}"> + <name>DummyCar</name> + <class name="FreeTrain.Framework.Plugin.FixedClassContributionFactory"/> + <implementation name="FreeTrain.World.Road.DummyCars.DummyCarContribution" + codebase="FreeTrain.World.Road.DummyCars.dll" /> + </contribution> + + <!-- temporary --> + <contribution type="menu" id="{BFC035E9-8B0E-41D6-C477-72F99D820290}"> + <class name="FreeTrain.World.Road.DummyCars.MenuContributionImpl" + codebase="FreeTrain.World.Road.DummyCars.dll" /> + </contribution> + +</plug-in> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-09 16:04:57
|
Revision: 354 http://freetrain.svn.sourceforge.net/freetrain/?rev=354&view=rev Author: jendave Date: 2008-04-09 09:04:34 -0700 (Wed, 09 Apr 2008) Log Message: ----------- Gui work Modified Paths: -------------- branches/FreeTrainSDL/Program.cs branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/Rail/SpecialPurposeRailController.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Framework/BGMManager.cs branches/FreeTrainSDL/core/Framework/Core.cs branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/DirectSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/NightSurfaceLoader.cs branches/FreeTrainSDL/core/Framework/Graphics/SimpleSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/Properties/Resources.Designer.cs branches/FreeTrainSDL/core/Properties/Resources.resx branches/FreeTrainSDL/core/Views/Map/MapView.cs branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/Views/WeatherOverlayImpl.cs branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs branches/FreeTrainSDL/core/World/Clock.cs branches/FreeTrainSDL/core/World/Direction.cs branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/Station.cs branches/FreeTrainSDL/core/World/Rail/ThinPlatform.cs branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.Generic/CategoryTreeWnd.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigCommand.cs Added Paths: ----------- branches/FreeTrainSDL/core/Framework/MainWindow.Designer.cs branches/FreeTrainSDL/core/Framework/MainWindow.cs branches/FreeTrainSDL/core/Framework/MainWindow.resx branches/FreeTrainSDL/core/Resources/ branches/FreeTrainSDL/core/Resources/play.png Removed Paths: ------------- branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.cs branches/FreeTrainSDL/core/Framework/MainWindowMDI.resx Modified: branches/FreeTrainSDL/Program.cs =================================================================== --- branches/FreeTrainSDL/Program.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/Program.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -72,7 +72,7 @@ short oldX; short oldY; bool lastMouseState; - MainWindowMDI mainWindowMDI; + MainWindow mainWindowMDI; #endregion @@ -116,7 +116,7 @@ { if (qView != null) { - controller = MainWindowMDI.mainWindow.CurrentController; + controller = MainWindow.mainWindow.CurrentController; qView.UpdateScreen(); if (WorldDefinition.World.Satellite == null || WorldDefinition.World.Satellite.surface.w != 150 || @@ -217,7 +217,7 @@ sourceRect = new Sdl.SDL_Rect((short)ScrollPosition.X, (short)ScrollPosition.Y, (short)width, (short)height); dst = new Sdl.SDL_Rect(0, 0, (short)width, (short)height); - Tao.Sdl.Sdl.SDL_BlitSurface(qView.OffscreenBuffer.surfacePtr(), ref sourceRect, screen.Handle, ref dst); + Tao.Sdl.Sdl.SDL_BlitSurface(qView.OffscreenBuffer.SurfacePtr(), ref sourceRect, screen.Handle, ref dst); } FinalDraw(); @@ -270,7 +270,7 @@ Core.Init(null, null, null, new ProgressHandler(UpdateMessage), true); world = new WorldDefinition(new Distance(150, 150, 7), 3); WorldDefinition.World = world; - mainWindowMDI = new MainWindowMDI(); + mainWindowMDI = new MainWindow(); timer = new System.Windows.Forms.Timer(); Events.KeyboardDown += new EventHandler<KeyboardEventArgs>(this.KeyDown); Events.MouseButtonDown += Modified: branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -58,7 +58,7 @@ { using (NewWorldDialog dialog = new NewWorldDialog()) { - if (dialog.ShowDialog(MainWindowMDI.mainWindow) == DialogResult.OK) + if (dialog.ShowDialog(MainWindow.mainWindow) == DialogResult.OK) return dialog.createWorld(); else return null; Modified: branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Controllers/AbstractControllerImpl.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -53,7 +53,7 @@ // Attach the control when activated. try { - MainWindowMDI.mainWindow.AttachController(this); + MainWindow.mainWindow.AttachController(this); } catch (NullReferenceException nre) { @@ -68,9 +68,9 @@ protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { // Detach it when it is closed. - if (MainWindowMDI.mainWindow.CurrentController == this) + if (MainWindow.mainWindow.CurrentController == this) { - MainWindowMDI.mainWindow.DetachController(); + MainWindow.mainWindow.DetachController(); } } Modified: branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -52,8 +52,8 @@ { InitializeComponent(); this.contrib = _type; - this.Text = type.Name; - updateAfterResize(null, null); + this.Text = Type.Name; + UpdateAfterResize(null, null); //updatePreview(); } /// <summary> @@ -63,16 +63,18 @@ { if (this.picture.Image != null) this.picture.Image.Dispose(); - Bitmap bmp = type.PreviewBitmap; + Bitmap bmp = Type.PreviewBitmap; this.picture.Image = bmp; this.picture.BackColor = bmp.GetPixel(0, bmp.Size.Height - 1); } private LineContribution contrib; + /// <summary> /// /// </summary> - protected virtual LineContribution type { get { return contrib; } } + protected virtual LineContribution Type { get { return contrib; } } + /// <summary> /// /// </summary> @@ -181,9 +183,6 @@ private bool isPlacing { get { return buttonPlace.Checked; } } - - - /// <summary> /// The first location selected by the user. /// </summary> @@ -204,19 +203,16 @@ { loc.z = anchor.z; - if (type.DirectionMode == SpecialRailContribution.DirectionModes.FourWay) + if (Type.DirectionMode == SpecialRailContribution.DirectionModes.FourWay) return loc.align4To(anchor); - if (type.DirectionMode == SpecialRailContribution.DirectionModes.EightWay) + if (Type.DirectionMode == SpecialRailContribution.DirectionModes.EightWay) return loc.align8To(anchor); Debug.Assert(false); return UNPLACED; } - - - /// <summary> /// /// </summary> @@ -233,6 +229,7 @@ WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); } } + /// <summary> /// /// </summary> @@ -253,18 +250,19 @@ { if (isPlacing) { - if (type.CanBeBuilt(anchor, loc)) + if (Type.CanBeBuilt(anchor, loc)) // build new railroads. - type.Build(anchor, loc); + Type.Build(anchor, loc); } else // remove existing ones - type.Remove(anchor, loc); + Type.Remove(anchor, loc); WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, loc)); } anchor = UNPLACED; } } + /// <summary> /// /// </summary> @@ -283,6 +281,7 @@ anchor = UNPLACED; } } + /// <summary> /// /// </summary> @@ -295,19 +294,20 @@ else return sameLevelDisambiguator; } } + private ILocationDisambiguator sameLevelDisambiguator; - private void modeChanged(object sender, EventArgs e) { anchor = UNPLACED; } + /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected virtual void updateAfterResize(object sender, System.EventArgs e) + protected virtual void UpdateAfterResize(object sender, System.EventArgs e) { this.buttonPlace.Left = this.picture.Left; this.buttonPlace.Width = ((this.picture.Left + this.picture.Width)) / 2; @@ -316,9 +316,6 @@ UpdatePreview(); } - - - private bool inBetween(Location loc, Location lhs, Location rhs) { if (!loc.inBetween(lhs, rhs)) return false; @@ -339,8 +336,9 @@ public void DrawBefore(QuarterViewDrawer view, DrawContext canvas) { if (anchor != UNPLACED && isPlacing) - canvas.Tag = type.CanBeBuilt(anchor, currentPos); + canvas.Tag = Type.CanBeBuilt(anchor, currentPos); } + /// <summary> /// /// </summary> @@ -355,9 +353,10 @@ if (tag != null && (bool)tag && inBetween(loc, anchor, currentPos)) { Direction d = anchor.getDirectionTo(currentPos); - draw(d, canvas, pt); + Draw(d, canvas, pt); } } + /// <summary> /// /// </summary> @@ -370,7 +369,7 @@ /// <summary> /// Draw the preview on the given point. /// </summary> - protected virtual void draw(Direction d, DrawContext canvs, Point pt) + protected virtual void Draw(Direction d, DrawContext canvs, Point pt) { } } } Modified: branches/FreeTrainSDL/core/Controllers/Rail/SpecialPurposeRailController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/SpecialPurposeRailController.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Controllers/Rail/SpecialPurposeRailController.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -49,7 +49,7 @@ /// <param name="d"></param> /// <param name="canvas"></param> /// <param name="pt"></param> - protected override void draw(Direction d, DrawContext canvas, Point pt) + protected override void Draw(Direction d, DrawContext canvas, Point pt) { RailPattern.get(d, d.opposite).DrawAlpha(canvas.Surface, pt); } Modified: branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -55,7 +55,7 @@ /// <summary> /// /// </summary> - protected LineContribution type + protected override LineContribution Type { get { return currentContrib; } } /// <summary> @@ -64,7 +64,7 @@ /// <param name="d"></param> /// <param name="canvas"></param> /// <param name="pt"></param> - protected void Draw(Direction d, DrawContext canvas, Point pt) + protected override void Draw(Direction d, DrawContext canvas, Point pt) { ResourceUtil.emptyChip.DrawShape(canvas.Surface, pt, Color.Blue); // RoadPattern.getStraight(d).drawAlpha( canvas.surface, pt ); @@ -247,7 +247,7 @@ level.Text = ToStyleDescription(currentContrib.style); toolTip.SetToolTip(this.description, this.description.Text); currentContrib.PreviewPatternIdx = currentPattern; - this.Text = type.Name; + this.Text = this.Type.Name; UpdatePreview(); } Modified: branches/FreeTrainSDL/core/Framework/BGMManager.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/BGMManager.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/BGMManager.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -212,7 +212,7 @@ } catch (Exception e) { - MessageBox.Show(MainWindowMDI.mainWindow, + MessageBox.Show(MainWindow.mainWindow, "Can not play back\n" + e.StackTrace, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); //! "再生できません¥n"+e.StackTrace, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error ); } Modified: branches/FreeTrainSDL/core/Framework/Core.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -303,7 +303,7 @@ /// <returns></returns> public bool OnFinal(IDictionary errorPlugins, int totalErrorCount) { - DialogResult res = MessageBox.Show(MainWindowMDI.mainWindow, @"Some plugins could not be loaded. + DialogResult res = MessageBox.Show(MainWindow.mainWindow, @"Some plugins could not be loaded. Some functions may not be available and you might encounter errors. In the worst case, game data might be lost, so it is advised that you quit now. Modified: branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -42,8 +42,8 @@ { if (initialized) Clear(); - if (MainWindowMDI.mainWindow == null) - MainWindowMDI.mainWindow = new MainWindowMDI(); + if (MainWindow.mainWindow == null) + MainWindow.mainWindow = new MainWindow(); if (progressHandler == null) progressHandler = new ProgressHandler(SilentProgress); Modified: branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -92,7 +92,7 @@ pt.X -= Offset.X; pt.Y -= Offset.Y; int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; - surface.bltColorTransform(pt, Picture.surface, Origin, Size, + surface.BlitColorTransform(pt, Picture.surface, Origin, Size, srcColors[idx], dstColors[idx], false); } } Modified: branches/FreeTrainSDL/core/Framework/Graphics/DirectSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/DirectSprite.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/DirectSprite.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -57,6 +57,9 @@ /// </summary> private Surface surface; + /// <summary> + /// + /// </summary> protected Surface Surface { get { return surface; } @@ -66,6 +69,7 @@ /// <summary> /// The point in the image that will be aligned to /// the left-top corner of a voxel. + /// </summary> Point offset; /// <summary> @@ -108,7 +112,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.blt(pt, this.surface, origin, size); + surface.Blit(pt, this.surface, origin, size); } /// <summary> @@ -118,7 +122,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.bltShape(pt, this.surface, origin, size, color); + surface.BlitShape(pt, this.surface, origin, size, color); } /// <summary> /// @@ -129,7 +133,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.bltAlpha(pt, this.surface, origin, size); + surface.BlitAlpha(pt, this.surface, origin, size); } /// <summary> Modified: branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -69,7 +69,7 @@ int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; - surface.bltHueTransform(pt, Picture.surface, Origin, Size, + surface.BlitHueTransform(pt, Picture.surface, Origin, Size, RedTarget, GreenTarget, BlueTarget); } Modified: branches/FreeTrainSDL/core/Framework/Graphics/NightSurfaceLoader.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/NightSurfaceLoader.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/NightSurfaceLoader.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -70,7 +70,7 @@ if (this.nightSurface == null) { this.nightSurface = new Surface(fileName); - this.nightSurface.buildNightImage(); + this.nightSurface.BuildNightImage(); } if (surface != null) { Modified: branches/FreeTrainSDL/core/Framework/Graphics/SimpleSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/SimpleSprite.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/SimpleSprite.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -90,7 +90,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.blt(pt, picture.surface, origin, Size); + surface.Blit(pt, picture.surface, origin, Size); } /// <summary> @@ -100,7 +100,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.bltShape(pt, picture.surface, origin, size, color); + surface.BlitShape(pt, picture.surface, origin, size, color); } /// <summary> /// @@ -111,7 +111,7 @@ { pt.X -= offset.X; pt.Y -= offset.Y; - surface.bltAlpha(pt, picture.surface, origin, size); + surface.BlitAlpha(pt, picture.surface, origin, size); } /// <summary> Modified: branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs 2008-04-08 22:34:08 UTC (rev 353) +++ branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -66,16 +66,36 @@ /// <summary> /// /// </summary> - public IntPtr[] surfacePtrs = new IntPtr[TOTAL_SURFACES]; + private IntPtr[] surfacePtrs = new IntPtr[TOTAL_SURFACES]; + + /// <summary> + /// + /// </summary> + public IntPtr[] SurfacePtrs + { + get { return surfacePtrs; } + set { surfacePtrs = value; } + } + private String[] surfaceSignatures = new String[TOTAL_SURFACES]; /// <summary> /// /// </summary> - public IntPtr mask;//, dupSurface; + private IntPtr mask;//, dupSurface; + /// <summary> /// /// </summary> + public IntPtr Mask + { + get { return mask; } + set { mask = value; } + } + + /// <summary> + /// + /// </summary> public Sdl.SDL_Surface surface; //, dupSurface, mask; private Sdl.SDL_PixelFormat pixelFormat; @@ -103,9 +123,9 @@ { bpp = newbpp; this.surfacePtrs[0] = Sdl.SDL_CreateRGBSurface(flags, w, h, bpp, 0, 0, 0, 0); - this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.surfacePtr(), typeof(Sdl.SDL_Surface)); + this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.SurfacePtr(), typeof(Sdl.SDL_Surface)); pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(this.surface.format, typeof(Sdl.SDL_PixelFormat)); - this.resetClipRect(); + this.ResetClipRect(); this.currentSurfaceCount++; } @@ -115,6 +135,7 @@ /// <param name="w"></param> /// <param name="h"></param> public Surface(int w, int h) : this(w, h, IntPtr.Zero) { } + /// <summary> /// /// </summary> @@ -126,20 +147,21 @@ if (pf == IntPtr.Zero) { this.surfacePtrs[0] = Sdl.SDL_CreateRGBSurface(flags, w, h, bpp, 0, 0, 0, 0); - this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.surfacePtr(), typeof(Sdl.SDL_Surface)); + this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.SurfacePtr(), typeof(Sdl.SDL_Surface)); pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(this.surface.format, typeof(Sdl.SDL_PixelFormat)); } else { pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(pf, typeof(Sdl.SDL_PixelFormat)); this.surfacePtrs[0] = Sdl.SDL_CreateRGBSurface(flags, w, h, bpp, pixelFormat.Rmask, pixelFormat.Gmask, pixelFormat.Bmask, pixelFormat.Amask); - this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.surfacePtr(), typeof(Sdl.SDL_Surface)); + this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.SurfacePtr(), typeof(Sdl.SDL_Surface)); } this.SourceColorKey = Color.Magenta; - this.resetClipRect(); + this.ResetClipRect(); this.currentSurfaceCount++; } + /// <summary> /// /// </summary> @@ -147,20 +169,21 @@ public Surface(string filename) { this.surfacePtrs[0] = Tao.Sdl.SdlImage.IMG_Load(filename); - this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.surfacePtr(), typeof(Sdl.SDL_Surface)); + this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.SurfacePtr(), typeof(Sdl.SDL_Surface)); this.pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(this.surface.format, typeof(Sdl.SDL_PixelFormat)); this.SourceColorKey = Color.Magenta; - this.resetClipRect(); + this.ResetClipRect(); this.currentSurfaceCount++; this._filename = filename; } + internal Surface(IntPtr surface) { this.surfacePtrs[0] = surface; - this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.surfacePtr(), typeof(Sdl.SDL_Surface)); + this.surface = (Sdl.SDL_Surface)Marshal.PtrToStructure(this.SurfacePtr(), typeof(Sdl.SDL_Surface)); this.pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(this.surface.format, typeof(Sdl.SDL_PixelFormat)); this.SourceColorKey = Color.Magenta; - this.resetClipRect(); + this.ResetClipRect(); this.currentSurfaceCount++; } @@ -168,16 +191,17 @@ /// /// </summary> /// <returns></returns> - public IntPtr surfacePtr() { return this.surfacePtrs[0]; } + public IntPtr SurfacePtr() { return this.surfacePtrs[0]; } /// <summary> /// /// </summary> - public void resetClipRect() + public void ResetClipRect() { Sdl.SDL_Rect r = new Sdl.SDL_Rect(0, 0, (short)Size.Width, (short)Size.Height); - Sdl.SDL_SetClipRect(this.surfacePtr(), ref r); + Sdl.SDL_SetClipRect(this.SurfacePtr(), ref r); } + ///// <summary> ///// ///// </summary> @@ -193,12 +217,12 @@ /// <summary> /// /// </summary> - public Rectangle clipRect + public Rectangle ClipRect { get { Sdl.SDL_Rect r = new Sdl.SDL_Rect(); - Sdl.SDL_GetClipRect(this.surfacePtr(), ref r); + Sdl.SDL_GetClipRect(this.SurfacePtr(), ref r); return new Rectangle(r.x, r.y, r.w, r.h); } set @@ -208,7 +232,7 @@ srect.y = (short)value.Y; srect.w = (short)value.Width; srect.h = (short)value.Height; - Sdl.SDL_SetClipRect(this.surfacePtr(), ref srect); + Sdl.SDL_SetClipRect(this.SurfacePtr(), ref srect); } } @@ -263,7 +287,7 @@ /// <param name="source"></param> /// <param name="srcPos"></param> /// <param name="sz"></param> - public void blt(Point dstPos, Surface source, Point srcPos, Size sz) + public void Blit(Point dstPos, Surface source, Point srcPos, Size sz) { drect.x = (short)dstPos.X; drect.y = (short)dstPos.Y; @@ -273,7 +297,7 @@ srect.y = (short)srcPos.Y; srect.w = (short)sz.Width; srect.h = (short)sz.Height; - blt(drect, source, srect); + Blit(drect, source, srect); } /// <summary> @@ -281,7 +305,7 @@ /// </summary> /// <param name="dstPos"></param> /// <param name="source"></param> - public void blt(Point dstPos, Surface source) + public void Blit(Point dstPos, Surface source) { drect.x = (short)dstPos.X; drect.y = (short)dstPos.Y; @@ -291,19 +315,19 @@ srect.y = 0; srect.w = (short)source.Size.Width; srect.h = (short)source.Size.Height; - blt(drect, source, srect); + Blit(drect, source, srect); } - private void blt(Sdl.SDL_Rect dst, Surface source, Sdl.SDL_Rect src) + private void Blit(Sdl.SDL_Rect dst, Surface source, Sdl.SDL_Rect src) { - Tao.Sdl.Sdl.SDL_BlitSurface(source.surfacePtr(), ref src, this.surfacePtr(), ref dst); + Tao.Sdl.Sdl.SDL_BlitSurface(source.SurfacePtr(), ref src, this.SurfacePtr(), ref dst); } /// <summary> /// /// </summary> /// <param name="val"></param> - public void setAlpha(byte val) + public void SetAlpha(byte val) { //surface.AlphaBlending = true; //surface.Alpha = 128; @@ -317,7 +341,7 @@ /// <param name="source"></param> /// <param name="srcPos"></param> /// <param name="sz"></param> - public void bltAlpha(Point dstPos, Surface source, Point srcPos, Size sz) + public void BlitAlpha(Point dstPos, Surface source, Point srcPos, Size sz) { //Rectangle dst = new Rectangle( dstPos.X,dstPos.Y,sz.Width,sz.Height ); //Rectangle src = new Rectangle( srcPos.X,srcPos.Y,sz.Width,sz.Height ); @@ -327,7 +351,7 @@ src.Left, src.Top, src.Right, src.Bottom, source.colorKey );*/ //source.handle.Transparent = false; - source.setAlpha(128); + source.SetAlpha(128); //this.sourceColorKey = Color.Magenta; @@ -340,8 +364,8 @@ srect.w = (short)sz.Width; srect.h = (short)sz.Height; //Tao.Sdl.Sdl.SDL_BlitSurface(source.surfacePtr, ref nsrc, this.surfacePtr, ref ndst); - blt(drect, source, srect); - source.setAlpha(255); + Blit(drect, source, srect); + source.SetAlpha(255); } /// <summary> @@ -352,7 +376,7 @@ /// <param name="srcPos"></param> /// <param name="sz"></param> /// <param name="fill"></param> - public void bltShape(Point dstPos, Surface source, Point srcPos, Size sz, Color fill) + public void BlitShape(Point dstPos, Surface source, Point srcPos, Size sz, Color fill) { drect.x = (short)dstPos.X; drect.y = (short)dstPos.Y; @@ -379,7 +403,7 @@ //srect.x = 0; //srect.y = 0; - Tao.Sdl.Sdl.SDL_BlitSurface(this.surfacePtrs[index], ref srect, this.surfacePtr(), ref drect); + Tao.Sdl.Sdl.SDL_BlitSurface(this.surfacePtrs[index], ref srect, this.SurfacePtr(), ref drect); } private int checkMask(Surface source, Sdl.SDL_Rect r, Color fill) @@ -410,7 +434,7 @@ { drect.x = (short)xx; drect.y = (short)yy; - if (this.GetIntPixel(source.surfacePtr(), xx, yy) != pink1) Sdl.SDL_FillRect(surfacePtrs[curIndex], ref drect, col); + if (this.GetIntPixel(source.SurfacePtr(), xx, yy) != pink1) Sdl.SDL_FillRect(surfacePtrs[curIndex], ref drect, col); else Sdl.SDL_FillRect(surfacePtrs[curIndex], ref drect, pink2); } } @@ -428,7 +452,7 @@ /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> - public Color GetPixel(int x, int y) { return GetPixel(this.surfacePtr(), x, y); } + public Color GetPixel(int x, int y) { return GetPixel(this.SurfacePtr(), x, y); } /// <summary> /// /// </summary> @@ -449,7 +473,7 @@ { Sdl.SDL_Surface s; Sdl.SDL_PixelFormat pf; - if (surf != this.surfacePtr()) + if (surf != this.SurfacePtr()) { s = (Sdl.SDL_Surface)Marshal.PtrToStructure(surf, typeof(Sdl.SDL_Surface)); pf = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(s.format, typeof(Sdl.SDL_PixelFormat)); @@ -496,7 +520,6 @@ return value; } - ///// <summary> ///// ///// </summary> @@ -512,9 +535,9 @@ /// /// </summary> /// <returns></returns> - public Surface createFlippedVerticalSurface() + public Surface CreateFlippedVerticalSurface() { - return new Surface(SdlGfx.rotozoomSurfaceXY(this.surfacePtr(), 0, 1, -1, SdlGfx.SMOOTHING_OFF)); + return new Surface(SdlGfx.rotozoomSurfaceXY(this.SurfacePtr(), 0, 1, -1, SdlGfx.SMOOTHING_OFF)); } //public Tao.Sdl.Sdl.SDL_Surface createFlippedHorizontalSurface() { return null; } @@ -529,10 +552,10 @@ /// <param name="_srcColors"></param> /// <param name="_dstColors"></param> /// <param name="vflip"></param> - public void bltColorTransform(Point dstPos, Surface source, Point srcPos, Size sz, Color[] _srcColors, Color[] _dstColors, bool vflip) + public void BlitColorTransform(Point dstPos, Surface source, Point srcPos, Size sz, Color[] _srcColors, Color[] _dstColors, bool vflip) { if (vflip) Console.WriteLine("VFLIP ! VFLIP ! VFLIP ! VFLIP ! VFLIP ! VFLIP ! VFLIP ! "); - int index = source.reColor(_srcColors, _dstColors); + int index = source.ReColor(_srcColors, _dstColors); //blt(dstPos, source, srcPos,sz); drect.x = (short)dstPos.X; drect.y = (short)dstPos.Y; @@ -542,7 +565,7 @@ srect.y = (short)srcPos.Y; srect.w = (short)sz.Width; srect.h = (short)sz.Height; - Tao.Sdl.Sdl.SDL_BlitSurface(source.surfacePtrs[index], ref srect, this.surfacePtr(), ref drect); + Tao.Sdl.Sdl.SDL_BlitSurface(source.surfacePtrs[index], ref srect, this.SurfacePtr(), ref drect); } /// <summary> @@ -551,7 +574,7 @@ /// <param name="_srcColors"></param> /// <param name="_dstColors"></param> /// <returns></returns> - public int reColor(Color[] _srcColors, Color[] _dstColors) + public int ReColor(Color[] _srcColors, Color[] _dstColors) { String curSig = "recolor"; for (int curCol = 0; curCol < 4; curCol++) @@ -617,7 +640,7 @@ /// <param name="R_dest"></param> /// <param name="G_dest"></param> /// <param name="B_dest"></param> - public void bltHueTransform(Point dstPos, Surface source, Point srcPos, Size sz, Color R_dest, Color G_dest, Color B_dest) + public void BlitHueTransform(Point dstPos, Surface source, Point srcPos, Size sz, Color R_dest, Color G_dest, Color B_dest) { /*RECT dst = Util.toRECT( dstPos, sz ); RECT src = Util.toRECT( srcPos, sz ); @@ -748,7 +771,7 @@ /// <summary> /// /// </summary> - public void buildNightImage() + public void BuildNightImage() { /*byte[] src = new byte[16],src2 = new byte[16], dst = new byte[16]; for (int i = 0; i < 16; i++) @@ -896,7 +919,7 @@ /// </summary> public void Fill(Color c) { - Fill(clipRect, c); + Fill(ClipRect, c); } @@ -913,14 +936,14 @@ srect.y = (short)rect.Y; srect.w = (short)rect.Width; srect.h = (short)rect.Height; - Tao.Sdl.Sdl.SDL_FillRect(this.surfacePtr(), ref srect, Sdl.SDL_MapRGB(this.surface.format, c.R, c.G, c.B)); + Tao.Sdl.Sdl.SDL_FillRect(this.SurfacePtr(), ref srect, Sdl.SDL_MapRGB(this.surface.format, c.R, c.G, c.B)); } private int _colKey; private int colorKey { get { return _colKey; } - set { _colKey = value; Tao.Sdl.Sdl.SDL_SetColorKey(this.surfacePtr(), Sdl.SDL_SRCCOLORKEY | Sdl.SDL_RLEACCEL, _colKey); } + set { _colKey = value; Tao.Sdl.Sdl.SDL_SetColorKey(this.SurfacePtr(), Sdl.SDL_SRCCOLORKEY | Sdl.SDL_RLEACCEL, _colKey); } } /// <summary> @@ -1001,7 +1024,6 @@ /// <param name="surf"></param> /// <param name="colorValue"></param> /// <returns></returns> - [CLSCompliant(false)] public System.Drawing.Color GetColor(IntPtr surf, int colorValue) { byte r, g, b, a; @@ -1013,20 +1035,21 @@ /// /// </summary> /// <param name="r"></param> - public void drawBox(Rectangle r) { drawBox(r, Color.CornflowerBlue); } + public void DrawBox(Rectangle r) { DrawBox(r, Color.CornflowerBlue); } + /// <summary> /// /// </summary> /// <param name="r"></param> /// <param name="c"></param> - public void drawBox(Rectangle r, Color c) + public void DrawBox(Rectangle r, Color c) { /*surface.Draw(new SdlDotNet.Graphics.Primitives.Box((short)r.Left, (short)r.Top, (short)r.Right, (short)r.Bottom), c);*/ //SdlGfx.boxColor(this.surfacePtr(),(short)r.X,(short)r.Y,(short)(r.X+r.Width),(short)(r.Y+r.Height),Sdl.SDL_MapRGB(this.surface.format,c.R,c.G,c.B)); - SdlGfx.rectangleRGBA(this.surfacePtr(), (short)r.X, (short)r.Y, (short)(r.X + r.Width), (short)(r.Y + r.Height), c.R, c.G, c.B, 255); + SdlGfx.rectangleRGBA(this.SurfacePtr(), (short)r.X, (short)r.Y, (short)(r.X + r.Width), (short)(r.Y + r.Height), c.R, c.G, c.B, 255); } ///// <summary> @@ -1052,7 +1075,7 @@ /// </summary> /// <param name="col"></param> /// <param name="pts"></param> - public void fillPolygon(Color col, Point[] pts) + public void FillPolygon(Color col, Point[] pts) { //Surface tx = new Surface(Video.CreateRgbSurface(20,20)); //tx.fill(col); @@ -1064,17 +1087,18 @@ ptX[i] = (short)pts[i].X; ptY[i] = (short)pts[i].Y; } - Tao.Sdl.SdlGfx.filledPolygonRGBA(this.surfacePtr(), ptX, ptY, pts.GetLength(0), col.R, col.G, col.B, 255); + Tao.Sdl.SdlGfx.filledPolygonRGBA(this.SurfacePtr(), ptX, ptY, pts.GetLength(0), col.R, col.G, col.B, 255); } + /// <summary> /// /// </summary> /// <param name="col"></param> /// <param name="pts"></param> - public void drawLines(Color col, Point[] pts) + public void DrawLines(Color col, Point[] pts) { for (int curPoint = 0; curPoint <= (pts.GetLength(0) - 2); curPoint++) - Tao.Sdl.SdlGfx.lineRGBA(this.surfacePtr(), (short)pts[curPoint].X, (short)pts[curPoint].Y, (short)pts[curPoint + 1].X, (short)pts[curPoint + 1].Y, col.R, col.G, col.B, 255); + Tao.Sdl.SdlGfx.lineRGBA(this.SurfacePtr(), (short)pts[curPoint].X, (short)pts[curPoint].Y, (short)pts[curPoint + 1].X, (short)pts[curPoint + 1].Y, col.R, col.G, col.B, 255); // surface.Draw(new SdlDotNet.Graphics.Primitives.Line((Point)pts[curPoint], (Point)pts[curPoint + 1]), col,false,false); } @@ -1104,7 +1128,7 @@ try { Marshal.Copy(arr, 0, i, arr.Length); - Sdl.SDL_SaveBMP_RW(this.surfacePtr(), Sdl.SDL_RWFromMem(i, arr.Length), 1); + Sdl.SDL_SaveBMP_RW(this.SurfacePtr(), Sdl.SDL_RWFromMem(i, arr.Length), 1); Marshal.Copy(i, arr, 0, arr.Length); } catch (AccessViolationException e) Copied: branches/FreeTrainSDL/core/Framework/MainWindow.Designer.cs (from rev 353, branches/FreeTrainSDL/core/Framework/MainWindowMDI.Designer.cs) =================================================================== --- branches/FreeTrainSDL/core/Framework/MainWindow.Designer.cs (rev 0) +++ branches/FreeTrainSDL/core/Framework/MainWindow.Designer.cs 2008-04-09 16:04:34 UTC (rev 354) @@ -0,0 +1,664 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +namespace FreeTrain.Framework +{ + partial class MainWindow + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.viewMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.plugingListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.windowsMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.newWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tileVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tileHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.arrangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip = new System.Windows.Forms.ToolStrip(); + this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.printToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.helpToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.playButton = new System.Windows.Forms.ToolStripButton(); + this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.ToolTip = new System.Windows.Forms.ToolTip(this.components); + this.menuStrip.SuspendLayout(); + this.toolStrip.SuspendLayout(); + this.statusStrip.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip + // + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileMenu, + this.editMenu, + this.viewMenu, + this.toolsMenu, + this.windowsMenu, + this.helpMenu}); + this.menuStrip.Location = new System.Drawing.Point(0, 0); + this.menuStrip.MdiWindowListItem = this.windowsMenu; + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new System.Drawing.Size(525, 24); + this.menuStrip.TabIndex = 0; + this.menuStrip.Text = "MenuStrip"; + // + // fileMenu + // + this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.toolStripSeparator3, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripSeparator4, + this.printToolStripMenuItem, + this.printPreviewToolStripMenuItem, + this.printSetupToolStripMenuItem, + this.toolStripSeparator5, + this.exitToolStripMenuItem}); + this.fileMenu.ImageTransparentColor = System.Drawing.SystemColors.ActiveBorder; + this.fileMenu.Name = "fileMenu"; + this.fileMenu.Size = new System.Drawing.Size(35, 20); + this.fileMenu.Text = "&File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image"))); + this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.newToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.newToolStripMenuItem.Text = "&New"; + this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); + this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.openToolStripMenuItem.Text = "&Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(137, 6); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); + this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.saveToolStripMenuItem.Text = "&Save"; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.saveAsToolStripMenuItem.Text = "Save &As"; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(137, 6); + // + // printToolStripMenuItem + // + this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image"))); + this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.printToolStripMenuItem.Name = "printToolStripMenuItem"; + this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.printToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printToolStripMenuItem.Text = "&Print"; + // + // printPreviewToolStripMenuItem + // + this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); + this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; + this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; + // + // printSetupToolStripMenuItem + // + this.printSetupToolStripMenuItem.Name = "printSetupToolStripMenuItem"; + this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.printSetupToolStripMenuItem.Text = "Print Setup"; + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(137, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click); + // + // editMenu + // + this.editMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.undoToolStripMenuItem, + this.redoToolStripMenuItem, + this.toolStripSeparator6, + this.cutToolStripMenuItem, + this.copyToolStripMenuItem, + this.pasteToolStripMenuItem, + this.toolStripSeparator7, + this.selectAllToolStripMenuItem}); + this.editMenu.Name = "editMenu"; + this.editMenu.Size = new System.Drawing.Size(37, 20); + this.editMenu.Text = "&Edit"; + // + // undoToolStripMenuItem + // + this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("undoToolStripMenuItem.Image"))); + this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; + this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.undoToolStripMenuItem.Text = "&Undo"; + // + // redoToolStripMenuItem + // + this.redoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("redoToolStripMenuItem.Image"))); + this.redoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; + this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); + this.redoToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.redoToolStripMenuItem.Text = "&Redo"; + // + // toolStripSeparator6 + // + this.toolStripSeparator6.Name = "toolStripSeparator6"; + this.toolStripSeparator6.Size = new System.Drawing.Size(153, 6); + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); + this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.cutToolStripMenuItem.Text = "Cu&t"; + this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); + this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.copyToolStripMenuItem.Text = "&Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click); + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); + this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black; + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.pasteToolStripMenuItem.Text = "&Paste"; + this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(153, 6); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.selectAllToolStripMenuItem.Text = "Select &All"; + // + // viewMenu + // + this.viewMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolBarToolStripMenuItem, + this.statusBarToolStripMenuItem}); + this.viewMenu.Name = "viewMenu"; + this.viewMenu.Size = new System.Drawing.Size(41, 20); + this.viewMenu.Text = "&View"; + // + // toolBarToolStripMenuItem + // + this.toolBarToolStripMenuItem.Checked = true; + this.toolBarToolStripMenuItem.CheckOnClick = true; + this.toolBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.toolBarToolStripMenuItem.Name = "toolBarToolStripMenuItem"; + this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(124, 22); + this.toolBarToolStripMenuItem.Text = "&Toolbar"; + this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click); + // + // statusBarToolStripMenuItem + // + this.statusBarToolStripMenuItem.Checked = true; + this.statusBarToolStripMenuItem.CheckOnClick = true; + this.statusBarToolStripMenu... [truncated message content] |
From: <je...@us...> - 2008-04-09 16:59:49
|
Revision: 356 http://freetrain.svn.sourceforge.net/freetrain/?rev=356&view=rev Author: jendave Date: 2008-04-09 09:59:54 -0700 (Wed, 09 Apr 2008) Log Message: ----------- cleanups Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs branches/FreeTrainSDL/core/Framework/ResourceUtil.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/World/Direction.cs branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/RailPattern.cs branches/FreeTrainSDL/core/World/Rail/Train.cs branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -141,7 +141,7 @@ private static ISprite getSprite() { - return ResourceUtil.removerChip; + return ResourceUtil.RemoverChip; //return ResourceUtil.emptyChip; } } Modified: branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -46,7 +46,7 @@ string href = XmlUtil.SelectSingleNode(e, "sound/@href").InnerText; sound = new RepeatableSoundEffectImpl( - ResourceUtil.loadSound(XmlUtil.Resolve(e, href))); + ResourceUtil.LoadSound(XmlUtil.Resolve(e, href))); } /// <summary> name of this sound </summary> Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -212,7 +212,7 @@ if (owner.isPlacing) LandPropertyVoxel.sprite.DrawAlpha(canvas.Surface, pt); else - ResourceUtil.emptyChip.DrawAlpha(canvas.Surface, pt); + ResourceUtil.EmptyChip.DrawAlpha(canvas.Surface, pt); } } Modified: branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -66,7 +66,7 @@ /// <param name="pt"></param> protected override void Draw(Direction d, DrawContext canvas, Point pt) { - ResourceUtil.emptyChip.DrawShape(canvas.Surface, pt, Color.Blue); + ResourceUtil.EmptyChip.DrawShape(canvas.Surface, pt, Color.Blue); // RoadPattern.getStraight(d).drawAlpha( canvas.surface, pt ); } Modified: branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -88,7 +88,7 @@ /// <summary> Clears the canvas by tiling empty chips. </summary> public void Clear() { - ISprite empty = ResourceUtil.getGroundChip(WorldDefinition.World); + ISprite empty = ResourceUtil.GetGroundChip(WorldDefinition.World); for (int y = (ptOrigin.Y % 8) - 16; y < pixelSize.Height; y += 8) { int x = (ptOrigin.X % 32) - 64; Modified: branches/FreeTrainSDL/core/Framework/ResourceUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/ResourceUtil.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Framework/ResourceUtil.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -24,7 +24,7 @@ using System.IO; using System.Net; using System.Reflection; -//using org.kohsuke.directaudio; + using SdlDotNet.Audio; using FreeTrain.Util; using FreeTrain.Framework.Graphics; @@ -48,32 +48,38 @@ string resourcesDirectory = "Resources"; path = Path.Combine(Core.InstallationDirectory, Path.Combine(resourcesDirectory, name)); - if (File.Exists(path)) return path; + if (File.Exists(path)) + { + return path; + } path = Path.Combine(Core.InstallationDirectory, Path.Combine("..", Path.Combine("..", Path.Combine("core", Path.Combine(resourcesDirectory, name))))); - if (File.Exists(path)) return path; + if (File.Exists(path)) + { + return path; + } path = Path.Combine("..", Path.Combine("..", Path.Combine(resourcesDirectory, name))); - if (File.Exists(path)) return path; + if (File.Exists(path)) + { + return path; + } path = Path.Combine("..", Path.Combine(resourcesDirectory, name)); - if (File.Exists(path)) return path; + if (File.Exists(path)) + { + return path; + } Assembly assembly = Assembly.GetAssembly(typeof(ResourceUtil)); path = Path.Combine(Path.Combine(assembly.Location, ".."), Path.Combine(resourcesDirectory, name)); - if (File.Exists(path)) return path; + if (File.Exists(path)) + { + return path; + } throw new FileNotFoundException("System resource: " + path); } - // private static WebResponse getStream( Uri uri ) { - // return WebRequest.Create(uri).GetResponse(); - // } - - // public static Bitmap loadBitmap( string location ) { - // using(WebResponse res = getStream(uri)) { - // return new Bitmap(res.GetResponseStream()); - // } - // } /// <summary> /// /// </summary> @@ -84,17 +90,12 @@ return new Bitmap(FindSystemResource(name)); } - // public static Icon loadIcon( Uri uri) { - // using(WebResponse res = getStream(uri)) { - // return new Icon(res.GetResponseStream()); - // } - // } /// <summary> /// /// </summary> /// <param name="name"></param> /// <returns></returns> - public static SdlDotNet.Audio.Sound loadSystemSound(String name) + public static SdlDotNet.Audio.Sound LoadSystemSound(String name) { // can't read from stream return new SdlDotNet.Audio.Sound(FindSystemResource(name)); @@ -107,106 +108,146 @@ /// </summary> /// <param name="uri"></param> /// <returns></returns> - public static SdlDotNet.Audio.Sound loadSound(Uri uri) + public static SdlDotNet.Audio.Sound LoadSound(Uri uri) { return new SdlDotNet.Audio.Sound(uri.LocalPath); } + /// <summary> /// /// </summary> /// <param name="name"></param> /// <returns></returns> - public static Picture loadSystemPicture(string name) + public static Picture LoadSystemPicture(string name) { string id = "{8AD4EF28-CBEF-4C73-A8FF-5772B87EF005}:" + name; // check if it has already been loaded if (PictureManager.contains(id)) + { return PictureManager.get(id); + } // otherwise load a new picture return new Picture(id, FindSystemResource(name)); } + /// <summary> /// /// </summary> /// <param name="dayname"></param> /// <param name="nightname"></param> /// <returns></returns> - public static Picture loadSystemPicture(string dayname, string nightname) + public static Picture LoadSystemPicture(string dayName, string nightName) { - string id = "{8AD4EF28-CBEF-4C73-A8FF-5772B87EF005}:" + dayname; + string id = "{8AD4EF28-CBEF-4C73-A8FF-5772B87EF005}:" + dayName; // check if it has already been loaded if (PictureManager.contains(id)) + { return PictureManager.get(id); + } // otherwise load a new picture - return new Picture(id, FindSystemResource(dayname), FindSystemResource(nightname)); + return new Picture(id, FindSystemResource(dayName), FindSystemResource(nightName)); } + /// <summary> /// /// </summary> /// <param name="name"></param> /// <returns></returns> - public static Surface loadTimeIndependentSystemSurface(string name) + public static Surface LoadTimeIndependentSystemSurface(string name) { //using(Bitmap bmp=loadSystemBitmap(name)) // return directDraw.createSprite(bmp); return new Surface(FindSystemResource(name)); } - - /// <summary> /// DirectDraw instance for loading surface objects. /// </summary> //public static readonly DirectDraw directDraw = new DirectDraw(); - private static Picture emptyChips = loadSystemPicture("EmptyChip.bmp", "EmptyChip_n.bmp"); - private static Picture cursorChips = loadSystemPicture("cursorChip.bmp", "cursorChip.bmp"); + private static Picture emptyChips = LoadSystemPicture("EmptyChip.bmp", "EmptyChip_n.bmp"); + private static Picture cursorChips = LoadSystemPicture("cursorChip.bmp", "cursorChip.bmp"); /// <summary> /// /// </summary> - public static ISprite emptyChip + public static ISprite EmptyChip { get { return groundChips[0]; } } + /// <summary> /// /// </summary> /// <param name="w"></param> /// <returns></returns> - public static ISprite getGroundChip(WorldDefinition w) + public static ISprite GetGroundChip(WorldDefinition world) { - if (w.Clock.season != Season.Winter) + if (world.Clock.season != Season.Winter) + { return groundChips[0]; + } else + { return groundChips[1]; + } } private static ISprite[] groundChips = new ISprite[]{ new SimpleSprite(emptyChips,new Point(0,0),new Point( 0,0),new Size(32,16)), new SimpleSprite(emptyChips,new Point(0,0),new Point(32,0),new Size(32,16)) }; + /// <summary> /// /// </summary> - public static ISprite removerChip = + private static ISprite removerChip = new SimpleSprite(cursorChips, new Point(0, 0), new Point(0, 0), new Size(32, 16)); + /// <summary> /// /// </summary> - public static ISprite underWaterChip = + public static ISprite RemoverChip + { + get { return ResourceUtil.removerChip; } + set { ResourceUtil.removerChip = value; } + } + + /// <summary> + /// + /// </summary> + private static ISprite underWaterChip = new SimpleSprite(emptyChips, new Point(0, 0), new Point(64, 0), new Size(32, 16)); + /// <summary> /// /// </summary> - public static ISprite underGroundChip = + public static ISprite UnderWaterChip + { + get { return ResourceUtil.underWaterChip; } + set { ResourceUtil.underWaterChip = value; } + } + + /// <summary> + /// + /// </summary> + private static ISprite underGroundChip = new SimpleSprite(emptyChips, new Point(0, 0), new Point(96, 0), new Size(32, 16)); + + /// <summary> + /// + /// </summary> + public static ISprite UnderGroundChip + { + get { return ResourceUtil.underGroundChip; } + set { ResourceUtil.underGroundChip = value; } + } } } Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-09 16:59:54 UTC (rev 356) @@ -372,147 +372,147 @@ <Compile Include="Controllers\Terrain\MountainController.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\AboutDialog.cs"> + <Compile Include="Controllers\Framework\AboutDialog.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\BGMManager.cs"> + <Compile Include="Controllers\Framework\BGMManager.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\BGMPlaylist.cs"> + <Compile Include="Controllers\Framework\BGMPlaylist.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\BGMPlaylist.Designer.cs"> + <Compile Include="Controllers\Framework\BGMPlaylist.Designer.cs"> <DependentUpon>BGMPlaylist.cs</DependentUpon> </Compile> - <Compile Include="Framework\ConfigDialog.cs"> + <Compile Include="Controllers\Framework\ConfigDialog.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\AboutDialog.Designer.cs"> + <Compile Include="Controllers\Framework\AboutDialog.Designer.cs"> <DependentUpon>AboutDialog.cs</DependentUpon> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\Graphics\NightSurfaceLoader.cs" /> - <Compile Include="Framework\Graphics\BitmapSurfaceLoader.cs" /> - <Compile Include="Framework\Graphics\ISprite.cs" /> - <Compile Include="Framework\Graphics\ISurfaceLoader.cs" /> - <Compile Include="Framework\Plugin\IContributionFactory.cs" /> - <Compile Include="Framework\Splash.Designer.cs"> + <Compile Include="Controllers\Framework\Graphics\NightSurfaceLoader.cs" /> + <Compile Include="Controllers\Framework\Graphics\BitmapSurfaceLoader.cs" /> + <Compile Include="Controllers\Framework\Graphics\ISprite.cs" /> + <Compile Include="Controllers\Framework\Graphics\ISurfaceLoader.cs" /> + <Compile Include="Controllers\Framework\Plugin\IContributionFactory.cs" /> + <Compile Include="Controllers\Framework\Splash.Designer.cs"> <DependentUpon>Splash.cs</DependentUpon> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\Core.cs"> + <Compile Include="Controllers\Framework\Core.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\ErrorMessageBox.cs"> + <Compile Include="Controllers\Framework\ErrorMessageBox.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\ExternToolsHelper.cs"> + <Compile Include="Controllers\Framework\ExternToolsHelper.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\GlobalOptions.cs"> + <Compile Include="Controllers\Framework\GlobalOptions.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\AlphaBlendSpriteSet.cs"> + <Compile Include="Controllers\Framework\Graphics\AlphaBlendSpriteSet.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\ColorLibrary.cs"> + <Compile Include="Controllers\Framework\Graphics\ColorLibrary.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\ColorMap.cs"> + <Compile Include="Controllers\Framework\Graphics\ColorMap.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\ColorMappedSprite.cs"> + <Compile Include="Controllers\Framework\Graphics\ColorMappedSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\DefaultSpriteLoaderContributionImpl.cs"> + <Compile Include="Controllers\Framework\Graphics\DefaultSpriteLoaderContributionImpl.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\DirectSprite.cs"> + <Compile Include="Controllers\Framework\Graphics\DirectSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\DirtyRect.cs"> + <Compile Include="Controllers\Framework\Graphics\DirtyRect.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\GraphicsException.cs"> + <Compile Include="Controllers\Framework\Graphics\GraphicsException.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\HueTransformSprite.cs"> + <Compile Include="Controllers\Framework\Graphics\HueTransformSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\NullSprite.cs"> + <Compile Include="Controllers\Framework\Graphics\NullSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\Picture.cs"> + <Compile Include="Controllers\Framework\Graphics\Picture.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\PictureManager.cs"> + <Compile Include="Controllers\Framework\Graphics\PictureManager.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\PreviewDrawer.cs"> + <Compile Include="Controllers\Framework\Graphics\PreviewDrawer.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\SimpleSprite.cs"> + <Compile Include="Controllers\Framework\Graphics\SimpleSprite.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\SpriteFactory.cs"> + <Compile Include="Controllers\Framework\Graphics\SpriteFactory.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\SpriteFactoryContribution.cs"> + <Compile Include="Controllers\Framework\Graphics\SpriteFactoryContribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\SpriteLoaderContribution.cs"> + <Compile Include="Controllers\Framework\Graphics\SpriteLoaderContribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\MainWindow.cs"> + <Compile Include="Controllers\Framework\MainWindow.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\MainWindow.Designer.cs"> + <Compile Include="Controllers\Framework\MainWindow.Designer.cs"> <DependentUpon>MainWindow.cs</DependentUpon> </Compile> - <Compile Include="Framework\NewWorldDialog.cs"> + <Compile Include="Controllers\Framework\NewWorldDialog.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\PersistentOptions.cs"> + <Compile Include="Controllers\Framework\PersistentOptions.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\Contribution.cs"> + <Compile Include="Controllers\Framework\Plugin\Contribution.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\DynamicContributionFactory.cs"> + <Compile Include="Controllers\Framework\Plugin\DynamicContributionFactory.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\FixedClassContributionFactory.cs"> + <Compile Include="Controllers\Framework\Plugin\FixedClassContributionFactory.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\PluginDefinition.cs" /> - <Compile Include="Framework\Plugin\PluginListDialog.cs"> + <Compile Include="Controllers\Framework\Plugin\PluginDefinition.cs" /> + <Compile Include="Controllers\Framework\Plugin\PluginListDialog.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Framework\Plugin\PluginManager.cs"> + <Compile Include="Controllers\Framework\Plugin\PluginManager.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\PluginSerializationBinder.cs"> + <Compile Include="Controllers\Framework\Plugin\PluginSerializationBinder.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\PluginUtil.cs"> + <Compile Include="Controllers\Framework\Plugin\PluginUtil.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Plugin\XmlUtil.cs"> + <Compile Include="Controllers\Framework\Plugin\XmlUtil.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\ResourceUtil.cs"> + <Compile Include="Controllers\Framework\ResourceUtil.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Sound\RepeatableSoundEffectImpl.cs"> + <Compile Include="Controllers\Framework\Sound\RepeatableSoundEffectImpl.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Sound\SoundEffect.cs"> + <Compile Include="Controllers\Framework\Sound\SoundEffect.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Sound\SoundEffectManager.cs"> + <Compile Include="Controllers\Framework\Sound\SoundEffectManager.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Splash.cs"> + <Compile Include="Controllers\Framework\Splash.cs"> <SubType>Form</SubType> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> @@ -569,7 +569,7 @@ <Compile Include="Util\Set.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="Framework\Graphics\Surface.cs" /> + <Compile Include="Controllers\Framework\Graphics\Surface.cs" /> <Compile Include="Util\Translation.cs" /> <Compile Include="Util\UrlInvoker.cs"> <SubType>Code</SubType> @@ -962,31 +962,31 @@ <EmbeddedResource Include="Controllers\Terrain\MountainController.resx"> <DependentUpon>MountainController.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\AboutDialog.resx"> + <EmbeddedResource Include="Controllers\Framework\AboutDialog.resx"> <DependentUpon>AboutDialog.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Framework\BGMPlaylist.resx"> + <EmbeddedResource Include="Controllers\Framework\BGMPlaylist.resx"> <SubType>Designer</SubType> <DependentUpon>BGMPlaylist.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\ConfigDialog.resx"> + <EmbeddedResource Include="Controllers\Framework\ConfigDialog.resx"> <DependentUpon>ConfigDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\ErrorMessageBox.resx"> + <EmbeddedResource Include="Controllers\Framework\ErrorMessageBox.resx"> <DependentUpon>ErrorMessageBox.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\MainWindow.resx"> + <EmbeddedResource Include="Controllers\Framework\MainWindow.resx"> <SubType>Designer</SubType> <DependentUpon>MainWindow.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\NewWorldDialog.resx"> + <EmbeddedResource Include="Controllers\Framework\NewWorldDialog.resx"> <DependentUpon>NewWorldDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\Plugin\PluginListDialog.resx"> + <EmbeddedResource Include="Controllers\Framework\Plugin\PluginListDialog.resx"> <DependentUpon>PluginListDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Framework\Splash.resx"> + <EmbeddedResource Include="Controllers\Framework\Splash.resx"> <DependentUpon>Splash.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.sv-SE.resx"> Modified: branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -409,8 +409,8 @@ int Z = HeightCutHeight; int Vmax = Math.Min(rectHV.Bottom + Z * 2, world.Size.y - 1); - emptyChip = ResourceUtil.getGroundChip(world); - waterChip = ResourceUtil.underWaterChip; + emptyChip = ResourceUtil.GetGroundChip(world); + waterChip = ResourceUtil.UnderWaterChip; for (int v = Math.Max(0, rectHV.Top); v <= Vmax; v++) { @@ -461,7 +461,7 @@ { // if the surface voxel is not drawn, draw the "under group" chip if (shouldDrawGround(h, v, z)) - ResourceUtil.underGroundChip.Draw(drawContext.Surface, pt); + ResourceUtil.UnderGroundChip.Draw(drawContext.Surface, pt); } } // } Modified: branches/FreeTrainSDL/core/World/Direction.cs =================================================================== --- branches/FreeTrainSDL/core/World/Direction.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Direction.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -161,8 +161,8 @@ } - private static readonly Surface arrowImage = ResourceUtil.loadTimeIndependentSystemSurface("Arrows.bmp"); - private static readonly Surface darkArrowImage = ResourceUtil.loadTimeIndependentSystemSurface("Arrows.dark.bmp"); + private static readonly Surface arrowImage = ResourceUtil.LoadTimeIndependentSystemSurface("Arrows.bmp"); + private static readonly Surface darkArrowImage = ResourceUtil.LoadTimeIndependentSystemSurface("Arrows.dark.bmp"); /// <summary> Draws an arrow on the given surface. </summary> public void drawArrow(Surface display, Point pt, bool isDark) Modified: branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -185,7 +185,7 @@ - private static readonly Picture theImage = ResourceUtil.loadSystemPicture("BridgePier.bmp"); + private static readonly Picture theImage = ResourceUtil.LoadSystemPicture("BridgePier.bmp"); /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -283,7 +283,7 @@ static FatPlatform() { sprites = new ISprite[4]; - Picture bmp = ResourceUtil.loadSystemPicture("FatPlatform.bmp"); // don't dispose this surface + Picture bmp = ResourceUtil.LoadSystemPicture("FatPlatform.bmp"); // don't dispose this surface sprites[0] = sprites[2] = new SimpleSprite(bmp, new Point(0, 16), new Point(0, 0), new Size(32, 32)); sprites[1] = sprites[3] = new SimpleSprite(bmp, new Point(0, 16), new Point(32, 0), new Size(32, 32)); } @@ -396,7 +396,7 @@ /// /// </summary> private static readonly ISprite theImage = - new SimpleSprite(ResourceUtil.loadSystemPicture("YardChip.bmp"), + new SimpleSprite(ResourceUtil.LoadSystemPicture("YardChip.bmp"), new Point(0, 0), new Point(0, 0), new Size(32, 16)); /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Rail/Platform.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -303,7 +303,7 @@ /// <summary> Warning icon. </summary> protected static readonly Surface warningIcon = - ResourceUtil.loadTimeIndependentSystemSurface("caution.bmp"); + ResourceUtil.LoadTimeIndependentSystemSurface("caution.bmp"); /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Rail/RailPattern.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/RailPattern.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Rail/RailPattern.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -38,8 +38,8 @@ /// <summary> /// Sprite that contains the images of all patterns. /// </summary> - private static readonly Picture railChips = ResourceUtil.loadSystemPicture("RailRoads.bmp", "RailRoads_n.bmp"); - private static readonly Picture ugChips = ResourceUtil.loadSystemPicture("ugslope.bmp"); + private static readonly Picture railChips = ResourceUtil.LoadSystemPicture("RailRoads.bmp", "RailRoads_n.bmp"); + private static readonly Picture ugChips = ResourceUtil.LoadSystemPicture("ugslope.bmp"); // single rail road private static readonly RailPattern[] singlePatterns = new RailPattern[] { Modified: branches/FreeTrainSDL/core/World/Rail/Train.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -69,7 +69,7 @@ /// Sound-effect of a ringing bell. Used when a train leaves a station. /// </summary> private static readonly ISoundEffect thudSound = new RepeatableSoundEffectImpl( - ResourceUtil.loadSystemSound("train.wav"), 1, 300); + ResourceUtil.LoadSystemSound("train.wav"), 1, 300); Modified: branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -476,7 +476,7 @@ static VoxelImpl() { // load fence sprites - Picture fence = ResourceUtil.loadSystemPicture("ConstructionFence.bmp"); + Picture fence = ResourceUtil.LoadSystemPicture("ConstructionFence.bmp"); fenceSprites = new ISprite[4/*direction*/, 2/*door or no door*/]; for (int i = 0; i < 4; i++) fenceSprites[i, 0] = new SimpleSprite(fence, new Point(0, 16), new Point(32 * i, 0), new Size(32, 32)); @@ -489,7 +489,7 @@ // load ground sprites - Picture ground = ResourceUtil.loadSystemPicture("ConstructionGround.bmp"); + Picture ground = ResourceUtil.LoadSystemPicture("ConstructionGround.bmp"); groundSprites = new ISprite[7]; groundSprites[0] = new SimpleSprite(// ground @@ -509,7 +509,7 @@ // load bone sprites - Picture bone = ResourceUtil.loadSystemPicture("ConstructionBones.bmp"); + Picture bone = ResourceUtil.LoadSystemPicture("ConstructionBones.bmp"); boneSprites = new ISprite[3, 2, 2, 2, 2]; for (int l = 0; l < 3; l++) @@ -532,7 +532,7 @@ } // loa dwall sprites - Picture wall = ResourceUtil.loadSystemPicture("ConstructionWall.bmp"); + Picture wall = ResourceUtil.LoadSystemPicture("ConstructionWall.bmp"); wallSprites = new ISprite[4]; wallSprites[0] = new SimpleSprite(wall, Modified: branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -162,7 +162,7 @@ { // drawing in the height cut mode if (this.location.z == o.baseLocation.z) - ResourceUtil.emptyChip.DrawShape(display.Surface, pt, o.heightCutColor); + ResourceUtil.EmptyChip.DrawShape(display.Surface, pt, o.heightCutColor); } } } Modified: branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs =================================================================== --- branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -236,7 +236,7 @@ } else if (z == 0) - ResourceUtil.emptyChip.DrawShape(display.Surface, pt, o.heightCutColor); + ResourceUtil.EmptyChip.DrawShape(display.Surface, pt, o.heightCutColor); } } Modified: branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -256,7 +256,7 @@ if (heightCutDiff == 0) { - ResourceUtil.emptyChip.DrawShape(display.Surface, pt, + ResourceUtil.EmptyChip.DrawShape(display.Surface, pt, isUnderWater ? waterColors[3] : currentMountainColors[3]); return; } @@ -525,7 +525,7 @@ /// <summary> Load sprites for cliffs. </summary> private static void initCliffSprites() { - Picture picture = ResourceUtil.loadSystemPicture("cliff.bmp"); + Picture picture = ResourceUtil.LoadSystemPicture("cliff.bmp"); for (int side = 0; side < 2; side++) { for (int l = 0; l <= 4; l++) Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs 2008-04-09 16:09:59 UTC (rev 355) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs 2008-04-09 16:59:54 UTC (rev 356) @@ -359,9 +359,9 @@ public override void draw(DrawContext display, Point pt, int heightCutDiff) { if (heightCutDiff >= 0) - ResourceUtil.emptyChip.DrawShape(display.Surface, pt, owner.heightCutColor); + ResourceUtil.EmptyChip.DrawShape(display.Surface, pt, owner.heightCutColor); else - ResourceUtil.emptyChip.Draw(display.Surface, pt); + ResourceUtil.EmptyChip.Draw(display.Surface, pt); // above line is needed when my(=477) patch is applied. if (owner.backside != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-09 17:33:12
|
Revision: 357 http://freetrain.svn.sourceforge.net/freetrain/?rev=357&view=rev Author: jendave Date: 2008-04-09 10:32:58 -0700 (Wed, 09 Apr 2008) Log Message: ----------- Made the pluginmanager a static class Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs branches/FreeTrainSDL/core/Controllers/Land/BulldozeController.cs branches/FreeTrainSDL/core/Controllers/Land/LandController.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs branches/FreeTrainSDL/core/Framework/BGMManager.cs branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs branches/FreeTrainSDL/core/Framework/Core.cs branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorLibrary.cs branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactory.cs branches/FreeTrainSDL/core/Framework/NewWorldDialog.cs branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginSerializationBinder.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs branches/FreeTrainSDL/core/Framework/ResourceUtil.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/World/Accounting/AccountGenre.cs branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs branches/FreeTrainSDL/core/World/Accounting/GenreSelectorDialog.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/WorldDefinition.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -308,7 +308,7 @@ /// <returns></returns> public object GetRealObject(StreamingContext context) { - return ((StructureContribution)PluginManager.theInstance.getContribution(id)).Population; + return ((StructureContribution)PluginManager.GetContribution(id)).Population; } } } Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -70,7 +70,7 @@ /// <returns></returns> protected override StructureGroup GetGroup(string name) { - return (StructureGroup)PluginManager.theInstance.landBuilderGroup[name]; + return (StructureGroup)PluginManager.LandBuilderGroup[name]; } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -59,7 +59,7 @@ private StaticLandBuilder getLand() { return (StaticLandBuilder) - PluginManager.theInstance.getContribution(lands[random.Next(lands.Length)]); + PluginManager.GetContribution(lands[random.Next(lands.Length)]); } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -72,7 +72,7 @@ get { return (DepartureBellContribution[]) - PluginManager.theInstance.listContributions(typeof(DepartureBellContribution)); + PluginManager.ListContributions(typeof(DepartureBellContribution)); } } @@ -81,8 +81,8 @@ { get { - return (DepartureBellContribution)PluginManager.theInstance - .getContribution("{9B087AEA-6E9C-48cd-A1F3-1B774500752E}"); + return (DepartureBellContribution)PluginManager + .GetContribution("{9B087AEA-6E9C-48cd-A1F3-1B774500752E}"); } } } Modified: branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Rail/RailStationaryContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -46,7 +46,7 @@ /// <returns></returns> protected override StructureGroup GetGroup(string name) { - return PluginManager.theInstance.railStationaryGroup[name]; + return PluginManager.RailStationaryGroup[name]; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -53,7 +53,7 @@ /// <returns></returns> protected override StructureGroup GetGroup(string name) { - return PluginManager.theInstance.stationGroup[name]; + return PluginManager.StationGroup[name]; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Structs/CommercialStructureContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -57,7 +57,7 @@ /// <returns></returns> protected override StructureGroup GetGroup(string name) { - return PluginManager.theInstance.commercialStructureGroup[name]; + return PluginManager.CommercialStructureGroup[name]; } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -99,7 +99,7 @@ /// <returns></returns> protected override StructureGroup GetGroup(string name) { - return PluginManager.theInstance.varHeightBuildingsGroup[name]; + return PluginManager.varHeightBuildingsGroup[name]; } private ISprite[][,] loadSpriteSets(XmlNodeList list) Modified: branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Train/ColoredTrainCarImpl.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -257,7 +257,7 @@ public static ColoredTrainPictureContribution get(string id) { return (ColoredTrainPictureContribution) - PluginManager.theInstance.getContribution(id); + PluginManager.GetContribution(id); } /// <summary> @@ -266,7 +266,7 @@ public static ColoredTrainPictureContribution[] list() { return (ColoredTrainPictureContribution[]) - PluginManager.theInstance.listContributions(typeof(ColoredTrainPictureContribution)); + PluginManager.ListContributions(typeof(ColoredTrainPictureContribution)); } } Modified: branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Train/ParamTrainImpl.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -94,7 +94,7 @@ string idref = e.Attributes["carRef"].Value; if (Id == null) throw new FormatException("carRef܂"); - TrainCarContribution contrib = (TrainCarContribution)Core.Plugins.getContribution(idref); + TrainCarContribution contrib = (TrainCarContribution)PluginManager.GetContribution(idref); if (contrib == null) throw new FormatException( string.Format("id='{0}'TrainCarRgr[V܂", idref)); Modified: branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Train/PatternTrainImpl.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -109,7 +109,7 @@ if (idref == null) throw new FormatException("ref attribute is missing"); //! if(idref==null) throw new FormatException("ref属性がありません"); - TrainCarContribution contrib = (TrainCarContribution)Core.Plugins.getContribution(idref); + TrainCarContribution contrib = (TrainCarContribution)PluginManager.GetContribution(idref); if (contrib == null) throw new FormatException( string.Format("id='{0}' is missing TrainCar contribution", idref)); //! string.Format( "id='{0}'のTrainCarコントリビューションがありません", idref )); Modified: branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Contributions/Train/ReverseTrainCarImpl.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -56,7 +56,7 @@ /// </summary> protected internal override void OnInitComplete() { - core = Core.Plugins.getContribution(baseId) as TrainCarContribution; + core = PluginManager.GetContribution(baseId) as TrainCarContribution; if (core == null) throw new FormatException("'" + Id + "' refers to TrainCar contribution '" + baseId + "' that could not be found"); //! throw new FormatException("'"+id+"'が参照するTrainCarコントリビューション'"+baseId+"'が見つかりません"); Modified: branches/FreeTrainSDL/core/Controllers/Land/BulldozeController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/BulldozeController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Land/BulldozeController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -53,7 +53,7 @@ InitializeComponent(); previewBitmap = ResourceUtil.LoadSystemBitmap("bulldozer.bmp"); preview.Image = previewBitmap; - LandBuilderContribution builder = (LandBuilderContribution)PluginManager.theInstance.getContribution("{AE43E6DB-39F0-49FE-BE18-EE3FAC248FDE}"); + LandBuilderContribution builder = (LandBuilderContribution)PluginManager.GetContribution("{AE43E6DB-39F0-49FE-BE18-EE3FAC248FDE}"); //TODO: fix this //currentController = builder.createBuilder(new ControllerSiteImpl(this)); } Modified: branches/FreeTrainSDL/core/Controllers/Land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -53,7 +53,7 @@ InitializeComponent(); // load list of lands - groupBox.DataSource = Core.Plugins.landBuilderGroup; + groupBox.DataSource = PluginManager.LandBuilderGroup; groupBox.DisplayMember = "name"; } /// <summary> Modified: branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -66,15 +66,15 @@ // この呼び出しは Windows フォーム デザイナで必要です。 InitializeComponent(); // colorPickButton1.colorLibraries = new IColorLibrary[]{ - // (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-RAINBOW}"), - // (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-STONES}")//, - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-WOODS}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-METALS}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-BRICKS}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-DIRTS}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-PASTEL}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-COLPLATE}"), - //// (IColorLibrary)PluginManager.theInstance.getContribution("{COLORLIB-ROOF}") + // (IColorLibrary)PluginManager.getContribution("{COLORLIB-RAINBOW}"), + // (IColorLibrary)PluginManager.getContribution("{COLORLIB-STONES}")//, + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-WOODS}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-METALS}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-BRICKS}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-DIRTS}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-PASTEL}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-COLPLATE}"), + //// (IColorLibrary)PluginManager.getContribution("{COLORLIB-ROOF}") // }; //do translation, if you put this in InitialiseComponent then it will get overridden by the @@ -120,7 +120,7 @@ dirW.Image = bitmapW; // load station type list - stationType.DataSource = Core.Plugins.stationGroup; + stationType.DataSource = PluginManager.StationGroup; stationType.DisplayMember = "name"; updateAfterResize(null, null); Modified: branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -58,7 +58,7 @@ } #endregion - private StationaryStructPlacementController() : base(Core.Plugins.railStationaryGroup) { } + private StationaryStructPlacementController() : base(PluginManager.RailStationaryGroup) { } /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -237,7 +237,7 @@ { // reset menu items newTCMenu.MenuItems.Clear(); - foreach (TrainControllerContribution contrib in Core.Plugins.trainControllers) + foreach (TrainControllerContribution contrib in PluginManager.TrainControllers) { MenuItem mi = new MenuItem(contrib.name); mi.Click += new EventHandler(new TCCreator(this, contrib).onMenuSelected); Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -54,7 +54,7 @@ // organize trains into a tree IDictionary types = new SortedList(); - foreach (TrainContribution tc in Core.Plugins.trains) + foreach (TrainContribution tc in PluginManager.Trains) { IDictionary company = (IDictionary)types[tc.CompanyName]; if (company == null) Modified: branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -185,7 +185,7 @@ private void makeContribTree() { - RoadContribution[] contribs = Core.Plugins.roads; + RoadContribution[] contribs = PluginManager.Roads; if (contribs.Length > 0) { currentContrib = contribs[0]; Modified: branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -57,7 +57,7 @@ } #endregion - private CommercialStructPlacementController() : base(Core.Plugins.commercialStructureGroup) { } + private CommercialStructPlacementController() : base(PluginManager.CommercialStructureGroup) { } /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) Modified: branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -45,7 +45,7 @@ /// /// </summary> public VarHeightBuildingController() - : base(Core.Plugins.varHeightBuildingsGroup) + : base(PluginManager.varHeightBuildingsGroup) { InitializeComponent(); buttonPlace.Top += 24; Modified: branches/FreeTrainSDL/core/Framework/BGMManager.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/BGMManager.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/BGMManager.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -56,7 +56,7 @@ musicMenu.Popup += new EventHandler(silence.update); // populate BGM contributions - foreach( BGMContribution contrib in Core.plugins.bgms ) { + foreach( BGMContribution contrib in PluginManager.bgms ) { MusicMenuItem child = new MusicMenuItem(this,contrib); musicMenu.MenuItems.Add( child ); musicMenu.Popup += new EventHandler(child.update); @@ -79,7 +79,7 @@ /// <param name="songname"></param> public void addSong(string songname) { - foreach (BGMContribution contrib in Core.Plugins.bgms) + foreach (BGMContribution contrib in PluginManager.Bgms) { if (contrib.name == songname) currentPlaylist.Add(contrib); } @@ -90,7 +90,7 @@ /// <param name="songname"></param> public void moveUp(string songname) { - foreach (BGMContribution contrib in Core.Plugins.bgms) + foreach (BGMContribution contrib in PluginManager.Bgms) { if (contrib.name == songname) { @@ -109,7 +109,7 @@ /// <param name="songname"></param> public void moveDown(string songname) { - foreach (BGMContribution contrib in Core.Plugins.bgms) + foreach (BGMContribution contrib in PluginManager.Bgms) { if (contrib.name == songname) { @@ -128,7 +128,7 @@ /// <param name="songname"></param> public void removeSong(string songname) { - foreach (BGMContribution contrib in Core.Plugins.bgms) + foreach (BGMContribution contrib in PluginManager.Bgms) { if (contrib.name == songname) { Modified: branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/BGMPlaylist.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -28,8 +28,8 @@ using FreeTrain.Contributions.Sound; using FreeTrain.Controllers; +using FreeTrain.Framework.Plugin; - namespace FreeTrain.Framework { /// <summary> @@ -99,8 +99,10 @@ { lstBGMs.Items.Clear(); lstCurrentPlaylist.Items.Clear(); - foreach (BGMContribution contrib in Core.Plugins.bgms) + foreach (BGMContribution contrib in PluginManager.Bgms) + { if (!Core.BgmManager.currentPlaylist.Contains(contrib)) lstBGMs.Items.Add(contrib); + } foreach (BGMContribution contrib in Core.BgmManager.currentPlaylist) { lstCurrentPlaylist.Items.Add(contrib); Modified: branches/FreeTrainSDL/core/Framework/Core.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Core.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -56,16 +56,16 @@ } - /// <summary> Plug-ins. </summary> - private static readonly PluginManager plugins = new PluginManager(); + ///// <summary> Plug-ins. </summary> + //private static readonly PluginManager plugins = new PluginManager(); - /// <summary> - /// - /// </summary> - public static PluginManager Plugins - { - get { return Core.plugins; } - } + ///// <summary> + ///// + ///// </summary> + //public static PluginManager Plugins + //{ + // get { return PluginManager; } + //} /// <summary> Global options. </summary> @@ -128,14 +128,14 @@ if (args == null) { - Core.plugins.init(getDefaultProfile(), + PluginManager.Init(getDefaultProfile(), progressHandler, new DefaultPluginErrorHandler(5)); } else { // load plug-ins - Core.plugins.init( + PluginManager.Init( args.Length == 0 ? getDefaultProfile() : parseProfile(args[0]), progressHandler, new DefaultPluginErrorHandler(5)); } @@ -175,7 +175,7 @@ { IList r = new ArrayList(); - string baseDir = PluginManager.getDefaultPluginDirectory(); + string baseDir = PluginManager.GetDefaultPluginDirectory(); foreach (string subdir in Directory.GetDirectories(baseDir)) r.Add(Path.Combine(baseDir, subdir)); Modified: branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/ExternToolsHelper.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -48,11 +48,11 @@ progressHandler = new ProgressHandler(SilentProgress); IList r = new ArrayList(); - string baseDir = PluginManager.getDefaultPluginDirectory(); + string baseDir = PluginManager.GetDefaultPluginDirectory(); foreach (string subdir in Directory.GetDirectories(baseDir)) r.Add(Path.Combine(baseDir, subdir)); // load plug-ins - Core.Plugins.init(r, progressHandler, errorHandler); + PluginManager.Init(r, progressHandler, errorHandler); if (WorldDefinition.World == null) WorldDefinition.World = new WorldDefinition(new Distance(5, 5, 5), 0); initialized = true; @@ -63,7 +63,7 @@ public static void Clear() { // TODO: - //Core.plugins. + //PluginManager. initialized = false; } Modified: branches/FreeTrainSDL/core/Framework/Graphics/ColorLibrary.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/ColorLibrary.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Graphics/ColorLibrary.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -70,7 +70,7 @@ /// </summary> static public ColorLibrary NullLibrary { - get { return (ColorLibrary)PluginManager.theInstance.getContribution(null_id); } + get { return (ColorLibrary)PluginManager.GetContribution(null_id); } } /// <summary> /// Modified: branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactory.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactory.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Graphics/SpriteFactory.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -61,7 +61,7 @@ string name = type.Attributes["name"].Value; // otherwise load from the spriteType element. SpriteFactoryContribution contrib = (SpriteFactoryContribution) - PluginManager.theInstance.getContribution("spriteFactory:" + name); + PluginManager.GetContribution("spriteFactory:" + name); if (contrib == null) throw new FormatException("unable to locate spriteFactory:" + name); return contrib.CreateSpriteFactory(type); Modified: branches/FreeTrainSDL/core/Framework/NewWorldDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/NewWorldDialog.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/NewWorldDialog.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -42,7 +42,7 @@ InitializeComponent(); NewGameContribution[] contribs = (NewGameContribution[]) - PluginManager.theInstance.listContributions(typeof(NewGameContribution)); + PluginManager.ListContributions(typeof(NewGameContribution)); // list view doesn't support databinding. We have to live with // listbox for now. Modified: branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Plugin/Contribution.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -193,7 +193,7 @@ /// <returns></returns> public object GetRealObject(StreamingContext context) { - object o = Core.Plugins.getContribution(id); + object o = PluginManager.GetContribution(id); if (o == null) throw new SerializationException( "Plugin that contains Contribution \"" + id + "\" could not be found"); Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginDefinition.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -141,7 +141,7 @@ (IContributionFactory)PluginUtil.loadObjectFromManifest(contrib); // register it - PluginManager.theInstance.addContributionFactory( + PluginManager.AddContributionFactory( contributionName, factory); } @@ -155,12 +155,12 @@ { ArrayList a = new ArrayList(); if (!this.name.Equals("system")) - a.Add(PluginManager.theInstance.getPlugin("system")); + a.Add(PluginManager.GetPlugin("system")); foreach (XmlElement depend in doc.DocumentElement.SelectNodes("depend")) { string name = depend.Attributes["on"].Value; - PluginDefinition p = PluginManager.theInstance.getPlugin(name); + PluginDefinition p = PluginManager.GetPlugin(name); if (p == null) throw new Exception(String.Format( "Plugin {1} that is needed for plugin {0} could not be found", this.name, name)); @@ -248,10 +248,10 @@ string type = contrib.Attributes["type"].Value; if (type == "contribution") continue; // ignore - IContributionFactory factory = PluginManager.theInstance.getContributionFactory(type); + IContributionFactory factory = PluginManager.GetContributionFactory(type); Contribution c = factory.Load(this, contrib); contributions.Add(c); - PluginManager.theInstance.addContribution(c); + PluginManager.AddContribution(c); c.init(this, baseUri); } catch (Exception e) Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginListDialog.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -166,7 +166,7 @@ { // populate the list list.Items.Clear(); - foreach (PluginDefinition p in Core.Plugins) + foreach (PluginDefinition p in PluginManager.Plugins) { list.Items.Add(new ListViewItem( new string[] { p.title, p.author, p.homepage }, 0)); Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs 2008-04-09 16:59:54 UTC (rev 356) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs 2008-04-09 17:32:58 UTC (rev 357) @@ -37,176 +37,82 @@ namespace FreeTrain.Framework.Plugin { /// <summary> - /// + /// Loads plug-ins. /// </summary> - public interface IPluginErrorHandler + public static class PluginManager { + ///// <summary> The singleton instance. </summary> + //public static PluginManager theInstance; + /// <summary> - /// + /// All loaded plug-ins. /// </summary> - /// <param name="p_1st"></param> - /// <param name="p_2nd"></param> - /// <param name="e"></param> - /// <returns></returns> - bool OnNameDuplicated(PluginDefinition p_1st, PluginDefinition p_2nd, Exception e); + private static PluginDefinition[] plugins; + /// <summary> /// /// </summary> - /// <param name="p"></param> - /// <param name="e"></param> - /// <returns></returns> - bool OnPluginLoadError(PluginDefinition p, Exception e); - /// <summary> - /// - /// </summary> - /// <param name="c"></param> - /// <param name="e"></param> - /// <returns></returns> - bool OnContributionInitError(Contribution c, Exception e); - /// <summary> - /// - /// </summary> - /// <param name="c_1st"></param> - /// <param name="c_2nd"></param> - /// <param name="e"></param> - /// <returns></returns> - bool OnContribIDDuplicated(Contribution c_1st, Contribution c_2nd, Exception e); - /// <summary> - /// - /// </summary> - /// <param name="errorPlugins"></param> - /// <param name="totalErrorCount"></param> - /// <returns></returns> - bool OnFinal(IDictionary errorPlugins, int totalErrorCount); - } - /// <summary> - /// - /// </summary> - public class SilentPluginErrorHandler : IPluginErrorHandler - { - #region PluginErrorHandler o - /// <summary> - /// - /// </summary> - /// <param name="p_1st"></param> - /// <param name="p_2nd"></param> - /// <param name="e"></param> - /// <returns></returns> - public bool OnNameDuplicated(PluginDefinition p_1st, PluginDefinition p_2nd, Exception e) + public static PluginDefinition[] Plugins { - return false; + get { return PluginManager.plugins; } + set { PluginManager.plugins = value; } } - /// <summary> - /// - /// </summary> - /// <param name="p"></param> - /// <param name="e"></param> - /// <returns></returns> - public bool OnPluginLoadError(PluginDefinition p, Exception e) - { - return false; - } - /// <summary> - /// - /// </summary> - /// <param name="c"></param> - /// <param name="e"></param> - /// <returns></returns> - public bool OnContributionInitError(Contribution c, Exception e) - { - return false; - } - /// <summary> - /// - /// </summary> - /// <param name="c_1st"></param> - /// <param name="c_2nd"></param> - /// <param name="e"></param> - /// <returns></returns> - public bool OnContribIDDuplicated(Contribution c_1st, Contribution c_2nd, Exception e) - { - return false; - } - /// <summary> - /// - /// </summary> - /// <param name="errorPlugins"></param> - /// <param name="totalErrorCount"></param> - /// <returns></returns> - public bool OnFinal(IDictionary errorPlugins, int totalErrorCount) - { - return true; - } - #endregion - } - - - /// <summary> - /// Loads plug-ins. - /// </summary> - public class PluginManager - { - - /// <summary> The singleton instance. </summary> - public static PluginManager theInstance; - /// <summary> - /// All loaded plug-ins. - /// </summary> - private PluginDefinition[] plugins; - - /// <summary> /// Plugins keyed by their names. /// </summary> - private readonly IDictionary pluginMap = new Hashtable(); + private static readonly IDictionary pluginMap = new Hashtable(); /// <summary> /// Contribution factories that are used to load contributions. /// </summary> - private readonly IDictionary contributionFactories = new Hashtable(); + private static readonly IDictionary contributionFactories = new Hashtable(); /// <summary> /// Contributions keyed by their IDs. /// </summary> - private readonly IDictionary contributionMap = new Hashtable(); + private static readonly IDictionary contributionMap = new Hashtable(); - /// <summary> /// /// </summary> - public PluginManager() + static PluginManager() { - theInstance = this; + //theInstance = this; - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(onAssemblyResolve); + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(OnAssemblyResolve); } - private static string getModuleName(string name) + private static string GetModuleName(string name) { return name.Substring(0, name.IndexOf(',')); } - private static Assembly onAssemblyResolve(object sender, ResolveEventArgs args) + private static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args) { // TODO: improve performance by having a dictionary from name to Assemblies. // TODO: what is the correct way to use an application specific logic to resolve assemblies Trace.WriteLine("onAssemblyResolve resolving " + args.Name); - string name = getModuleName(args.Name); + string name = GetModuleName(args.Name); - if (Core.Plugins.plugins == null) return null; + if (PluginManager.plugins == null) + { + return null; + } // try assemblies of plug-ins - foreach (Contribution cont in Core.Plugins.publicContributions) + foreach (Contribution cont in PluginManager.PublicContributions) { Assembly asm = cont.Assembly; - if (getModuleName(asm.FullName) == name) + if (GetModuleName(asm.FullName) == name) + { return asm; + } } - Trace.WriteLine("onAssemblyResolve failed"); + Trace.WriteLine("OnAssemblyResolve failed"); return null; } @@ -220,7 +126,7 @@ /// </param> /// <param name="errorHandler"></param> /// <param name="progressHandler"></param> - public void init(ICollection dirs, ProgressHandler progressHandler, IPluginErrorHandler errorHandler) + public static void Init(ICollection dirs, ProgressHandler progressHandler, IPluginErrorHandler errorHandler) { Set pluginSet = new Set(); @@ -230,7 +136,9 @@ float c_max = dirs.Count * 4; bool errBreak = false; if (errorHandler == null) + { errorHandler = new SilentPluginErrorHandler(); + } // locate plugins foreach (string dir in dirs) @@ -239,7 +147,9 @@ //! progressHandler("プラグインを検索中\n"+Path.GetFileName(dir),++count/c_max); if (!File.Exists(Path.Combine(dir, "plugin.xml"))) + { continue; // this directory doesn't have the plugin.xml file. + } PluginDefinition p = null; try { @@ -253,9 +163,13 @@ errorPlugins.Add(p, e); errBreak = errorHandler.OnPluginLoadError(p, e); if (errBreak) + { break; + } else + { continue; + } } if (pluginMap.Contains(p.name)) { @@ -268,18 +182,24 @@ errBreak = errorHandler.OnNameDuplicated(pluginMap[p.name] as PluginDefinition, p, e); errorPlugins.Add(p, e); if (errBreak) + { break; + } else + { continue; + } } pluginMap.Add(p.name, p); pluginSet.add(p); } if (errBreak) + { Environment.Exit(-1); + } {// convert it to an array by sorting them in the order of dependency - this.plugins = new PluginDefinition[pluginSet.Count]; + plugins = new PluginDefinition[pluginSet.Count]; int ptr = 0; PluginDefinition p = null; while (!pluginSet.isEmpty) @@ -294,12 +214,20 @@ PluginDefinition[] deps = p.getDependencies(); int i; for (i = 0; i < deps.Length; i++) + { if (pluginSet.contains(deps[i])) + { break; + } + } if (i == deps.Length) + { break; + } else + { p = deps[i]; + } } } catch (Exception e) @@ -307,16 +235,22 @@ errCount++; errBreak = errorHandler.OnPluginLoadError(p, e); if (!errorPlugins.ContainsKey(p)) + { errorPlugins.Add(p, e); + } if (errBreak) + { break; + } } pluginSet.remove(p); plugins[ptr++] = p; } } if (errBreak) + { Environment.Exit(-2); + } // load all the contributions foreach (PluginDefinition p in plugins) @@ -332,9 +266,13 @@ errCount++; errBreak = errorHandler.OnPluginLoadError(p, e); if (!errorPlugins.ContainsKey(p)) + { errorPlugins.Add(p, e); + } if (errBreak) + { break; + } } } if (errBreak) @@ -342,8 +280,8 @@ // initialize contributions count = (int)c_max; - c_max += publicContributions.Length; - foreach (Contribution contrib in publicContributions) + c_max += PublicContributions.Length; + foreach (Contribution contrib in PublicContributions) { progressHandler("Initializing contributions...\n" + contrib.BaseUri, ++count / c_max); //! progressHandler("コントリビューションを初期化中\n"+contrib.baseUri,++count/c_max); @@ -357,19 +295,25 @@ errBreak = errorHandler.OnContributionInitError(contrib, e); PluginDefinition p = contrib.Parent; if (!errorPlugins.ContainsKey(p)) + { errorPlugins.Add(p, e); + } if (errBreak) + { break; + } } } if (errBreak) + { Environment.Exit(-4); + } {// make sure there's no duplicate id progressHandler("Checking for duplicate IDs...", 1.0f); //! progressHandler("重複IDのチェック中",1.0f); IDictionary dic = new Hashtable(); - foreach (Contribution contrib in publicContributions) + foreach (Contribution contrib in PublicContributions) { if (dic[contrib.Id] != null) { @@ -379,47 +323,62 @@ errBreak = errorHandler.OnContribIDDuplicated(dic[contrib.Id] as Contribution, contrib, e); PluginDefinition p = contrib.Parent; if (!errorPlugins.ContainsKey(p)) + { errorPlugins.Add(p, e); + } if (errBreak) + { break; + } } else + { dic[contrib.Id] = contrib; + } } } if (errBreak) + { Environment.Exit(-5); + } if (errCount > 0) { if (errorHandler.OnFinal(errorPlugins, errCount)) + { Environment.Exit(errCount); + } } } - /// <summary> /// Gets the default plug-in directory. /// </summary> /// <returns></returns> - public static string getDefaultPluginDirectory() + public static string GetDefaultPluginDirectory() { // try the IDE directory first //string pluginDir = Path.GetFullPath(Path.Combine(Core.installationDirectory, @"..\..\plugins" )); string pluginDir = Path.Combine(Application.StartupPath,"plugins"); if (Directory.Exists(pluginDir)) + { return pluginDir; + } pluginDir = Path.Combine(Application.StartupPath, Path.Combine(Path.Combine("..",".."),"plugins")); if (Directory.Exists(pluginDir)) + { return pluginDir; + } // if we can't find it, try the directory under the executable directory pluginDir = Path.GetFullPath(Path.Combine( Core.InstallationDirectory, @"plugins")); if (Directory.Exists(pluginDir)) + { return pluginDir; + } - throw new IOException("unable to find the plug-in directory: " + pluginDir); + throw new IOException("Unable to find the plug-in directory: " + pluginDir); } /// <summary> @@ -428,203 +387,239 @@ /// Normally, this method is called by <c>Plugin</c> but the caller /// can invoke this method before calling the init method. /// </summary> - public void addContributionFactory(string name, IContributionFactory factory) + public static void AddContributionFactory(string name, IContributionFactory factory) { if (contributionFactories.Contains(name)) + { throw new Exception(string.Format( "contribution type \"{0}\" is already registered.", name)); + } contributionFactories.Add(name, factory); } + /// <summary> /// /// </summary> /// <param name="name"></param> /// <returns></returns> - public IContributionFactory getContributionFactory(string name) + public static IContributionFactory GetContributionFactory(string name) { IContributionFactory factory = (IContributionFactory) contributionFactories[name]; if (factory == null) + { throw new Exception(name + " is an unknown contribution"); + } //! throw new Exception(name+"は未知のコントリビューションです"); else + { return factory; + } } - /// <summary> /// Enumerates all plug-in objects. /// </summary> - public IEnumerator GetEnumerator() + public static IEnumerator GetEnumerator() { return new ArrayEnumerator(plugins); } - - - - /// <summary> /// Gets all the station contributions. /// </summary> - public StationContribution[] stations + public static StationContribution[] Stations { get { - return (StationContribution[])listContributions(typeof(StationContribution)); + return (StationContribution[])ListContributions(typeof(StationContribution)); } } + /// <summary> /// /// </summary> - public readonly StructureGroupGroup stationGroup = new StructureGroupGroup(); + private static readonly StructureGroupGroup stationGroup = new StructureGroupGroup(); /// <summary> + /// + /// </summary> + public static StructureGroupGroup StationGroup + { + get { return stationGroup; } + } + + /// <summary> /// Gets all the special rail contributions. /// </summary> - public SpecialRailContribution[] specialRails + public static SpecialRailContribution[] SpecialRails { get { - return (SpecialRailContribution[])listContributions(typeof(SpecialRailContribution)); + return (SpecialRailContribution[])ListContributions(typeof(SpecialRailContribution)); } } /// <summary> /// Gets all the rail stationary contributions /// </summary> - public RailStationaryContribution[] railStationaryStructures + public static RailStationaryContribution[] RailStationaryStructures { get { - return (RailStationaryContribution[])listContributions(typeof(RailStationaryContribution)); + return (RailStationaryContribution[])ListContributions(typeof(RailStationaryContribution)); } } + /// <summary> /// /// </summary> - public readonly StructureGroupGroup railStationaryGroup = new StructureGroupGroup(); + private static readonly StructureGroupGroup railStationaryGroup = new StructureGroupGroup(); /// <summary> + /// + /// </summary> + public static StructureGroupGroup RailStationaryGroup + { + get { return railStationaryGroup; } + } + + /// <summary> /// Gets all the commercial structure contributions. /// </summary> - public CommercialStructureContribution[] commercialStructures + public static CommercialStructureContribution[] CommercialStructures { get { - return (CommercialStructureContribution[])listContributions(typeof(CommercialStructureContribution)); + return (CommercialStructureContribution[])ListContributions(typeof(CommercialStructureContribution)); } } + /// <summary> /// /// </summary> - public readonly StructureGroupGroup commercialStructureGroup = new StructureGroupGroup(); + private static readonly StructureGroupGroup commercialStructureGroup = new StructureGroupGroup(); /// <summary> + /// + /// </summary> + public static StructureGroupGroup CommercialStructureGroup + { + get { return commercialStructureGroup; } + } + + /// <summary> /// Gets all the special structure contributions. /// </summary> - public SpecialStructureContribution[] specialStructures + public static SpecialStructureContribution[] SpecialStructures { get { - return (SpecialStructureContribution[])listContributions(typeof(SpecialStructureContribution)); + return (SpecialStructureContribution[])ListContributions(typeof(SpecialStructureContribution)); } } /// <summary> /// Gets all the road contributions. /// </summary> - public RoadContribution[] roads + public static RoadContribution[] Roads { get { - return (RoadContribution[])listContributions(typeof(RoadContribution)); + return (RoadContribution[])ListContributions(typeof(RoadContribution)); } } - /// <summary> /// Gets all the BGM contributions. /// </summary> - public BGMContribution[] bgms + public static BGMContribution[] Bgms { get { - return (BGMContribution[])listContributions(typeof(BGMContribution)); + return (BGMContribution[])ListContributions(typeof(BGMContribution)); } } /// <summary> /// Gets all the menu item contributions. /// </summary> - public MenuContribution[] menus + public static MenuContribution[] Menus { get { - return (MenuContribution[])listContributions(typeof(MenuContribution)); + return (MenuContribution[])ListContributions(typeof(MenuContribution)); } } /// <summary> /// Gets all the train contributions. /// </summary> - public TrainContribution[] trains + public static TrainContribution[] Trains { get { - return (TrainContribution[])listContributions(typeof(TrainContribution)); + return (TrainContribution[])ListContributions(typeof(TrainContribution)); } } /// <summary> /// Gets all the train controller contributions. /// </summary> - public TrainControllerContribution[] trainControllers + public static TrainControllerContribution[] TrainControllers { get { - return (TrainControllerContribution[])listContributions(typeof(TrainControllerContribution)); + return (TrainControllerContribution[])ListContributions(typeof(TrainControllerContribution)); } } + /// <summary> /// /// </summary> - public VarHeightBuildingContribution[] varHeightBuildings + public static VarHeightBuildingContribution[] VarHeightBuildings { get { - return (VarHeightBuildingContribution[])listContributions(typeof(VarHeightBuildingContribution)); + return (VarHeightBuildingContribution[])ListContributions(typeof(VarHeightBuildingContribution)); } } + /// <summary> /// /// </summary> - public readonly StructureGroupGroup varHeightBuildingsGroup = new StructureGroupGroup(); + public static readonly StructureGroupGroup varHeightBuildingsGroup = new StructureGroupGroup(); - /// <summary> /// /// </summary> - public LandBuilderContribution[] landBuilders + public static LandBuilderContribution[] LandBuilders { get { - return (LandBuilderContribution[])listContributions(typeof(LandBuilderContribution)); + return (LandBuilderContribution[])ListContributions(typeof(LandBuilderContribution)); } } + /// <summary> /// /// </summary> - public readonly LandBuilderGroupGroup landBuilderGroup = new LandBuilderGroupGroup(); + private static readonly LandBuilderGroupGroup landBuilderGroup = new LandBuilderGroupGroup(); + /// <summary> + /// + /// </summary> + public static LandBuilderGroupGroup LandBuilderGroup + { + get { return landBuilderGroup; } + } - /// <summary> /// Lists up contributions of the given type. /// </summary> - public Array listContributions(Type contributionType) + public static Array ListContributions(Type contributionType) { ArrayList list = new ArrayList(); foreach (PluginDefinition p in plugins) @@ -632,25 +627,30 @@ foreach (Contribution contrib in p.contributions) { if (contributionType.IsInstanceOfType(contrib)) + { list.Add(contrib); + } } } return list.ToArray(contributionType); } - /// <summary> /// Gets all contributions. except for runtime generated ones. /// </summary> - public Contribution[] publicContributio... [truncated message content] |
From: <je...@us...> - 2008-04-09 20:31:04
|
Revision: 359 http://freetrain.svn.sourceforge.net/freetrain/?rev=359&view=rev Author: jendave Date: 2008-04-09 13:31:01 -0700 (Wed, 09 Apr 2008) Log Message: ----------- got rid of all CLSCompliant attributes(except for jagged arrays) Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Others/MenuContribution.cs branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs branches/FreeTrainSDL/core/Contributions/Train/TrainContribution.cs branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/Land/LandController.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/PointSelectorController.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs branches/FreeTrainSDL/core/World/Cube.cs branches/FreeTrainSDL/core/World/Development/DevelopConfigurePlugin.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/LandValue.cs branches/FreeTrainSDL/core/World/Development/LandValueInspectorPlugin.cs branches/FreeTrainSDL/core/World/Development/ULV.cs branches/FreeTrainSDL/core/World/EmptyVoxel.cs branches/FreeTrainSDL/core/World/Entity.cs branches/FreeTrainSDL/core/World/Land/LandPropertyVoxel.cs branches/FreeTrainSDL/core/World/Land/LandVoxel.cs branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs branches/FreeTrainSDL/core/World/RRCrossing.cs branches/FreeTrainSDL/core/World/Rail/BridgePierVoxel.cs branches/FreeTrainSDL/core/World/Rail/FatPlatform.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/RailRoad.cs branches/FreeTrainSDL/core/World/Rail/RailStationaryStructure.cs branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/Station.cs branches/FreeTrainSDL/core/World/Rail/StationListener.cs branches/FreeTrainSDL/core/World/Rail/StealSupportedRailContributionImpl.cs branches/FreeTrainSDL/core/World/Rail/TunnelRail.cs branches/FreeTrainSDL/core/World/Road/Road.cs branches/FreeTrainSDL/core/World/SparseVoxelArray.cs branches/FreeTrainSDL/core/World/Structs/Commercial.cs branches/FreeTrainSDL/core/World/Structs/ConstructionSite.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/PopulatedStructure.cs branches/FreeTrainSDL/core/World/Structs/StationListenerImpl.cs branches/FreeTrainSDL/core/World/Structs/Structure.cs branches/FreeTrainSDL/core/World/Structs/VarHeightBuilding.cs branches/FreeTrainSDL/core/World/Terrain/MountainVoxel.cs branches/FreeTrainSDL/core/World/Traffic.cs branches/FreeTrainSDL/core/World/Voxel.cs branches/FreeTrainSDL/core/World/WorldDefinition.cs branches/FreeTrainSDL/lib/Controls/ColorPicker.cs branches/FreeTrainSDL/lib/Controls/MruMenu.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCar.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericLandContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/GenericStructureContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSprite.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigCommand.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorConfigDialog.cs branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/ColorTestTrainCar.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureContribution.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -156,7 +156,7 @@ public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, size); - drawer.drawCenter(sprites); + drawer.DrawCenter(sprites); return drawer; } Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -91,7 +91,7 @@ /// <summary> /// /// </summary> - public StructureGroup Group + public virtual StructureGroup Group { get { return group; } } Modified: branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Land/Bulldozer.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -81,9 +81,9 @@ else mv.removeTrees(); } - else if (v.entity != null) + else if (v.Entity != null) { - v.entity.remove(); + v.Entity.remove(); } else { Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -38,18 +38,18 @@ : base(name) { } + ///// <summary> + ///// + ///// </summary> + ///// <param name="idx"></param> + ///// <returns></returns> + //public LandBuilderContribution Get(int idx) + //{ + // return (LandBuilderContribution)base.List[idx]; + //} /// <summary> /// /// </summary> - /// <param name="idx"></param> - /// <returns></returns> - public LandBuilderContribution Get(int idx) - { - return (LandBuilderContribution)base.List[idx]; - } - /// <summary> - /// - /// </summary> /// <param name="sc"></param> public void Remove(LandBuilderContribution sc) { Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -98,7 +98,7 @@ for (int y = 0; y < 10; y++) for (int x = 0; x < 10; x++) - drawer.draw(getLand().sprite, x, y); + drawer.Draw(getLand().sprite, x, y); return drawer; } Modified: branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -81,7 +81,7 @@ for (int y = 0; y < 10; y++) for (int x = 0; x < 10; x++) - drawer.draw(sprite, x, y); + drawer.Draw(sprite, x, y); return drawer; } Modified: branches/FreeTrainSDL/core/Contributions/Others/MenuContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Others/MenuContribution.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Others/MenuContribution.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -41,6 +41,6 @@ /// <summary> /// The callee can merge menu items into container at this timing. /// </summary> - public abstract void mergeMenu(MainMenu containerMenu); + public abstract void MergeMenu(MainMenu containerMenu); } } Modified: branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -198,12 +198,12 @@ while (y >= 0 && x < 10) { if (previewPattern[PreviewPatternIdx, x, y] > 0) - drawer.draw(getSprite(previewPattern[PreviewPatternIdx, x, y]), 9 - x, y - 5); + drawer.Draw(getSprite(previewPattern[PreviewPatternIdx, x, y]), 9 - x, y - 5); x++; y--; } } - return drawer.createBitmap(); + return drawer.CreateBitmap(); } } } @@ -247,7 +247,7 @@ { byte dirs = pattern.dirs; dirs |= (byte)(1 << (d.index / 2)); - voxel.road = new RoadImpl(contribution, voxel, RoadPattern.get(dirs)); + Voxel.road = new RoadImpl(contribution, Voxel, RoadPattern.get(dirs)); return true; } /// <summary> @@ -263,13 +263,13 @@ if (dirs == 0) // destroy this road - voxel.road = null; + Voxel.road = null; else { - voxel.road = new RoadImpl(contribution, voxel, RoadPattern.get(dirs)); + Voxel.road = new RoadImpl(contribution, Voxel, RoadPattern.get(dirs)); } - WorldDefinition.World.OnVoxelUpdated(location); + WorldDefinition.World.OnVoxelUpdated(Location); } /// <summary> /// Modified: branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Structs/VarHeightBuildingContribution.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -217,12 +217,12 @@ int z = 0; for (int i = bottoms.Length - 1; i >= 0; i--) - drawer.draw(bottoms[i], 0, 0, z++); + drawer.Draw(bottoms[i], 0, 0, z++); if (overlay) - drawer.draw(middle, 0, 0, z - 1); - drawer.draw(middle, 0, 0, z++); + drawer.Draw(middle, 0, 0, z - 1); + drawer.Draw(middle, 0, 0, z++); for (int i = tops.Length - 1; i >= 0; i--) - drawer.draw(tops[i], 0, 0, z++); + drawer.Draw(tops[i], 0, 0, z++); return drawer; } @@ -239,16 +239,16 @@ int mh = height - 2; int z = 0; for (int i = bottoms.Length - 1; i >= 0; i--) - drawer.draw(bottoms[i], 0, 0, z++); + drawer.Draw(bottoms[i], 0, 0, z++); if (overlay) { z--; mh++; } for (int i = 0; i < mh; i++) - drawer.draw(middle, 0, 0, z++); + drawer.Draw(middle, 0, 0, z++); for (int i = tops.Length - 1; i >= 0; i--) - drawer.draw(tops[i], 0, 0, z++); + drawer.Draw(tops[i], 0, 0, z++); return drawer; } Modified: branches/FreeTrainSDL/core/Contributions/Train/TrainContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Train/TrainContribution.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Contributions/Train/TrainContribution.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -127,12 +127,12 @@ // / for (int x = -10; x < 0; x++) { - pd.draw(RailPattern.get(Direction.WEST, Direction.EAST), x, 0); + pd.Draw(RailPattern.get(Direction.WEST, Direction.EAST), x, 0); } - pd.draw(RailPattern.get(Direction.WEST, Direction.SOUTHEAST), 0, 0); + pd.Draw(RailPattern.get(Direction.WEST, Direction.SOUTHEAST), 0, 0); for (int x = 1; x <= 10; x++) { - pd.draw(RailPattern.get(Direction.NORTHWEST, Direction.SOUTHEAST), x, x); + pd.Draw(RailPattern.get(Direction.NORTHWEST, Direction.SOUTHEAST), x, x); } TrainCarContribution[] cars = Create(trainlength); @@ -151,7 +151,7 @@ int[] angle = new int[] { 12, 12, 13, 14, 14, 14, 14, 14 }; int[] offset = new int[] { 0, 0, 0, 0, 4, +2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - using (DrawContext dc = new DrawContext(pd.surface)) + using (DrawContext dc = new DrawContext(pd.Surface)) { for (int i = 7; i >= 0; i--) { @@ -160,8 +160,8 @@ continue; // no car } - Point pt = pd.getPoint(pos[i * 2], pos[i * 2 + 1]); - cars[i].Draw(pd.surface, + Point pt = pd.GetPoint(pos[i * 2], pos[i * 2 + 1]); + cars[i].Draw(pd.Surface, new Point(pt.X + offset[i * 2], pt.Y + offset[i * 2 + 1] - 9), angle[i]); } } Modified: branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -112,7 +112,7 @@ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を /// コード エディタで変更しないでください。 /// </summary> - protected virtual void InitializeComponent() + private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.buttonRemove = new System.Windows.Forms.RadioButton(); Modified: branches/FreeTrainSDL/core/Controllers/Land/LandController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Land/LandController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -168,7 +168,7 @@ using (PreviewDrawer drawer = builder.CreatePreview(preview.Size)) { if (previewBitmap != null) previewBitmap.Dispose(); - preview.Image = previewBitmap = drawer.createBitmap(); + preview.Image = previewBitmap = drawer.CreateBitmap(); } //currentController = builder.createBuilder(new ControllerSiteImpl(this)); Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -64,9 +64,9 @@ { for (int x = 0; x < 3; x++) for (int y = 0; y < 3; y++) - drawer.draw(LandPropertyVoxel.sprite, x, y); + drawer.Draw(LandPropertyVoxel.sprite, x, y); if (preview.Image != null) preview.Image.Dispose(); - preview.Image = drawer.createBitmap(); + preview.Image = drawer.CreateBitmap(); } } /// <summary> @@ -233,11 +233,11 @@ for (int y = loc1.y; y <= loc2.y; y++) { Voxel v = WorldDefinition.World[x, y, z]; - if (v != null && !v.entity.isOwned && v.entity.isSilentlyReclaimable) + if (v != null && !v.Entity.isOwned && v.Entity.isSilentlyReclaimable) { // remove the old structure if possible - AccountGenre.Subsidiaries.Spend(v.entity.entityValue); - v.entity.remove(); + AccountGenre.Subsidiaries.Spend(v.Entity.EntityValue); + v.Entity.remove(); } v = WorldDefinition.World[x, y, z]; @@ -267,11 +267,11 @@ for (int y = loc1.y; y <= loc2.y; y++) { Voxel v = WorldDefinition.World[x, y, z]; - if (v != null && !v.entity.isOwned && v.entity.isSilentlyReclaimable) + if (v != null && !v.Entity.isOwned && v.Entity.isSilentlyReclaimable) { // cost for removing this structure - if (s.add(v.entity)) - r += v.entity.entityValue; + if (s.add(v.Entity)) + r += v.Entity.EntityValue; } v = WorldDefinition.World[x, y, z]; @@ -298,7 +298,7 @@ LandPropertyVoxel v = WorldDefinition.World[x, y, z] as LandPropertyVoxel; if (v != null) { - AccountGenre.Subsidiaries.Earn(v.landPrice); + AccountGenre.Subsidiaries.Earn(v.LandPrice); v.remove(); } } @@ -321,7 +321,7 @@ { LandPropertyVoxel v = WorldDefinition.World[x, y, z] as LandPropertyVoxel; if (v != null) - r += v.landPrice; + r += v.LandPrice; } } return r; Modified: branches/FreeTrainSDL/core/Controllers/PointSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/PointSelectorController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/PointSelectorController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -62,7 +62,7 @@ /// <summary> /// Called when the player selects a location. /// </summary> - protected abstract void onLocationSelected(Location loc); + protected abstract void OnLocationSelected(Location loc); @@ -141,7 +141,7 @@ /// <param name="ab"></param> public void OnClick(MapViewWindow source, Location loc, Point ab) { - onLocationSelected(loc); + OnLocationSelected(loc); } /// <summary> Modified: branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -490,11 +490,11 @@ else { drawer = new PreviewDrawer(stationPicture.ClientSize, selectedStation.Size); - drawer.drawCenter(selectedStation.Sprites); + drawer.DrawCenter(selectedStation.Sprites); } if (stationPreviewBitmap != null) stationPreviewBitmap.Dispose(); - stationPicture.Image = stationPreviewBitmap = drawer.createBitmap(); + stationPicture.Image = stationPreviewBitmap = drawer.CreateBitmap(); drawer.Dispose(); Modified: branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -69,45 +69,45 @@ // direction N using (drawer = new PreviewDrawer(pictureN.ClientSize, new Size(2, 4), 0)) { - drawer.draw(RailPattern.getSlope(Direction.NORTH, 3), 1, -1); - drawer.draw(RailPattern.getSlope(Direction.NORTH, 2), 1, 0); - drawer.draw(RailPattern.getSlope(Direction.NORTH, 1), 0, 2); - drawer.draw(RailPattern.getSlope(Direction.NORTH, 0), 0, 3); + drawer.Draw(RailPattern.getSlope(Direction.NORTH, 3), 1, -1); + drawer.Draw(RailPattern.getSlope(Direction.NORTH, 2), 1, 0); + drawer.Draw(RailPattern.getSlope(Direction.NORTH, 1), 0, 2); + drawer.Draw(RailPattern.getSlope(Direction.NORTH, 0), 0, 3); if (pictureN.Image != null) pictureN.Image.Dispose(); - pictureN.Image = drawer.createBitmap(); + pictureN.Image = drawer.CreateBitmap(); } // direction S using (drawer = new PreviewDrawer(pictureS.ClientSize, new Size(2, 4), 0)) { - drawer.draw(RailPattern.getSlope(Direction.SOUTH, 0), 0, 0); - drawer.draw(RailPattern.getSlope(Direction.SOUTH, 1), 0, 1); - drawer.draw(RailPattern.getSlope(Direction.SOUTH, 2), 1, 1); - drawer.draw(RailPattern.getSlope(Direction.SOUTH, 3), 1, 2); + drawer.Draw(RailPattern.getSlope(Direction.SOUTH, 0), 0, 0); + drawer.Draw(RailPattern.getSlope(Direction.SOUTH, 1), 0, 1); + drawer.Draw(RailPattern.getSlope(Direction.SOUTH, 2), 1, 1); + drawer.Draw(RailPattern.getSlope(Direction.SOUTH, 3), 1, 2); if (pictureS.Image != null) pictureS.Image.Dispose(); - pictureS.Image = drawer.createBitmap(); + pictureS.Image = drawer.CreateBitmap(); } // direction E using (drawer = new PreviewDrawer(pictureE.ClientSize, new Size(4, 2), 0)) { - drawer.draw(RailPattern.getSlope(Direction.EAST, 3), 3, 0); - drawer.draw(RailPattern.getSlope(Direction.EAST, 2), 2, 0); - drawer.draw(RailPattern.getSlope(Direction.EAST, 1), 0, 1); - drawer.draw(RailPattern.getSlope(Direction.EAST, 0), -1, 1); + drawer.Draw(RailPattern.getSlope(Direction.EAST, 3), 3, 0); + drawer.Draw(RailPattern.getSlope(Direction.EAST, 2), 2, 0); + drawer.Draw(RailPattern.getSlope(Direction.EAST, 1), 0, 1); + drawer.Draw(RailPattern.getSlope(Direction.EAST, 0), -1, 1); if (pictureE.Image != null) pictureE.Image.Dispose(); - pictureE.Image = drawer.createBitmap(); + pictureE.Image = drawer.CreateBitmap(); } // direction W using (drawer = new PreviewDrawer(pictureW.ClientSize, new Size(4, 2), 0)) { - drawer.draw(RailPattern.getSlope(Direction.WEST, 3), 1, 0); - drawer.draw(RailPattern.getSlope(Direction.WEST, 2), 2, 0); - drawer.draw(RailPattern.getSlope(Direction.WEST, 1), 2, 1); - drawer.draw(RailPattern.getSlope(Direction.WEST, 0), 3, 1); + drawer.Draw(RailPattern.getSlope(Direction.WEST, 3), 1, 0); + drawer.Draw(RailPattern.getSlope(Direction.WEST, 2), 2, 0); + drawer.Draw(RailPattern.getSlope(Direction.WEST, 1), 2, 1); + drawer.Draw(RailPattern.getSlope(Direction.WEST, 0), 3, 1); if (pictureW.Image != null) pictureW.Image.Dispose(); - pictureW.Image = drawer.createBitmap(); + pictureW.Image = drawer.CreateBitmap(); } } /// <summary> Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainTradingDialog.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -49,8 +49,8 @@ buttonImages.TransparentColor = bmp.GetPixel(0, 0); buttonImages.Images.AddStrip(bmp); - tbDay.Pushed = (WorldDefinition.World.ViewOptions.nightSpriteMode == NightSpriteMode.AlwaysDay); - tbNight.Pushed = (WorldDefinition.World.ViewOptions.nightSpriteMode == NightSpriteMode.AlwaysNight); + tbDay.Pushed = (WorldDefinition.World.ViewOptions.NightSpriteMode == NightSpriteMode.AlwaysDay); + tbNight.Pushed = (WorldDefinition.World.ViewOptions.NightSpriteMode == NightSpriteMode.AlwaysNight); // organize trains into a tree IDictionary types = new SortedList(); @@ -160,7 +160,7 @@ //if (length.Value > selectedTrain.maxLength) length.Value = selectedTrain.maxLength; using (PreviewDrawer pd = selectedTrain.CreatePreview(preview.ClientSize, (int)length.Value)) { - preview.Image = pd.createBitmap(); + preview.Image = pd.CreateBitmap(); } if (count.Value == 0) @@ -197,7 +197,7 @@ using (PreviewDrawer pd = selectedTrain.CreatePreview(preview.ClientSize, (int)length.Value)) { - preview.Image = pd.createBitmap(); + preview.Image = pd.CreateBitmap(); } return; @@ -234,9 +234,9 @@ if (e.Button == tb) { if (tb.Pushed) - WorldDefinition.World.ViewOptions.nightSpriteMode = (NightSpriteMode)tb.Tag; + WorldDefinition.World.ViewOptions.NightSpriteMode = (NightSpriteMode)tb.Tag; else - WorldDefinition.World.ViewOptions.nightSpriteMode = NightSpriteMode.AlignClock; + WorldDefinition.World.ViewOptions.NightSpriteMode = NightSpriteMode.AlignClock; } else { Modified: branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -81,7 +81,7 @@ /// </summary> protected void InitializeComponent() { - base.InitializeComponent(); + //base.InitializeComponent(); this.SuspendLayout(); this.buttonRemove.Location = new System.Drawing.Point(194, 132); this.buttonPlace.Location = new System.Drawing.Point(136, 132); Modified: branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Graphics/ColorMappedSprite.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -91,7 +91,7 @@ { pt.X -= Offset.X; pt.Y -= Offset.Y; - int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; + int idx = (WorldDefinition.World.ViewOptions.UseNightView) ? 1 : 0; surface.BlitColorTransform(pt, Picture.surface, Origin, Size, srcColors[idx], dstColors[idx], false); } Modified: branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Graphics/HueTransformSprite.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -67,7 +67,7 @@ pt.X -= Offset.X; pt.Y -= Offset.Y; - int idx = (WorldDefinition.World.ViewOptions.useNightView) ? 1 : 0; + int idx = (WorldDefinition.World.ViewOptions.UseNightView) ? 1 : 0; surface.BlitHueTransform(pt, Picture.surface, Origin, Size, RedTarget, GreenTarget, BlueTarget); Modified: branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Graphics/Picture.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -229,7 +229,7 @@ WorldDefinition world = WorldDefinition.World; // reload the surface Clock c = world.Clock; - loaders[(int)c.season, (world.ViewOptions.useNightView) ? 1 : 0].Load(ref _surface); + loaders[(int)c.season, (world.ViewOptions.UseNightView) ? 1 : 0].Load(ref _surface); //_surface.sourceColorKey = key; dirty = false; } Modified: branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Graphics/PreviewDrawer.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -37,9 +37,17 @@ /// <summary> /// /// </summary> - public readonly Surface surface; + private readonly Surface surface; /// <summary> + /// + /// </summary> + public Surface Surface + { + get { return surface; } + } + + /// <summary> /// pixelSize of the canvas. /// </summary> private readonly Size pixelSize; @@ -48,6 +56,7 @@ /// The point in the surface of (X,Y)=(0,0). /// </summary> private readonly Point ptOrigin = new Point(); + /// <summary> /// /// </summary> @@ -77,6 +86,7 @@ Clear(); } + /// <summary> /// /// </summary> @@ -98,16 +108,18 @@ empty.Draw(surface, new Point(x, y)); } } + /// <summary> /// /// </summary> /// <param name="offsetX"></param> /// <param name="offsetY"></param> /// <returns></returns> - public Point getPoint(int offsetX, int offsetY) + public Point GetPoint(int offsetX, int offsetY) { - return getPoint(offsetX, offsetY, 0); + return GetPoint(offsetX, offsetY, 0); } + /// <summary> /// /// </summary> @@ -115,7 +127,7 @@ /// <param name="offsetY"></param> /// <param name="offsetZ"></param> /// <returns></returns> - public Point getPoint(int offsetX, int offsetY, int offsetZ) + public Point GetPoint(int offsetX, int offsetY, int offsetZ) { Point o = ptOrigin; o.X += (offsetX + offsetY) * 16; @@ -123,35 +135,38 @@ o.Y -= offsetZ * 16; return o; } + /// <summary> /// /// </summary> /// <param name="sprite"></param> /// <param name="offsetX"></param> /// <param name="offsetY"></param> - public void draw(ISprite sprite, int offsetX, int offsetY) + public void Draw(ISprite sprite, int offsetX, int offsetY) { - sprite.Draw(surface, getPoint(offsetX, offsetY)); + sprite.Draw(surface, GetPoint(offsetX, offsetY)); } /// <summary> /// /// </summary> /// <param name="sprites"></param> - public void drawCenter(ISprite[,] sprites) + public void DrawCenter(ISprite[,] sprites) { - draw(sprites, 0, 0); + Draw(sprites, 0, 0); } + /// <summary> /// /// </summary> /// <param name="sprites"></param> /// <param name="offsetX"></param> /// <param name="offsetY"></param> - public void draw(ISprite[,] sprites, int offsetX, int offsetY) + public void Draw(ISprite[,] sprites, int offsetX, int offsetY) { - draw(sprites, offsetX, offsetY, 0); + Draw(sprites, offsetX, offsetY, 0); } + /// <summary> /// /// </summary> @@ -159,12 +174,12 @@ /// <param name="offsetX"></param> /// <param name="offsetY"></param> /// <param name="offsetZ"></param> - public void draw(ISprite[,] sprites, int offsetX, int offsetY, int offsetZ) + public void Draw(ISprite[,] sprites, int offsetX, int offsetY, int offsetZ) { int X = sprites.GetLength(0); int Y = sprites.GetLength(1); - Point o = getPoint(offsetX, offsetY, offsetZ); + Point o = GetPoint(offsetX, offsetY, offsetZ); for (int y = 0; y < Y; y++) { @@ -184,10 +199,11 @@ /// </summary> /// <param name="sprites"></param> [CLSCompliant(false)] - public void drawCenter(ISprite[, ,] sprites) + public void DrawCenter(ISprite[, ,] sprites) { - draw(sprites, 0, 0); + Draw(sprites, 0, 0); } + /// <summary> /// /// </summary> @@ -195,10 +211,11 @@ /// <param name="offsetX"></param> /// <param name="offsetY"></param> [CLSCompliant(false)] - public void draw(ISprite[, ,] sprites, int offsetX, int offsetY) + public void Draw(ISprite[, ,] sprites, int offsetX, int offsetY) { - draw(sprites, offsetX, offsetY, 0); + Draw(sprites, offsetX, offsetY, 0); } + /// <summary> /// /// </summary> @@ -207,13 +224,13 @@ /// <param name="offsetY"></param> /// <param name="offsetZ"></param> [CLSCompliant(false)] - public void draw(ISprite[, ,] sprites, int offsetX, int offsetY, int offsetZ) + public void Draw(ISprite[, ,] sprites, int offsetX, int offsetY, int offsetZ) { int X = sprites.GetLength(0); int Y = sprites.GetLength(1); int Z = sprites.GetLength(2); - Point o = getPoint(offsetX, offsetY, offsetZ); + Point o = GetPoint(offsetX, offsetY, offsetZ); for (int z = 0; z < Z; z++) { @@ -254,7 +271,7 @@ /// /// The caller needs to dispose the bitmap. /// </summary> - public Bitmap createBitmap() + public Bitmap CreateBitmap() { return surface.Bitmap; } Modified: branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Graphics/Surface.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -1010,7 +1010,6 @@ ///// </summary> ///// <param name="colorValue"></param> ///// <returns></returns> - //[CLSCompliant(false)] //public System.Drawing.Color GetColor(int colorValue) //{ // byte r, g, b, a; Modified: branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Plugin/DynamicContributionFactory.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -38,6 +38,7 @@ { this.baseType = baseType; } + /// <summary> /// /// </summary> @@ -49,6 +50,7 @@ private readonly Type baseType; + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Plugin/FixedClassContributionFactory.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -36,6 +36,7 @@ { this.concreteType = concreteType; } + /// <summary> /// Constructor for the use in plugin.xml /// </summary> @@ -45,6 +46,7 @@ (XmlElement)XmlUtil.SelectSingleNode(e, "implementation"))) { } private readonly Type concreteType; + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginUtil.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -95,6 +95,7 @@ return a.GetType(typeName, true); } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Framework/Plugin/XmlUtil.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -36,12 +36,12 @@ /// Performs a node selection and throws an exception if it's not found. /// </summary> /// <exception cref="XmlException"></exception> - public static XmlNode SelectSingleNode(XmlNode node, string xpath) + public static XmlNode SelectSingleNode(XmlNode node, string xPath) { - XmlNode n = node.SelectSingleNode(xpath); + XmlNode n = node.SelectSingleNode(xPath); if (n == null) { - throw new XmlException("unable to find " + xpath, null); + throw new XmlException("unable to find " + xPath, null); } return n; } @@ -53,6 +53,7 @@ { return new Uri(new Uri(context.BaseURI), relative); } + /// <summary> /// /// </summary> @@ -70,6 +71,7 @@ throw new FormatException("Unable to parse " + text + " as point", e); } } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs =================================================================== --- branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Views/GlobalViewOptions.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -65,16 +65,13 @@ /// </summary> [NonSerialized] public OptionChangedHandler OnViewOptionChanged; + + NightSpriteMode _nightSpriteMode = NightSpriteMode.AlignClock; + /// <summary> /// - /// /// </summary> - [CLSCompliant(false)] - protected NightSpriteMode _nightSpriteMode = NightSpriteMode.AlignClock; - /// <summary> - /// - /// </summary> - public NightSpriteMode nightSpriteMode + public NightSpriteMode NightSpriteMode { get { return _nightSpriteMode; } set @@ -93,14 +90,14 @@ /// <summary> /// /// </summary> - public bool useNightView + public bool UseNightView { get { - if (nightSpriteMode == NightSpriteMode.AlignClock) + if (NightSpriteMode == NightSpriteMode.AlignClock) return WorldDefinition.World.Clock.dayOrNight == DayNight.Night; else - return nightSpriteMode == NightSpriteMode.AlwaysNight; + return NightSpriteMode == NightSpriteMode.AlwaysNight; } } } Modified: branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs =================================================================== --- branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -365,9 +365,9 @@ if (z == 0) hvb = null; else hvb = world.voxelHVD(h, v, z - 1) as IHoleVoxel; - if (hva != null && !hva.drawGround(false)) + if (hva != null && !hva.DrawGround(false)) return false; - if (hvb != null && !hvb.drawGround(true)) + if (hvb != null && !hvb.DrawGround(true)) return false; return true; @@ -388,7 +388,7 @@ bool noHeightCut = (HeightCutHeight == world.Size.z - 1); Color waterSurfaceColor = waterSurfaceDayColor; - if (world.ViewOptions.useNightView) + if (world.ViewOptions.UseNightView) waterSurfaceColor = ColorMap.getNightColor(waterSurfaceColor); rectAB.Inflate(20, 20); @@ -435,7 +435,7 @@ Point pt = fromHVZToClient(h, v, z); // draw the surface anyway. - if (voxel == null || voxel.transparent) + if (voxel == null || voxel.Transparent) { if (z == groundLevel) { @@ -488,7 +488,7 @@ if (voxel != null) { //DateTime start = DateTime.Now; - voxel.drawVoxel(drawContext, pt, noHeightCut ? -1 : (Z - z + 1)); + voxel.DrawVoxel(drawContext, pt, noHeightCut ? -1 : (Z - z + 1)); //Debug.WriteLine("voxel took: " + (DateTime.Now - start).TotalMilliseconds + "ms"); } if (overlay != null) Modified: branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Accounting/AccountSummaryWindow.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -503,9 +503,18 @@ /// List of displayed genre ids. /// Public only for XmlSerializer. /// </summary> + /// + string[] genre; + + /// <summary> + /// + /// </summary> [XmlElement("genre")] - [CLSCompliant(false)] - public string[] _genre; + public string[] Genre + { + get { return genre; } + set { genre = value; } + } /// <summary> /// /// </summary> @@ -516,9 +525,9 @@ { try { - AccountGenre[] r = new AccountGenre[_genre.Length]; + AccountGenre[] r = new AccountGenre[genre.Length]; for (int i = 0; i < r.Length; i++) - r[i] = (AccountGenre)PluginManager.GetContribution(_genre[i]); + r[i] = (AccountGenre)PluginManager.GetContribution(genre[i]); return r; } catch (Exception e) @@ -534,9 +543,9 @@ } set { - _genre = new string[value.Length]; + genre = new string[value.Length]; for (int i = 0; i < value.Length; i++) - _genre[i] = value[i].Id; + genre[i] = value[i].Id; save(); } } Modified: branches/FreeTrainSDL/core/World/Cube.cs =================================================================== --- branches/FreeTrainSDL/core/World/Cube.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Cube.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -242,7 +242,7 @@ for (int z = corner.z; z < mz; z++) { Voxel v = WorldDefinition.World[x, y, z]; - if (v != null) r.add(v.entity); + if (v != null) r.add(v.Entity); } } } Modified: branches/FreeTrainSDL/core/World/Development/DevelopConfigurePlugin.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/DevelopConfigurePlugin.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Development/DevelopConfigurePlugin.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -41,7 +41,7 @@ /// /// </summary> /// <param name="containerMenu"></param> - public override void mergeMenu(MainMenu containerMenu) + public override void MergeMenu(MainMenu containerMenu) { MenuItem item = new MenuItem(); item.Text = "Adjust Growth Parameters"; Modified: branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -391,7 +391,7 @@ Cube tmp = new Cube(scaning, vhbc.Size, h); int cost = 0; foreach (IEntity e in tmp.getEntities()) - cost += e.entityValue; + cost += e.EntityValue; while (price < cost && h < h2) { if (price < cost) @@ -414,7 +414,7 @@ { Location loc = target.baseLocation; WorldDefinition w = WorldDefinition.World; - int amp = F_PopAmpBase + (int)(Math.Pow(w[loc].landPrice, F_PopAmpPower) * F_PopAmpScale); + int amp = F_PopAmpBase + (int)(Math.Pow(w[loc].LandPrice, F_PopAmpPower) * F_PopAmpScale); // then randomly pick nearby voxel loc.x = Rand(loc.x, amp); loc.y = Rand(loc.y, amp); @@ -425,7 +425,7 @@ Voxel v = w[loc]; if (v != null) { - if (!IsReplaceable(v.entity, v.landPrice)) + if (!IsReplaceable(v.Entity, v.LandPrice)) continue; } return loc; @@ -451,8 +451,8 @@ } else if (e is LandVoxel) { - Debug.WriteLine("LandPrice:" + e.entityValue + " (>" + comPrice); - if (e.entityValue > comPrice) + Debug.WriteLine("LandPrice:" + e.EntityValue + " (>" + comPrice); + if (e.EntityValue > comPrice) return false; } return true; Modified: branches/FreeTrainSDL/core/World/Development/LandValue.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/LandValue.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Development/LandValue.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -214,8 +214,8 @@ if (roadFound != null) { - if (roadFound.style.Type >= MajorRoadType.street) - if (roadFound.style.Sidewalk == SidewalkType.pavement) + if (roadFound.Style.Type >= MajorRoadType.street) + if (roadFound.Style.Sidewalk == SidewalkType.pavement) rho[h, v] = RHO_ROAD; else rho[h, v] = (RHO_ROAD + RHO_BARE_LAND) / 2; Modified: branches/FreeTrainSDL/core/World/Development/LandValueInspectorPlugin.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/LandValueInspectorPlugin.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Development/LandValueInspectorPlugin.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -40,7 +40,7 @@ /// /// </summary> /// <param name="containerMenu"></param> - public override void mergeMenu(MainMenu containerMenu) + public override void MergeMenu(MainMenu containerMenu) { MenuItem item = new MenuItem(); item.Text = "Inspect Land Value"; Modified: branches/FreeTrainSDL/core/World/Development/ULV.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -90,14 +90,14 @@ Voxel v = world[x, y, z]; if (v != null) { - IEntity e = v.entity; + IEntity e = v.Entity; if (e.isOwned) // cannot reclaim this voxel. return null; if (!s.contains(e)) { // new entity s.add(e); - entityValue += e.entityValue; + entityValue += e.EntityValue; } } Modified: branches/FreeTrainSDL/core/World/EmptyVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/EmptyVoxel.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/EmptyVoxel.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -35,7 +35,7 @@ /// <summary> /// /// </summary> - public override bool transparent { get { return true; } } + public override bool Transparent { get { return true; } } /// <summary> /// /// </summary> @@ -60,13 +60,13 @@ /// <param name="surface"></param> /// <param name="pt"></param> /// <param name="heightCutDiff"></param> - public override void draw(DrawContext surface, Point pt, int heightCutDiff) + public override void Draw(DrawContext surface, Point pt, int heightCutDiff) { // draw nothing } /// <summary> /// /// </summary> - public override IEntity entity { get { return _entity; } } + public override IEntity Entity { get { return _entity; } } } } Modified: branches/FreeTrainSDL/core/World/Entity.cs =================================================================== --- branches/FreeTrainSDL/core/World/Entity.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Entity.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -47,7 +47,7 @@ /// <summary> /// The monetary value of the entity. /// </summary> - int entityValue { get; } + int EntityValue { get; } // TODO: not sure what this means. // this is certainly not a cash value when you buy/sell the property @@ -104,6 +104,6 @@ /// /// <returns>null if the given aspect is not supported.</returns> /// </summary> - object queryInterface( Type aspect ); + object QueryInterface( Type aspect ); } } Modified: branches/FreeTrainSDL/core/World/Land/LandPropertyVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Land/LandPropertyVoxel.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Land/LandPropertyVoxel.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -42,14 +42,14 @@ /// <summary> /// /// </summary> - public override IEntity entity { get { return this; } } + public override IEntity Entity { get { return this; } } /// <summary> /// /// </summary> /// <param name="surface"></param> /// <param name="pt"></param> /// <param name="heightCutDiff"></param> - public override void draw(DrawContext surface, Point pt, int heightCutDiff) + public override void Draw(DrawContext surface, Point pt, int heightCutDiff) { sprite.Draw(surface.Surface, pt); } @@ -66,7 +66,7 @@ /// <summary> /// /// </summary> - public int entityValue { get { return 0; } } + public int EntityValue { get { return 0; } } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/World/Land/LandVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Land/LandVoxel.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Land/LandVoxel.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -43,11 +43,11 @@ /// <summary> /// /// </summary> - public override bool transparent { get { return true; } } + public override bool Transparent { get { return true; } } /// <summary> /// /// </summary> - public override IEntity entity { get { return this; } } + public override IEntity Entity { get { return this; } } #region Entity implementation /// <summary> @@ -65,7 +65,7 @@ /// <summary> /// /// </summary> - public abstract int entityValue { get; } + public abstract int EntityValue { get; } /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs =================================================================== --- branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs 2008-04-09 17:34:47 UTC (rev 358) +++ branches/FreeTrainSDL/core/World/Land/StaticLandVoxel.cs 2008-04-09 20:31:01 UTC (rev 359) @@ -49,15 +49,15 @@ /// <summary> /// /// </summary> - public override void onRemoved() + public override void OnRemoved() { if (stationListener != null) - stationListener.onRemoved(); + stationListener.OnRemoved(); } /// <summary> /// /// </summary> - public override int entityValue { get { return contrib.Price; } } + public override int EntityValue { get { return contrib.Price; } } private readonly StationListenerImpl stationListener; @@ -68,7 +68,7 @@ /// <param name="surface"></param> /// <param name="pt"></param> /// <param name="heightCutDiff"></param> - public override void draw(DrawContext surface, Point pt, int heightCutDiff) + public override void Draw(DrawContext surface, Point pt, int heightCutDiff) { // always draw it regardless of the height cut contrib.sprite.Draw(surface.Surface, pt); @@ -78,13 +78,13 @@ /// </summary> /// <param name="aspect"></param> /// <returns></returns> - public override object queryInterface(Type aspect) + public override object QueryInterface(Type aspect) { // if type.population is null, we don't have any population if (aspect == typeof(IStationListener)) return stationListener; else - return base.queryInterface(aspect); + return base.QueryInterface(aspect); } } } Modified: branches/FreeTrainSDL/core/World/RRCrossing.cs =================================================================== --- branches/FreeTrainSDL/core/World/RRCrossing.cs 2008-04-09 17:3... [truncated message content] |
From: <je...@us...> - 2008-04-13 05:40:50
|
Revision: 362 http://freetrain.svn.sourceforge.net/freetrain/?rev=362&view=rev Author: jendave Date: 2008-04-12 22:40:57 -0700 (Sat, 12 Apr 2008) Log Message: ----------- split out multiple classes from files Modified Paths: -------------- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Others/NewGameContribution.cs branches/FreeTrainSDL/core/Contributions/Others/NewWorldDialog.cs branches/FreeTrainSDL/core/Contributions/Population/BasePopulation.cs branches/FreeTrainSDL/core/Contributions/Population/CombinationPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/HourlyPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/MultiplierPopulation.cs branches/FreeTrainSDL/core/Contributions/Population/PersistentPopulation.cs branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs branches/FreeTrainSDL/core/Contributions/Rail/TrainControllerContribution.cs branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs branches/FreeTrainSDL/core/Contributions/Road/RoadContribution.cs branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs branches/FreeTrainSDL/core/Contributions/Sound/BGMFactoryContribution.cs branches/FreeTrainSDL/core/Contributions/Structs/SpecialStructureContribution.cs branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/CubeSelectorController.cs branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Controllers/LocationStore.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs branches/FreeTrainSDL/core/Controllers/Rail/PlatformPropertyDialog.cs branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs branches/FreeTrainSDL/core/Controllers/RectSelectorController.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs branches/FreeTrainSDL/core/Framework/BGMManager.cs branches/FreeTrainSDL/core/Framework/NewWorldDialog.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/Views/QuarterViewDrawer.cs branches/FreeTrainSDL/core/World/Cube.cs branches/FreeTrainSDL/core/World/Development/CommercialStructurePlan.cs branches/FreeTrainSDL/core/World/Development/DevelopmentAlgorithm.cs branches/FreeTrainSDL/core/World/Development/ULV.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/Station.cs branches/FreeTrainSDL/core/World/Rail/YardRailRoad.cs branches/FreeTrainSDL/core/World/Road/Road.cs branches/FreeTrainSDL/core/World/Structs/PThreeDimStructure.cs branches/FreeTrainSDL/core/World/Structs/StationListenerImpl.cs branches/FreeTrainSDL/core/World/Structs/Structure.cs branches/FreeTrainSDL/core/World/Traffic.cs branches/FreeTrainSDL/lib/Controls/ColorPicker.cs branches/FreeTrainSDL/lib/Controls/FileDropHandler.cs branches/FreeTrainSDL/lib/Controls/FreeTrain.Controls.csproj branches/FreeTrainSDL/lib/Controls/MruMenu.cs branches/FreeTrainSDL/plugins/Chiname.DummyCars/DummyCarContribution.cs branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj branches/FreeTrainSDL/plugins/Chiname.Generic/MultiSelectorController.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HVStructure.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfVoxelContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs Added Paths: ----------- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroupGroup.cs branches/FreeTrainSDL/lib/Controls/IColorLibrary.cs branches/FreeTrainSDL/lib/Controls/MruMenuInline.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategories.cs branches/FreeTrainSDL/plugins/Chiname.Generic/StructCategoryTree.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadDisambiguator.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ContributionReference.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HSVColor.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HalfDividedVoxel.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSpriteFactory.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSpriteFactoryContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/SpriteSet.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/XVinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/YVinylHouseBuilder.cs Removed Paths: ------------- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/HueShiftSprite.cs Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructurePlacementController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -68,15 +68,15 @@ /// <param name="cube"></param> protected override void OnSelected(Cube cube) { - if (contrib.CanBeBuilt(cube.corner, ControlMode.Player)) + if (contrib.CanBeBuilt(cube.Corner, ControlMode.Player)) { MessageBox.Show("Can not build"); //! MessageBox.Show("設置できません"); } else { - CompletionHandler handler = new CompletionHandler(contrib, cube.corner, true); - new ConstructionSite(cube.corner, new EventHandler(handler.handle), contrib.Size); + CompletionHandler handler = new CompletionHandler(contrib, cube.Corner, true); + new ConstructionSite(cube.Corner, new EventHandler(handler.handle), contrib.Size); } } @@ -104,7 +104,7 @@ /// <param name="pt"></param> public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { - if (currentCube.contains(loc)) + if (CurrentCube.Contains(loc)) alphaSprites.getSprite(loc - this.location).DrawAlpha(canvas.Surface, pt); } Modified: branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Common/FixedSizeStructureRemovalController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -57,7 +57,7 @@ /// <param name="cube"></param> protected override void OnSelected(Cube cube) { - PThreeDimStructure s = WorldDefinition.World.GetEntityAt(cube.corner) as PThreeDimStructure; + PThreeDimStructure s = WorldDefinition.World.GetEntityAt(cube.Corner) as PThreeDimStructure; if (s == null || s.type != contrib) { MessageBox.Show("Wrong type"); Modified: branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Common/StructureContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -205,7 +205,7 @@ XmlElement pop = (XmlElement)e.SelectSingleNode("population"); if (pop != null) - _population = new PersistentPopulation(BasePopulation.load(pop), + _population = new PersistentPopulation(BasePopulation.Load(pop), new PopulationReferenceImpl(ownerId)); } Modified: branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Land/DefaultControllerImpl.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -46,22 +46,22 @@ /// <summary> /// /// </summary> - /// <param name="_contrib"></param> - /// <param name="_site"></param> - /// <param name="_spriteBuilder"></param> - public DefaultControllerImpl(LandBuilderContribution _contrib, IControllerSite _site, - SpriteBuilder _spriteBuilder) - : base(_site) + /// <param name="contrib"></param> + /// <param name="site"></param> + /// <param name="spriteBuilder"></param> + public DefaultControllerImpl(LandBuilderContribution contrib, IControllerSite site, + SpriteBuilder spriteBuilder) + : base(site) { - this.contrib = _contrib; - this.spriteBuilder = _spriteBuilder; + this.contrib = contrib; + this.spriteBuilder = spriteBuilder; } /// <summary> /// /// </summary> /// <param name="loc1"></param> /// <param name="loc2"></param> - protected override void onRectSelected(Location loc1, Location loc2) + protected override void OnRectSelected(Location loc1, Location loc2) { contrib.Create(loc1, loc2, true); } @@ -80,9 +80,9 @@ /// <param name="pt"></param> public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { - if (loc.z != currentLoc.z) return; + if (loc.z != CurrentLocation.z) return; - if (anchor != UNPLACED && loc.inBetween(anchor, currentLoc)) + if (Anchor != Unplaced && loc.inBetween(Anchor, CurrentLocation)) spriteBuilder().DrawAlpha(canvas.Surface, pt); } /// <summary> Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -136,10 +136,10 @@ public override IModalController CreateRemover(IControllerSite site) { return new DefaultControllerImpl(this, site, - new DefaultControllerImpl.SpriteBuilder(getSprite)); + new DefaultControllerImpl.SpriteBuilder(GetSprite)); } - private static ISprite getSprite() + private static ISprite GetSprite() { return ResourceUtil.RemoverChip; //return ResourceUtil.emptyChip; Modified: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroup.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -61,36 +61,4 @@ /// <returns></returns> public override string ToString() { return Name; } } - - /// <summary> - /// Group of LandGroup. - /// - /// This object implements IListSource to support data-binding. - /// </summary> - public class LandBuilderGroupGroup : StructureGroupGroup - { - /// <summary> - /// - /// </summary> - public LandBuilderGroupGroup() { } - /// <summary> - /// - /// </summary> - /// <param name="name"></param> - /// <returns></returns> - public new LandBuilderGroup this[string name] - { - get - { - LandBuilderGroup g = (LandBuilderGroup)core[name]; - if (g == null) - { - core[name] = g = new LandBuilderGroup(name); - list.Add(g); - } - - return g; - } - } - } } Added: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroupGroup.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroupGroup.cs (rev 0) +++ branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroupGroup.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -0,0 +1,59 @@ +#region LICENSE +/* + * Copyright (C) 2007 - 2008 FreeTrain Team (http://freetrain.sourceforge.net) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#endregion LICENSE + +using System; +using System.Collections; +using System.ComponentModel; +using FreeTrain.Contributions.Common; + +namespace FreeTrain.Contributions.Land +{ + /// <summary> + /// Group of LandGroup. + /// + /// This object implements IListSource to support data-binding. + /// </summary> + public class LandBuilderGroupGroup : StructureGroupGroup + { + /// <summary> + /// + /// </summary> + public LandBuilderGroupGroup() { } + /// <summary> + /// + /// </summary> + /// <param name="name"></param> + /// <returns></returns> + public new LandBuilderGroup this[string name] + { + get + { + LandBuilderGroup g = (LandBuilderGroup)core[name]; + if (g == null) + { + core[name] = g = new LandBuilderGroup(name); + list.Add(g); + } + + return g; + } + } + } +} Property changes on: branches/FreeTrainSDL/core/Contributions/Land/LandBuilderGroupGroup.cs ___________________________________________________________________ Name: svn:mime-type + text/x-csharp Name: svn:eol-style + native Modified: branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Land/RandomLandBuilder.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -109,10 +109,10 @@ /// <returns></returns> public override IModalController CreateBuilder(IControllerSite site) { - return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getLandSprite)); + return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(GetLandSprite)); } - private ISprite getLandSprite() + private ISprite GetLandSprite() { return getLand().sprite; } Modified: branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Land/StaticLandBuilder.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -92,10 +92,10 @@ /// <returns></returns> public override IModalController CreateBuilder(IControllerSite site) { - return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(getSprite)); + return new DefaultControllerImpl(this, site, new DefaultControllerImpl.SpriteBuilder(GetSprite)); } - private ISprite getSprite() + private ISprite GetSprite() { return sprite; } Modified: branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Others/EmptyNewGameContributionImpl.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -39,22 +39,22 @@ /// <summary> /// /// </summary> - public override string author { get { return "-"; } } + public override string Author { get { return "-"; } } /// <summary> /// /// </summary> - public override string name { get { return "Empty map"; } } + public override string Name { get { return "Empty map"; } } //! public override string name { get { return "空マップ"; } } /// <summary> /// /// </summary> - public override string description { get { return "Create a completely empty map"; } } + public override string Description { get { return "Create a completely empty map"; } } //! public override string description { get { return "何もない空のマップを作成します"; } } /// <summary> /// /// </summary> /// <returns></returns> - public override WorldDefinition createNewGame() + public override WorldDefinition CreateNewGame() { using (NewWorldDialog dialog = new NewWorldDialog()) { Modified: branches/FreeTrainSDL/core/Contributions/Others/NewGameContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Others/NewGameContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Others/NewGameContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -39,22 +39,22 @@ /// <summary> /// Name of the new game. /// </summary> - public abstract string name { get; } + public abstract string Name { get; } /// <summary> /// Author of the new game. /// </summary> - public abstract string author { get; } + public abstract string Author { get; } /// <summary> /// Human-readable description of the new game. /// </summary> - public abstract string description { get; } + public abstract string Description { get; } /// <summary> /// Creates a new game by creating a new instance of the World object. /// </summary> /// <returns>null to indicate that the operation was cancelled.</returns> - public abstract WorldDefinition createNewGame(); + public abstract WorldDefinition CreateNewGame(); } } Modified: branches/FreeTrainSDL/core/Contributions/Others/NewWorldDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Others/NewWorldDialog.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Others/NewWorldDialog.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -18,58 +18,58 @@ */ #endregion LICENSE -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using FreeTrain.World; - -namespace FreeTrain.Contributions.Others -{ - /// <summary> - /// Dialog box to create a new World object. - /// </summary> - class NewWorldDialog : System.Windows.Forms.Form - { - public NewWorldDialog() { - InitializeComponent(); - } - - /// <summary> - /// 使用されているリソースに後処理を実行します。 - /// </summary> - protected override void Dispose( bool disposing ) { - if( disposing ) { - if(components != null) { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// <summary> - /// 必要なデザイナ変数です。 - /// </summary> - private System.ComponentModel.Container components = null; - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox name; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox sizeX; - private System.Windows.Forms.TextBox sizeY; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox sizeZ; - private System.Windows.Forms.Button cancelButton; - - /// <summary> - /// デザイナ サポートに必要なメソッドです。このメソッドの内容を - /// コード エディタで変更しないでください。 - /// </summary> - private void InitializeComponent() +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using FreeTrain.World; + +namespace FreeTrain.Contributions.Others +{ + /// <summary> + /// Dialog box to create a new World object. + /// </summary> + class NewWorldDialog : System.Windows.Forms.Form + { + public NewWorldDialog() { + InitializeComponent(); + } + + /// <summary> + /// 使用されているリソースに後処理を実行します。 + /// </summary> + protected override void Dispose( bool disposing ) { + if( disposing ) { + if(components != null) { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// <summary> + /// 必要なデザイナ変数です。 + /// </summary> + private System.ComponentModel.Container components = null; + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox sizeX; + private System.Windows.Forms.TextBox sizeY; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox sizeZ; + private System.Windows.Forms.Button cancelButton; + + /// <summary> + /// デザイナ サポートに必要なメソッドです。このメソッドの内容を + /// コード エディタで変更しないでください。 + /// </summary> + private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.name = new System.Windows.Forms.TextBox(); @@ -198,37 +198,37 @@ this.ResumeLayout(false); this.PerformLayout(); - } - #endregion - - private void validateNumber(object sender, CancelEventArgs e) { - TextBox tb = (TextBox)sender; - try { - // check if the value is a positive integer. - if( int.Parse( tb.Text )>0 ) - return; - } catch( Exception ) {} - - // if not, refuse to move the focus. - e.Cancel = true; - tb.Select(); - } - - - /// <summary> - /// Creates a new empty world as specified by the user. - /// </summary> - public WorldDefinition createWorld() { - int x = int.Parse(sizeX.Text); - int y = int.Parse(sizeY.Text); - int z = int.Parse(sizeZ.Text); - WorldDefinition w = new WorldDefinition( new Distance(x,y+z*2,z), z/4 ); - w.Name = this.name.Text; - if(w.Name==null || w.Name.Length==0) - w.Name = "Terra Incognita"; - //! w.name = "ななしさん"; - return w; - // TODO: Z dimension - } - } -} + } + #endregion + + private void validateNumber(object sender, CancelEventArgs e) { + TextBox tb = (TextBox)sender; + try { + // check if the value is a positive integer. + if( int.Parse( tb.Text )>0 ) + return; + } catch( Exception ) {} + + // if not, refuse to move the focus. + e.Cancel = true; + tb.Select(); + } + + + /// <summary> + /// Creates a new empty world as specified by the user. + /// </summary> + public WorldDefinition createWorld() { + int x = int.Parse(sizeX.Text); + int y = int.Parse(sizeY.Text); + int z = int.Parse(sizeZ.Text); + WorldDefinition w = new WorldDefinition( new Distance(x,y+z*2,z), z/4 ); + w.Name = this.name.Text; + if(w.Name==null || w.Name.Length==0) + w.Name = "Terra Incognita"; + //! w.name = "ななしさん"; + return w; + // TODO: Z dimension + } + } +} Modified: branches/FreeTrainSDL/core/Contributions/Population/BasePopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/BasePopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/BasePopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -48,17 +48,17 @@ /// <summary> /// Number of population that is counted toward the total population of the world. /// </summary> - public abstract int residents { get; } + public abstract int Residents { get; } /// <summary> /// Computes the population of the given structure at the given time. /// </summary> - public abstract int calcPopulation(Time currentTime); + public abstract int CalcPopulation(Time currentTime); /// <summary> /// Loads a population from the plug-in manifest file. /// </summary> - public static BasePopulation load(XmlElement e) + public static BasePopulation Load(XmlElement e) { return (BasePopulation)PluginUtil.loadObjectFromManifest(e); } Modified: branches/FreeTrainSDL/core/Contributions/Population/CombinationPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/CombinationPopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/CombinationPopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -52,18 +52,18 @@ XmlNodeList nl = e.SelectNodes("population"); children = new BasePopulation[nl.Count]; for (int i = 0; i < nl.Count; i++) - children[i] = BasePopulation.load((XmlElement)nl[i]); + children[i] = BasePopulation.Load((XmlElement)nl[i]); } /// <summary> /// /// </summary> - public override int residents + public override int Residents { get { int r = 0; foreach (BasePopulation p in children) - r += p.residents; + r += p.Residents; return r; } } @@ -72,11 +72,11 @@ /// </summary> /// <param name="currentTime"></param> /// <returns></returns> - public override int calcPopulation(Time currentTime) + public override int CalcPopulation(Time currentTime) { int r = 0; foreach (BasePopulation p in children) - r += p.calcPopulation(currentTime); + r += p.CalcPopulation(currentTime); return r; } } Modified: branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/ConstantPopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -53,13 +53,13 @@ /// <summary> /// /// </summary> - public override int residents { get { return population; } } + public override int Residents { get { return population; } } /// <summary> /// /// </summary> /// <param name="currentTime"></param> /// <returns></returns> - public override int calcPopulation(Time currentTime) + public override int CalcPopulation(Time currentTime) { return population; } Modified: branches/FreeTrainSDL/core/Contributions/Population/HourlyPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/HourlyPopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/HourlyPopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -56,13 +56,13 @@ /// <summary> /// /// </summary> - public override int residents { get { return population; } } + public override int Residents { get { return population; } } /// <summary> /// /// </summary> /// <param name="currentTime"></param> /// <returns></returns> - public override int calcPopulation(Time currentTime) + public override int CalcPopulation(Time currentTime) { if (currentTime.isWeekend) return population * weekendHourTable[currentTime.hour] / 100; Modified: branches/FreeTrainSDL/core/Contributions/Population/MultiplierPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/MultiplierPopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/MultiplierPopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -38,21 +38,21 @@ /// /// </summary> /// <param name="f"></param> - /// <param name="_core"></param> - public MultiplierPopulation(int f, BasePopulation _core) + /// <param name="core"></param> + public MultiplierPopulation(int f, BasePopulation core) { this.factor = f; - this.core = _core; + this.core = core; } /// <summary> /// /// </summary> - public override int residents + public override int Residents { get { - return core.residents * factor; + return core.Residents * factor; } } /// <summary> @@ -60,9 +60,9 @@ /// </summary> /// <param name="currentTime"></param> /// <returns></returns> - public override int calcPopulation(Time currentTime) + public override int CalcPopulation(Time currentTime) { - return core.calcPopulation(currentTime) * factor; + return core.CalcPopulation(currentTime) * factor; } } } Modified: branches/FreeTrainSDL/core/Contributions/Population/PersistentPopulation.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Population/PersistentPopulation.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Population/PersistentPopulation.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -44,29 +44,29 @@ /// <summary> /// /// </summary> - /// <param name="_core"></param> - /// <param name="_ref"> + /// <param name="core"></param> + /// <param name="reference"> /// Object that returns a reference to the existing same object. /// This object needs to be serializable, and will be used to /// restore reference correctly. /// </param> - public PersistentPopulation(BasePopulation _core, IObjectReference _ref) + public PersistentPopulation(BasePopulation core, IObjectReference reference) { - this.core = _core; - this.resolver = _ref; + this.core = core; + this.resolver = reference; } /// <summary> /// /// </summary> - public override int residents { get { return core.residents; } } + public override int Residents { get { return core.Residents; } } /// <summary> /// /// </summary> /// <param name="currentTime"></param> /// <returns></returns> - public override int calcPopulation(Time currentTime) + public override int CalcPopulation(Time currentTime) { - return core.calcPopulation(currentTime); + return core.CalcPopulation(currentTime); } // Modified: branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Rail/DepartureBellContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -50,24 +50,39 @@ } /// <summary> name of this sound </summary> - public readonly string name; + private readonly string name; + /// <summary> + /// + /// </summary> + public string Name + { + get { return name; } + } + + /// <summary> Bell sound </summary> - public readonly ISoundEffect sound; + private readonly ISoundEffect sound; + /// <summary> /// /// </summary> + public ISoundEffect Sound + { + get { return sound; } + } + + /// <summary> + /// + /// </summary> /// <returns></returns> public override string ToString() { return name; } - - - /// <summary> Gets all the departure bell contributions in the system. </summary> - public static DepartureBellContribution[] all + public static DepartureBellContribution[] All { get { @@ -77,7 +92,7 @@ } /// <summary> Default bell sound. </summary> - public static DepartureBellContribution DEFAULT + public static DepartureBellContribution Default { get { Modified: branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Rail/StationContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -45,10 +45,19 @@ } /// <summary> Operation cost of this station per day. </summary> - public readonly int operationCost; + private readonly int operationCost; + /// <summary> /// /// </summary> + public int OperationCost + { + get { return operationCost; } + } + + /// <summary> + /// + /// </summary> /// <param name="name"></param> /// <returns></returns> protected override StructureGroup GetGroup(string name) Modified: branches/FreeTrainSDL/core/Contributions/Rail/TrainControllerContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Rail/TrainControllerContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Rail/TrainControllerContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -42,16 +42,16 @@ /// <summary> /// Creates a new instance of TrainController. /// </summary> - public abstract TrainController newController(string name); + public abstract TrainController NewController(string name); /// <summary> /// Gets the name of this train controller type. /// </summary> - public abstract string name { get; } + public abstract string Name { get; } /// <summary> /// Gets the description of this train controller type. /// </summary> - public abstract string description { get; } + public abstract string Description { get; } } } Modified: branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Road/A3RoadContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -57,7 +57,7 @@ /// </summary> /// <param name="idx"></param> /// <returns></returns> - protected internal override ISprite getSprite(byte idx) + protected internal override ISprite GetSprite(byte idx) { switch (idx) { Modified: branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Road/AbstractRoadContributionImpl.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -38,7 +38,7 @@ [Serializable] public abstract class AbstractRoadContributionImpl : RoadContribution { - private readonly string _name; + private readonly string name; private readonly string description; /// <summary> /// @@ -47,7 +47,7 @@ protected AbstractRoadContributionImpl(XmlElement e) : base(e) { - _name = XmlUtil.SelectSingleNode(e, "name").InnerText; + name = XmlUtil.SelectSingleNode(e, "name").InnerText; description = XmlUtil.SelectSingleNode(e, "description").InnerText; } /// <summary> @@ -55,7 +55,7 @@ /// </summary> /// <param name="dirs"></param> /// <returns></returns> - protected internal abstract ISprite getSprite(byte dirs); + protected internal abstract ISprite GetSprite(byte dirs); /// <summary> /// /// </summary> @@ -78,8 +78,8 @@ if (v == null) return false; // occupied if (v.road != null) { - if (!v.road.canAttach(d) && here != to) return false; - if (!v.road.canAttach(d.opposite) && here != from) return false; + if (!v.road.CanAttach(d) && here != to) return false; + if (!v.road.CanAttach(d.opposite) && here != from) return false; } if (v.car != null) return false; // car is in place // TODO: check v.railRoad @@ -110,12 +110,12 @@ if (here == from) p = RoadPattern.get((byte)(1 << (d.index / 2))); if (here == to) p = RoadPattern.get((byte)(1 << (d.opposite.index / 2))); - create(TrafficVoxel.getOrCreate(here), p); + Create(TrafficVoxel.getOrCreate(here), p); } else { - if (here != from) r.attach(d.opposite); - if (here != to) r.attach(d); + if (here != from) r.Attach(d.opposite); + if (here != to) r.Attach(d); } if (here == to) return; @@ -126,7 +126,7 @@ /// <summary> /// Creates a new road with a given pattern. /// </summary> - protected virtual BaseRoad create(TrafficVoxel voxel, RoadPattern pattern) + protected virtual BaseRoad Create(TrafficVoxel voxel, RoadPattern pattern) { return new RoadImpl(this, voxel, pattern); } @@ -146,7 +146,7 @@ { BaseRoad r = BaseRoad.get(here); if (r != null) - r.detach(d, d.opposite); + r.Detach(d, d.opposite); if (here == to) return; here = here.toward(to); @@ -159,7 +159,7 @@ { get { - return _name; + return name; } } /// <summary> @@ -197,8 +197,8 @@ } while (y >= 0 && x < 10) { - if (previewPattern[PreviewPatternIdx, x, y] > 0) - drawer.Draw(getSprite(previewPattern[PreviewPatternIdx, x, y]), 9 - x, y - 5); + if (PreviewPattern[PreviewPatternIdx, x, y] > 0) + drawer.Draw(GetSprite(PreviewPattern[PreviewPatternIdx, x, y]), 9 - x, y - 5); x++; y--; } @@ -222,7 +222,7 @@ /// <param name="pattern"></param> internal protected RoadImpl(AbstractRoadContributionImpl contrib, TrafficVoxel tv, RoadPattern pattern) : - base(tv, pattern, contrib.style) + base(tv, pattern, contrib.Style) { this.contribution = contrib; @@ -234,16 +234,16 @@ /// </summary> /// <param name="display"></param> /// <param name="pt"></param> - public override void drawBefore(DrawContext display, Point pt) + public override void DrawBefore(DrawContext display, Point pt) { - contribution.getSprite(pattern.dirs).Draw(display.Surface, pt); + contribution.GetSprite(pattern.dirs).Draw(display.Surface, pt); } /// <summary> /// /// </summary> /// <param name="d"></param> /// <returns></returns> - public override bool attach(Direction d) + public override bool Attach(Direction d) { byte dirs = pattern.dirs; dirs |= (byte)(1 << (d.index / 2)); @@ -255,7 +255,7 @@ /// </summary> /// <param name="d1"></param> /// <param name="d2"></param> - public override void detach(Direction d1, Direction d2) + public override void Detach(Direction d1, Direction d2) { byte dirs = pattern.dirs; dirs &= (byte)~(1 << (d1.index / 2)); @@ -276,7 +276,7 @@ /// </summary> /// <param name="d"></param> /// <returns></returns> - public override bool canAttach(Direction d) + public override bool CanAttach(Direction d) { return true; } Modified: branches/FreeTrainSDL/core/Contributions/Road/RoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/RoadContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Road/RoadContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -66,8 +66,16 @@ /// <summary> /// /// </summary> - public readonly RoadStyle style; + private readonly RoadStyle style; + /// <summary> + /// + /// </summary> + public RoadStyle Style + { + get { return style; } + } + private int previewPatternIdx = 0; /// <summary> /// @@ -80,7 +88,7 @@ /// <summary> /// /// </summary> - public static readonly byte[, ,] previewPattern = + private static readonly byte[, ,] previewPattern = { { {00,00,00,10,00,00,00,00,00,00}, @@ -119,9 +127,18 @@ {00,00,00,00,00,00,00,00,00,00} } }; // roads are always 4-way. + /// <summary> /// /// </summary> + public static byte[, ,] PreviewPattern + { + get { return RoadContribution.previewPattern; } + } + + /// <summary> + /// + /// </summary> public override sealed DirectionModes DirectionMode { get Modified: branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Road/StandardRoadContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -73,7 +73,7 @@ /// </summary> /// <param name="idx"></param> /// <returns></returns> - protected internal override ISprite getSprite(byte idx) + protected internal override ISprite GetSprite(byte idx) { return flatSprites[idx]; } Modified: branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Sound/BGMContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -56,10 +56,19 @@ } /// <summary> Title of the music. </summary> - public readonly string name; + private readonly string name; + /// <summary> /// /// </summary> + public string Name + { + get { return name; } + } + + /// <summary> + /// + /// </summary> /// <returns></returns> public override string ToString() { @@ -67,6 +76,15 @@ } /// <summary> File name of the music. </summary> - public readonly string fileName; + private readonly string fileName; + + /// <summary> + /// + /// </summary> + public string FileName + { + get { return fileName; } + } + } } Modified: branches/FreeTrainSDL/core/Contributions/Sound/BGMFactoryContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Sound/BGMFactoryContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Sound/BGMFactoryContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -42,12 +42,12 @@ /// into the set of BGMs. /// </summary> /// <returns></returns> - public abstract BGMContribution[] listContributions(); + public abstract BGMContribution[] ListContributions(); /// <summary> /// Gets the group name of these BGMContributions. /// </summary> - public abstract string title { get; } + public abstract string Title { get; } } internal class BGMFactoryContributionFactory : IContributionFactory @@ -73,7 +73,7 @@ (BGMFactoryContribution)PluginUtil.loadObjectFromManifest(e); // let the factory load BGMs - foreach (BGMContribution bgm in contrib.listContributions()) + foreach (BGMContribution bgm in contrib.ListContributions()) { owner.contributions.Add(bgm); bgm.init(owner, new Uri(owner.dirName)); Modified: branches/FreeTrainSDL/core/Contributions/Structs/SpecialStructureContribution.cs =================================================================== --- branches/FreeTrainSDL/core/Contributions/Structs/SpecialStructureContribution.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Contributions/Structs/SpecialStructureContribution.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -39,16 +39,16 @@ /// <summary> /// Gets the name used for the menu item. /// </summary> - public abstract string name { get; } + public abstract string Name { get; } /// <summary> /// Gets a one line description of this rail. /// </summary> - public abstract string oneLineDescription { get; } + public abstract string OneLineDescription { get; } /// <summary> /// This method is called when the menu item is selected by the user. /// </summary> - public abstract void showDialog(); + public abstract void ShowDialog(); } } Modified: branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -224,9 +224,9 @@ if (anchor != UNPLACED && isPlacing && currentPos != loc) { if (currentPos != UNPLACED) - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); currentPos = align(loc); - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); } } @@ -257,7 +257,7 @@ else // remove existing ones Type.Remove(anchor, loc); - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, loc)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, loc)); } anchor = UNPLACED; } @@ -277,7 +277,7 @@ { // cancel the anchor if (currentPos != UNPLACED) - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPos)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); anchor = UNPLACED; } } Modified: branches/FreeTrainSDL/core/Controllers/CubeSelectorController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/CubeSelectorController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/CubeSelectorController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -98,12 +98,12 @@ /// <summary> /// North-west corner of the selected region. /// </summary> - protected Cube currentCube + protected Cube CurrentCube { get { Debug.Assert(location != UNPLACED); - return Cube.createExclusive(location, size); + return Cube.CreateExclusive(location, size); } } @@ -125,7 +125,7 @@ /// <param name="ab"></param> public virtual void OnClick(MapViewWindow view, Location loc, Point ab) { - OnSelected(Cube.createExclusive(loc, size)); + OnSelected(Cube.CreateExclusive(loc, size)); } /// <summary> /// @@ -151,9 +151,9 @@ { // the current location is moved. // update the screen - w.OnVoxelUpdated(currentCube); + w.OnVoxelUpdated(CurrentCube); location = loc; - w.OnVoxelUpdated(currentCube); + w.OnVoxelUpdated(CurrentCube); } } /// <summary> @@ -171,7 +171,7 @@ /// <summary> /// /// </summary> - public virtual void close() + public virtual void Close() { onCanceled(); } Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -171,7 +171,7 @@ } - protected override void onRectSelected(Location loc1, Location loc2) + protected override void OnRectSelected(Location loc1, Location loc2) { if (owner.isPlacing) buy(loc1, loc2); @@ -183,7 +183,7 @@ /// </summary> /// <param name="loc1"></param> /// <param name="loc2"></param> - protected override void onRectUpdated(Location loc1, Location loc2) + protected override void OnRectUpdated(Location loc1, Location loc2) { if (owner.isPlacing) owner.costBox.cost = computePriceForBuy(loc1, loc2); @@ -205,9 +205,9 @@ /// <param name="pt"></param> public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { - if (loc.z != anchor.z) return; + if (loc.z != Anchor.z) return; - if (anchor != UNPLACED && loc.inBetween(anchor, currentLoc)) + if (Anchor != Unplaced && loc.inBetween(Anchor, CurrentLocation)) { if (owner.isPlacing) LandPropertyVoxel.sprite.DrawAlpha(canvas.Surface, pt); Modified: branches/FreeTrainSDL/core/Controllers/LocationStore.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/LocationStore.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/LocationStore.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -39,7 +39,7 @@ /// <summary> /// /// </summary> - public Location location + public Location Location { get { Modified: branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/Rail/PlatformController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -293,7 +293,7 @@ loc2 += direction.right90; // for the attached rail road, width is two } } - WorldDefinition.World.OnVoxelUpdated(Cube.createExclusive(baseLoc, loc2)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateExclusive(baseLoc, loc2)); } /// <summary> @@ -405,7 +405,7 @@ switch (this.currentMode) { case Mode.Station: - if (Cube.createExclusive(baseLoc, alphaSprites.size).contains(loc)) + if (Cube.CreateExclusive(baseLoc, alphaSprites.size).Contains(loc)) alphaSprites.getSprite(loc - baseLoc).DrawAlpha(canvas, pt); break; @@ -414,7 +414,7 @@ if (direction == Direction.NORTH) loc.y += length - 1; if (direction == Direction.WEST) loc.x += length - 1; - if (Cube.createExclusive(baseLoc, alphaSprites.size).contains(loc)) + if (Cube.CreateExclusive(baseLoc, alphaSprites.size).Contains(loc)) alphaSprites.getSprite(loc - baseLoc).DrawAlpha(canvas, pt); break; Modified: branches/FreeTrainSDL/core/Controllers/Rail/PlatformPropertyDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/PlatformPropertyDialog.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/Rail/PlatformPropertyDialog.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -70,7 +70,7 @@ hostList.SelectedItem = platform.host; // bell sound list - bell.DataSource = DepartureBellContribution.all; + bell.DataSource = DepartureBellContribution.All; bell.SelectedItem = platform.bellSound; } Modified: branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/Rail/RailRoadController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -140,7 +140,7 @@ // cancel the anchor if (currentPosition != unplaced) { - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPosition)); } anchor = unplaced; UpdateDialog(); @@ -160,10 +160,10 @@ // update the screen if (currentPosition != unplaced) { - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPosition)); } currentPosition = location; - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(anchor, currentPosition)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPosition)); int cost; SingleRailRoad.ComputeRoute(anchor, currentPosition, out cost); Modified: branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeTrainSDL/core/Controllers/Rail/SlopeRailRoadController.cs 2008-04-13 05:40:57 UTC (rev 362) @@ -414,7 +414,7 @@ loc2.y += direction.offsetY * 3; loc2.z++; - WorldDefinition.World.OnVoxelUpdated(Cube.createInclusive(lastMouse, loc2)); + WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(lastMouse, loc2)); } /// <summary> Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainControllerDialog.cs 2008-04-09 20:54:19 UTC (rev 361) +++ branches/FreeT... [truncated message content] |
From: <je...@us...> - 2008-04-14 16:43:20
|
Revision: 363 http://freetrain.svn.sourceforge.net/freetrain/?rev=363&view=rev Author: jendave Date: 2008-04-14 09:43:06 -0700 (Mon, 14 Apr 2008) Log Message: ----------- build "any cpu". other cleanups Modified Paths: -------------- branches/FreeTrainSDL/FreeTrainSDL.csproj branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs branches/FreeTrainSDL/core/Framework/AboutDialog.Designer.cs branches/FreeTrainSDL/core/FreeTrain.csproj branches/FreeTrainSDL/core/World/Car.cs branches/FreeTrainSDL/core/World/Rail/JunctionRailRoad.cs branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/SpecialPurposeRailRoad.cs branches/FreeTrainSDL/core/World/Rail/Train.cs branches/FreeTrainSDL/core/World/Rail/YardRailRoad.cs branches/FreeTrainSDL/core/World/Road/Bus.cs branches/FreeTrainSDL/core/World/Traffic.cs branches/FreeTrainSDL/lib/Controls/FreeTrain.Controls.csproj branches/FreeTrainSDL/plugins/Chiname.DummyCars/FreeTrain.DummyCars.csproj branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/FreeTrain.ColorTestTrain.csproj branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj Modified: branches/FreeTrainSDL/FreeTrainSDL.csproj =================================================================== --- branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/FreeTrainSDL.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -32,7 +32,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> Modified: branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/Controllers/Rail/TrainPlacementController.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -181,13 +181,13 @@ private void resetArrowLocation() { Train tr = this.selectedTrain; - if (tr == null || !tr.head.state.isInside) + if (tr == null || !tr.head.State.isInside) { arrowLoc.Location = World.Location.Unplaced; } else { - arrowLoc.Location = tr.head.state.asInside().location; + arrowLoc.Location = tr.head.State.asInside().location; } } @@ -208,7 +208,7 @@ if (tr.isPlaced) { // see if the user has clicked the same train - Car c = Car.get(loc); + Car c = Car.Get(loc); if (c is Train.TrainCar && ((Train.TrainCar)c).parent == tr) { // clicking the same train will be considered to reverse its direction @@ -370,10 +370,10 @@ public void DrawAfter(QuarterViewDrawer view, DrawContext dc) { Train tr = this.selectedTrain; - if (tr == null || !tr.head.state.isInside) return; + if (tr == null || !tr.head.State.isInside) return; // draw an arrow that indicates the direction of the train - CarState.Inside ci = tr.head.state.asInside(); + CarState.Inside ci = tr.head.State.asInside(); Point pt = view.fromXYZToClient(ci.location); pt.Y -= 12; Modified: branches/FreeTrainSDL/core/Framework/AboutDialog.Designer.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/AboutDialog.Designer.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/Framework/AboutDialog.Designer.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -102,7 +102,7 @@ this.ClientSize = new System.Drawing.Size(339, 215); this.Controls.Add(this.panel1); this.Controls.Add(this.okButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; Modified: branches/FreeTrainSDL/core/FreeTrain.csproj =================================================================== --- branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/FreeTrain.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -25,7 +25,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>bin\Debug\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> Modified: branches/FreeTrainSDL/core/World/Car.cs =================================================================== --- branches/FreeTrainSDL/core/World/Car.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Car.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -37,17 +37,17 @@ [Serializable] public abstract class Car { - private CarState _state = CarState.Unplaced.theInstance; + private CarState state = CarState.Unplaced.theInstance; /// <summary> /// Set the new state. /// </summary> /// <returns>the previous state</returns> - protected CarState setState(CarState s) + protected CarState SetState(CarState s) { - CarState oldState = _state; + CarState oldState = state; - CarState.Inside ss = _state.asInside(); + CarState.Inside ss = state.asInside(); if (ss != null) { Debug.Assert(ss.voxel.car == this); @@ -55,7 +55,7 @@ WorldDefinition.World.OnVoxelUpdated(ss.voxel); } - _state = s; + state = s; ss = s.asInside(); if (ss != null) @@ -71,41 +71,41 @@ /// <summary> /// Current location/direction of the car. /// </summary> - public CarState state { get { return _state; } } + public CarState State { get { return state; } } /// <summary> /// 車両を配置する /// </summary> - public void place(Location loc, Direction dir) + public void Place(Location loc, Direction dir) { - Debug.Assert(state.isUnplaced); - setState(new CarState.Inside(loc, dir)); + Debug.Assert(State.isUnplaced); + SetState(new CarState.Inside(loc, dir)); } /// <summary> /// 車両を現在位置から撤去する /// </summary> - public void remove() + public void Remove() { - Debug.Assert(!state.isUnplaced); - setState(CarState.Unplaced.theInstance); + Debug.Assert(!State.isUnplaced); + SetState(CarState.Unplaced.theInstance); } /// <summary> /// Called when a car is clicked. /// </summary> /// <returns>true if the click is processed and consumed</returns> - public virtual bool onClick() { return false; } + public virtual bool OnClick() { return false; } /// <summary> /// Draws the car into the specified location. /// </summary> - public abstract void draw(DrawContext display, Point pt); + public abstract void Draw(DrawContext display, Point pt); /// <summary> /// Gets a car that occupies the specified place, if any. Or null otherwise. /// </summary> - public static Car get(Location loc) + public static Car Get(Location loc) { TrafficVoxel v = TrafficVoxel.get(loc); if (v == null) return null; Modified: branches/FreeTrainSDL/core/World/Rail/JunctionRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/JunctionRailRoad.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/JunctionRailRoad.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -44,7 +44,7 @@ public override Direction Guide() { Train.TrainCar car = (Train.TrainCar)Voxel.car; - CarState.Placed state = car.state.asPlaced(); + CarState.Placed state = car.State.asPlaced(); Direction d = state.asInside().direction; if (hasRail(d)) @@ -65,7 +65,7 @@ else { // otherwise follow the previous car - if (previous.state.asPlaced().location == state.location + d) + if (previous.State.asPlaced().location == state.location + d) return d; } Modified: branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/SingleRailRoad.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -43,7 +43,7 @@ /// <returns></returns> public override Direction Guide() { - Direction d = Voxel.car.state.asInside().direction; + Direction d = Voxel.car.State.asInside().direction; if (hasRail(d)) return d; // 進路変更なし Direction l = d.left; Modified: branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/SlopeRailRoad.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -168,7 +168,7 @@ { // slop rails don't curve. so a car should be // able to go to the same direction - Direction d = Voxel.car.state.asInside().direction; + Direction d = Voxel.car.State.asInside().direction; Debug.Assert(hasRail(d)); return d; } @@ -383,7 +383,7 @@ public static int calcCostOfTearDownSlope(Location loc, Direction dir) { // make sure the first voxel is not occupied by a car - if (Car.get(loc) != null) return 0; + if (Car.Get(loc) != null) return 0; // the 2nd block has a distinctive zangle and zdiff. check it. loc += dir; @@ -395,14 +395,14 @@ return 0; // make sure the 2nd rail is not occupied by a car - if (Car.get(loc) != null) return 0; + if (Car.Get(loc) != null) return 0; // check 3rd and 4th rails. loc += dir; loc.z++; - if (Car.get(loc) != null) return 0; + if (Car.Get(loc) != null) return 0; loc += dir; - if (Car.get(loc) != null) return 0; + if (Car.Get(loc) != null) return 0; return SLOPE_DESTRUCTION_UNIT_COST * Math.Max(1, loc.z - WorldDefinition.World.WaterLevel); } Modified: branches/FreeTrainSDL/core/World/Rail/SpecialPurposeRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/SpecialPurposeRailRoad.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/SpecialPurposeRailRoad.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -73,7 +73,7 @@ /// <returns></returns> public override Direction Guide() { - Direction d = Voxel.car.state.asInside().direction; + Direction d = Voxel.car.State.asInside().direction; // we have straight rails only, so the direction must stay the same Debug.Assert(hasRail(d)); return d; Modified: branches/FreeTrainSDL/core/World/Rail/Train.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/Train.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -152,10 +152,10 @@ ds[idx] = d; locs[idx] = loc; // determine the next voxel - cars[0].place(loc, d); + cars[0].Place(loc, d); d = rr.Guide(); loc += d; - cars[0].remove(); + cars[0].Remove(); } while (idx != 0); // make sure we are not forming cycles @@ -166,7 +166,7 @@ // can be placed. place all for (int i = 0; i < length; i++) - cars[i].place(locs[i], ds[i]); + cars[i].Place(locs[i], ds[i]); stopCallCount = 0; registerTimer(); @@ -183,7 +183,7 @@ Debug.Assert(isPlaced); foreach (TrainCar car in cars) - car.remove(); + car.Remove(); // make sure that we don't have any pending event WorldDefinition.World.Clock.unregister(new ClockHandler(clockHandler)); @@ -312,7 +312,7 @@ { Debug.Assert(isPlaced); // we should have unregistered the handler when the train was removed. - CarState.Inside ins = head.state.asInside(); + CarState.Inside ins = head.State.asInside(); if (ins != null) { // this car might need to stop TimeLength time = ins.voxel.railRoad.getStopTimeSpan(this, stopCallCount); @@ -337,7 +337,7 @@ TrainStates s = TrainStates.Moving; // determine the next head car state - CarState next = calcNextTrainCarState[head.state]; + CarState next = calcNextTrainCarState[head.State]; if (next != null) { // if it can move forward if (!isBlocked[next]) @@ -350,7 +350,7 @@ { // we can't go forward. turn around reverse(); - next = calcNextTrainCarState[head.state]; + next = calcNextTrainCarState[head.State]; if (next != null && !isBlocked[next]) move(next); @@ -394,7 +394,7 @@ /// </summary> public void playSound(ISoundEffect se) { - CarState.Inside ins = head.state.asInside(); + CarState.Inside ins = head.State.asInside(); if (ins != null) se.play(ins.location); // play the sound } @@ -474,7 +474,7 @@ { // compute the distance between the source state and the current state int dist = passengerSourceState.location. - getDistanceTo(this.head.state.asPlaced().location); + getDistanceTo(this.head.State.asPlaced().location); // record the sales AccountManager.theInstance.earn( @@ -498,7 +498,7 @@ Debug.Assert(n <= passengerCapacity); _passenger = n; // memorize the location where passengers are loaded - passengerSourceState = this.head.state.asPlaced(); + passengerSourceState = this.head.State.asPlaced(); notifyListeners(); } @@ -797,7 +797,7 @@ internal CarState moveTo(CarState newState) { - return base.setState(newState); + return base.SetState(newState); } /// <summary> @@ -805,20 +805,20 @@ /// </summary> public void reverse() { - setState(reverseCarState[this.state]); + SetState(reverseCarState[this.State]); } /// <summary> /// /// </summary> /// <param name="dc"></param> /// <param name="pt"></param> - public override void draw(DrawContext dc, Point pt) + public override void Draw(DrawContext dc, Point pt) { Surface display = dc.Surface; pt.Y -= 9; // offset - CarState.Inside s = state.asInside(); + CarState.Inside s = State.asInside(); Debug.Assert(s != null); RailRoad rr = s.voxel.railRoad; Modified: branches/FreeTrainSDL/core/World/Rail/YardRailRoad.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/YardRailRoad.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Rail/YardRailRoad.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -72,7 +72,7 @@ // calculate the position where the train should stop. int pos; - CarState.Inside ins = tr.head.state.asInside(); + CarState.Inside ins = tr.head.State.asInside(); if (owner.direction == ins.direction) { Modified: branches/FreeTrainSDL/core/World/Road/Bus.cs =================================================================== --- branches/FreeTrainSDL/core/World/Road/Bus.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Road/Bus.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -40,7 +40,7 @@ /// </summary> /// <param name="display"></param> /// <param name="pt"></param> - public override void draw(DrawContext display, Point pt) + public override void Draw(DrawContext display, Point pt) { throw new NotImplementedException(); } Modified: branches/FreeTrainSDL/core/World/Traffic.cs =================================================================== --- branches/FreeTrainSDL/core/World/Traffic.cs 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/core/World/Traffic.cs 2008-04-14 16:43:06 UTC (rev 363) @@ -188,7 +188,7 @@ /// <returns></returns> public override bool OnClick() { - if (car != null && car.onClick()) return true; + if (car != null && car.OnClick()) return true; if (_railRoad != null && _railRoad.OnClick()) return true; return false; } @@ -270,7 +270,7 @@ if (car is Train.TrainCar) ((Train.TrainCar)car).parent.remove(); else - car.remove(); + car.Remove(); } BridgePierVoxel.teardownBridgeSupport(Location, this); if (onEntityRemoved != null) @@ -295,7 +295,7 @@ if (_road != null) _road.DrawBefore(display, pt); if (_accessory != null) _accessory.DrawBefore(display, pt); if (_railRoad != null) _railRoad.drawBefore(display, pt); - if (_car != null) _car.draw(display, pt); + if (_car != null) _car.Draw(display, pt); if (_railRoad != null) _railRoad.drawAfter(display, pt); if (_accessory != null) _accessory.DrawAfter(display, pt); } Modified: branches/FreeTrainSDL/lib/Controls/FreeTrain.Controls.csproj =================================================================== --- branches/FreeTrainSDL/lib/Controls/FreeTrain.Controls.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/lib/Controls/FreeTrain.Controls.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>bin\Debug\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> Modified: branches/FreeTrainSDL/plugins/Chiname.DummyCars/FreeTrain.DummyCars.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.DummyCars/FreeTrain.DummyCars.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Chiname.DummyCars/FreeTrain.DummyCars.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> Modified: branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Chiname.Generic/FreeTrain.Generic.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/FreeTrain.RoadAccessory.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/FreeTrain.HalfVoxelStructure.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -145,4 +145,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/FreeTrain.ColorTestTrain.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/FreeTrain.ColorTestTrain.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Kohsuke.ColorTestTrain/FreeTrain.ColorTestTrain.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -25,7 +25,7 @@ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <DocumentationFile>FreeTrain.World.Rail.ColorTestTrain.xml</DocumentationFile> </PropertyGroup> Modified: branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj =================================================================== --- branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj 2008-04-13 05:40:57 UTC (rev 362) +++ branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/FreeTrain.VinylHouse.csproj 2008-04-14 16:43:06 UTC (rev 363) @@ -29,7 +29,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\</OutputPath> - <PlatformTarget>x86</PlatformTarget> + <PlatformTarget>AnyCPU</PlatformTarget> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-14 18:05:13
|
Revision: 364 http://freetrain.svn.sourceforge.net/freetrain/?rev=364&view=rev Author: jendave Date: 2008-04-14 11:05:11 -0700 (Mon, 14 Apr 2008) Log Message: ----------- more renames Modified Paths: -------------- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs branches/FreeTrainSDL/core/Framework/AboutDialog.cs branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs branches/FreeTrainSDL/core/Util/Command/Command.cs branches/FreeTrainSDL/core/Util/Set.cs branches/FreeTrainSDL/core/Util/UrlInvoker.cs branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs branches/FreeTrainSDL/core/World/Cube.cs branches/FreeTrainSDL/core/World/Development/ULV.cs branches/FreeTrainSDL/core/World/Rail/Platform.cs branches/FreeTrainSDL/core/World/Rail/Station.cs branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryMarket.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs Modified: branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Controllers/Land/LandPropertyController.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -270,7 +270,7 @@ if (v != null && !v.Entity.isOwned && v.Entity.isSilentlyReclaimable) { // cost for removing this structure - if (s.add(v.Entity)) + if (s.Add(v.Entity)) r += v.Entity.EntityValue; } v = WorldDefinition.World[x, y, z]; Modified: branches/FreeTrainSDL/core/Framework/AboutDialog.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/AboutDialog.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Framework/AboutDialog.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -51,7 +51,7 @@ private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { - UrlInvoker.openUrl(((LinkLabel)sender).Text); + UrlInvoker.OpenUrl(((LinkLabel)sender).Text); } } Modified: branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs =================================================================== --- branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Framework/Plugin/PluginManager.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -191,7 +191,7 @@ } } pluginMap.Add(p.name, p); - pluginSet.add(p); + pluginSet.Add(p); } if (errBreak) { @@ -202,11 +202,11 @@ plugins = new PluginDefinition[pluginSet.Count]; int ptr = 0; PluginDefinition p = null; - while (!pluginSet.isEmpty) + while (!pluginSet.IsEmpty) { progressHandler("Sorting dependencies...", ++count / c_max); //! progressHandler("依存関係を整理中",++count/c_max); - p = (PluginDefinition)pluginSet.getOne(); + p = (PluginDefinition)pluginSet.GetOne(); try { while (true) @@ -215,7 +215,7 @@ int i; for (i = 0; i < deps.Length; i++) { - if (pluginSet.contains(deps[i])) + if (pluginSet.Contains(deps[i])) { break; } @@ -243,7 +243,7 @@ break; } } - pluginSet.remove(p); + pluginSet.Remove(p); plugins[ptr++] = p; } } Modified: branches/FreeTrainSDL/core/Util/Command/Command.cs =================================================================== --- branches/FreeTrainSDL/core/Util/Command/Command.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Util/Command/Command.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -67,7 +67,7 @@ this.manager = manager; this.commandInstances = new CommandInstanceList(this); - manager.commands.add(this); + manager.commands.Add(this); } // Methods to trigger events Modified: branches/FreeTrainSDL/core/Util/Set.cs =================================================================== --- branches/FreeTrainSDL/core/Util/Set.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Util/Set.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -30,18 +30,20 @@ public sealed class Set : ICollection { private readonly Hashtable core = new Hashtable(); + /// <summary> /// /// </summary> /// <param name="o"></param> /// <returns></returns> - public bool contains(object o) { return core.Contains(o); } + public bool Contains(object o) { return core.Contains(o); } + /// <summary> /// /// </summary> /// <param name="o"></param> /// <returns></returns> - public bool add(object o) + public bool Add(object o) { if (!core.ContainsKey(o)) { @@ -49,34 +51,43 @@ return true; } else + { return false; + } } + /// <summary> /// /// </summary> /// <param name="o"></param> - public void remove(object o) { core.Remove(o); } + public void Remove(object o) { core.Remove(o); } + /// <summary> /// /// </summary> - public void clear() { core.Clear(); } + public void Clear() { core.Clear(); } + /// <summary> /// /// </summary> public int Count { get { return core.Count; } } + /// <summary> /// /// </summary> public bool IsSynchronized { get { return false; } } + /// <summary> /// /// </summary> public object SyncRoot { get { return this; } } + /// <summary> /// /// /// </summary> - public bool isEmpty { get { return Count == 0; } } + public bool IsEmpty { get { return Count == 0; } } + /// <summary> /// /// </summary> @@ -85,30 +96,35 @@ { return core.Keys.GetEnumerator(); } + /// <summary> /// /// </summary> /// <returns></returns> - public object getOne() + public object GetOne() { IEnumerator e = GetEnumerator(); e.MoveNext(); return e.Current; } + /// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> - public Array toArray(Type type) + public Array ToArray(Type type) { Array r = Array.CreateInstance(type, Count); int idx = 0; foreach (object o in this) + { r.SetValue(o, idx++); + } return r; } + /// <summary> /// /// </summary> @@ -117,7 +133,9 @@ public void CopyTo(Array array, int index) { foreach (object o in this) + { array.SetValue(o, index++); + } } } } Modified: branches/FreeTrainSDL/core/Util/UrlInvoker.cs =================================================================== --- branches/FreeTrainSDL/core/Util/UrlInvoker.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/Util/UrlInvoker.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -34,7 +34,7 @@ /// /// </summary> /// <param name="targetUrl"></param> - static public void openUrl(String targetUrl) + static public void OpenUrl(String targetUrl) { ProcessStartInfo info = new ProcessStartInfo(); // URLに関連づけられたアプリケーションを探す Modified: branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs =================================================================== --- branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Accounting/AccountManager.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -136,13 +136,13 @@ internal void addDebt(Debt debt) { - debts.add(debt); + debts.Add(debt); updateTotalDebts(); } internal void removeDebt(Debt debt) { - debts.remove(debt); + debts.Remove(debt); updateTotalDebts(); } Modified: branches/FreeTrainSDL/core/World/Cube.cs =================================================================== --- branches/FreeTrainSDL/core/World/Cube.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Cube.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -288,12 +288,12 @@ for (int z = corner.z; z < mz; z++) { Voxel v = WorldDefinition.World[x, y, z]; - if (v != null) r.add(v.Entity); + if (v != null) r.Add(v.Entity); } } } - return (IEntity[])r.toArray(typeof(IEntity)); + return (IEntity[])r.ToArray(typeof(IEntity)); } /// <summary> Modified: branches/FreeTrainSDL/core/World/Development/ULV.cs =================================================================== --- branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Development/ULV.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -94,9 +94,9 @@ if (e.isOwned) // cannot reclaim this voxel. return null; - if (!s.contains(e)) + if (!s.Contains(e)) { // new entity - s.add(e); + s.Add(e); entityValue += e.EntityValue; } } Modified: branches/FreeTrainSDL/core/World/Rail/Platform.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Rail/Platform.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -118,9 +118,9 @@ // notify nodes that this host is going to be destroyed. // we need to copy it into array because nodes will be updated // as we notify children - foreach (Platform p in nodes.toArray(typeof(Platform))) + foreach (Platform p in nodes.ToArray(typeof(Platform))) p.onHostDisconnected(); - Debug.Assert(nodes.isEmpty); + Debug.Assert(nodes.IsEmpty); // see if we can add to the new host. if (value != null && value.hostStation != null) @@ -242,10 +242,10 @@ for (int x = loc1.x; x <= loc2.x; x++) { Station st = Station.get(x, y, z); - if (st != null) result.add(st); + if (st != null) result.Add(st); Platform pt = Platform.get(x, y, z); if (pt != null && pt != this && pt.hostStation != null) - result.add(pt); + result.Add(pt); } } } @@ -257,15 +257,15 @@ for (int z = 0; z < WorldDefinition.World.Size.z; z++) { Station st = Station.get(loc.x, loc.y, z); - if (st != null) result.add(st); + if (st != null) result.Add(st); Platform pt = Platform.get(loc.x, loc.y, z); if (pt != null && pt != this && pt.hostStation != null) - result.add(pt); + result.Add(pt); } } - return (IPlatformHost[])result.toArray(typeof(IPlatformHost)); + return (IPlatformHost[])result.ToArray(typeof(IPlatformHost)); } /// <summary> /// @@ -273,7 +273,7 @@ /// <param name="child"></param> public void addNode(Platform child) { - nodes.add(child); + nodes.Add(child); } /// <summary> /// @@ -281,7 +281,7 @@ /// <param name="child"></param> public void removeNode(Platform child) { - nodes.remove(child); + nodes.Remove(child); } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Rail/Station.cs =================================================================== --- branches/FreeTrainSDL/core/World/Rail/Station.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Rail/Station.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -146,9 +146,9 @@ // notify nodes that this host is going to be destroyed. // we need to copy it into array because nodes will be updated // as we notify children - foreach (Platform p in nodes.toArray(typeof(Platform))) + foreach (Platform p in nodes.ToArray(typeof(Platform))) p.onHostDisconnected(); - Debug.Assert(nodes.isEmpty); + Debug.Assert(nodes.IsEmpty); base.remove(); } @@ -175,7 +175,7 @@ /// <param name="child"></param> public void addNode(Platform child) { - nodes.add(child); + nodes.Add(child); } /// <summary> /// @@ -183,7 +183,7 @@ /// <param name="child"></param> public void removeNode(Platform child) { - nodes.remove(child); + nodes.Remove(child); } /// <summary> /// @@ -227,7 +227,7 @@ /// <param name="listener"></param> public void add(IStationListener listener) { - core.add(listener); + core.Add(listener); } /// <summary> /// @@ -235,7 +235,7 @@ /// <param name="listener"></param> public void remove(IStationListener listener) { - core.remove(listener); + core.Remove(listener); } /// <summary> /// Modified: branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryMarket.cs =================================================================== --- branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryMarket.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/core/World/Subsidiaries/SubsidiaryMarket.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -122,7 +122,7 @@ { get { - return (SubsidiaryCompany[])onSale.toArray(typeof(SubsidiaryCompany)); + return (SubsidiaryCompany[])onSale.ToArray(typeof(SubsidiaryCompany)); } } @@ -131,7 +131,7 @@ /// </summary> internal void add(SubsidiaryCompany company) { - onSale.add(company); + onSale.Add(company); if (persistentEvents.onAdded != null) persistentEvents.onAdded(this, company); if (volatileEvents.onAdded != null) @@ -143,7 +143,7 @@ /// </summary> internal void remove(SubsidiaryCompany company) { - onSale.remove(company); + onSale.Remove(company); if (persistentEvents.onRemoved != null) persistentEvents.onRemoved(this, company); if (volatileEvents.onRemoved != null) @@ -155,7 +155,7 @@ /// </summary> internal bool contains(SubsidiaryCompany company) { - return onSale.contains(company); + return onSale.Contains(company); } } } Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerForm.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -107,7 +107,7 @@ this.typeBox.Size = new System.Drawing.Size(197, 21); this.typeBox.Sorted = true; this.typeBox.TabIndex = 2; - this.typeBox.SelectedIndexChanged += new System.EventHandler(this.onTypeChanged); + this.typeBox.SelectedIndexChanged += new System.EventHandler(this.OnTypeChanged); // // preview // @@ -141,7 +141,7 @@ this.buttonRemove.TabIndex = 9; this.buttonRemove.Text = "Remove"; this.buttonRemove.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.buttonRemove.CheckedChanged += new System.EventHandler(this.onTypeChanged); + this.buttonRemove.CheckedChanged += new System.EventHandler(this.OnTypeChanged); // // buttonPlace // @@ -154,7 +154,7 @@ this.buttonPlace.TabStop = true; this.buttonPlace.Text = "Build"; this.buttonPlace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.buttonPlace.CheckedChanged += new System.EventHandler(this.onTypeChanged); + this.buttonPlace.CheckedChanged += new System.EventHandler(this.OnTypeChanged); // // indexSelector // @@ -177,7 +177,7 @@ this.Controls.Add(this.preview); this.Name = "ControllerForm"; this.Text = "Road Accessories"; - this.Resize += new System.EventHandler(this.updateAfterResize); + this.Resize += new System.EventHandler(this.UpdateAfterResize); ((System.ComponentModel.ISupportInitialize)(this.preview)).EndInit(); this.ResumeLayout(false); @@ -187,7 +187,7 @@ /// <summary> /// /// </summary> - protected bool isPlacing + protected bool IsPlacing { get { @@ -200,7 +200,7 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected virtual void updateAfterResize(object sender, System.EventArgs e) + protected virtual void UpdateAfterResize(object sender, System.EventArgs e) { this.buttonPlace.Left = this.preview.Left; this.buttonPlace.Width = ((this.preview.Width)) / 2; @@ -214,7 +214,7 @@ /// <summary> /// Called when a selection of the structure has changed. /// </summary> - protected virtual void onTypeChanged(object sender, System.EventArgs e) + protected virtual void OnTypeChanged(object sender, System.EventArgs e) { RoadAccessoryContribution builder = (RoadAccessoryContribution)typeBox.SelectedItem; if (builder != null) Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -74,7 +74,7 @@ else { if( contribution.CanBeBuilt(loc) ) - contribution.create(loc); + contribution.Create(loc); else MessageBox.Show("Cannot place"); Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -44,12 +44,12 @@ { MenuItem item = new MenuItem("&Accessories..."); - item.Click += new System.EventHandler(onClick); + item.Click += new System.EventHandler(OnClick); containerMenu.MenuItems[3].MenuItems.Add(item); } - private void onClick(object sender, EventArgs e) + private void OnClick(object sender, EventArgs e) { new ControllerForm().Show(); } Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -116,7 +116,7 @@ /// Create a new road accessory at the specified location. /// </summary> /// <param name="loc"></param> - public void create(Location loc) + public void Create(Location loc) { Debug.Assert(CanBeBuilt(loc)); Modified: branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs =================================================================== --- branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseBuilder.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -130,10 +130,10 @@ { private readonly VinylHouseBuilder contrib; - public Logic(VinylHouseBuilder _contrib, IControllerSite site) + public Logic(VinylHouseBuilder contrib, IControllerSite site) : base(site) { - this.contrib = _contrib; + this.contrib = contrib; } /// <summary> Modified: branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs =================================================================== --- branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs 2008-04-14 16:43:06 UTC (rev 363) +++ branches/FreeTrainSDL/plugins/Kohsuke.VinylHouse/VinylHouseVoxel.cs 2008-04-14 18:05:11 UTC (rev 364) @@ -65,7 +65,6 @@ stationListener.OnRemoved(); } - private readonly StationListenerImpl stationListener; private readonly VinylHouseBuilder contrib; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <je...@us...> - 2008-04-15 23:01:01
|
Revision: 365 http://freetrain.svn.sourceforge.net/freetrain/?rev=365&view=rev Author: jendave Date: 2008-04-15 16:00:53 -0700 (Tue, 15 Apr 2008) Log Message: ----------- some refactoring. update SdlDotNet Modified Paths: -------------- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Structs/FixedSizeStructController.cs branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs branches/FreeTrainSDL/lib/Controls/MruMenuInline.cs branches/FreeTrainSDL/lib/SdlDotNet.dll branches/FreeTrainSDL/lib/SdlDotNet.xml branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ContributionReference.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/MenuContributionImpl.cs branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/SpriteSet.cs Modified: branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/AbstractLineController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -186,14 +186,14 @@ /// <summary> /// The first location selected by the user. /// </summary> - private Location anchor = UNPLACED; + private Location anchor = Unplaced; /// <summary> /// Current mouse position. Used only when anchor!=UNPLACED /// </summary> - private Location currentPos = UNPLACED; + private Location currentPos = Unplaced; - private static Location UNPLACED = FreeTrain.World.Location.Unplaced; + private static Location Unplaced = FreeTrain.World.Location.Unplaced; /// <summary> /// Aligns the given location to the anchor so that @@ -210,7 +210,7 @@ return loc.align8To(anchor); Debug.Assert(false); - return UNPLACED; + return Unplaced; } /// <summary> @@ -221,9 +221,9 @@ /// <param name="ab"></param> public override void OnMouseMove(MapViewWindow view, Location loc, Point ab) { - if (anchor != UNPLACED && isPlacing && currentPos != loc) + if (anchor != Unplaced && isPlacing && currentPos != loc) { - if (currentPos != UNPLACED) + if (currentPos != Unplaced) WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); currentPos = align(loc); WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); @@ -238,7 +238,7 @@ /// <param name="ab"></param> public override void OnClick(MapViewWindow source, Location loc, Point ab) { - if (anchor == UNPLACED) + if (anchor == Unplaced) { anchor = loc; sameLevelDisambiguator = new SameLevelDisambiguator(anchor.z); @@ -259,7 +259,7 @@ Type.Remove(anchor, loc); WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, loc)); } - anchor = UNPLACED; + anchor = Unplaced; } } @@ -271,14 +271,14 @@ /// <param name="ab"></param> public override void OnRightClick(MapViewWindow source, Location loc, Point ab) { - if (anchor == UNPLACED) + if (anchor == Unplaced) Close(); // cancel else { // cancel the anchor - if (currentPos != UNPLACED) + if (currentPos != Unplaced) WorldDefinition.World.OnVoxelUpdated(Cube.CreateInclusive(anchor, currentPos)); - anchor = UNPLACED; + anchor = Unplaced; } } @@ -290,7 +290,7 @@ get { // the 2nd selection must go to the same height as the anchor. - if (anchor == UNPLACED) return RailRoadDisambiguator.theInstance; + if (anchor == Unplaced) return RailRoadDisambiguator.theInstance; else return sameLevelDisambiguator; } } @@ -299,7 +299,7 @@ private void modeChanged(object sender, EventArgs e) { - anchor = UNPLACED; + anchor = Unplaced; } /// <summary> @@ -335,7 +335,7 @@ /// <param name="canvas"></param> public void DrawBefore(QuarterViewDrawer view, DrawContext canvas) { - if (anchor != UNPLACED && isPlacing) + if (anchor != Unplaced && isPlacing) canvas.Tag = Type.CanBeBuilt(anchor, currentPos); } Modified: branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Rail/StationaryStructPlacementController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -63,7 +63,7 @@ /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) { - if (isPlacing) + if (IsPlacing) { // structures can be placed only on the ground return GroundDisambiguator.theInstance.IsSelectable(loc); @@ -78,7 +78,7 @@ /// </summary> /// <param name="view"></param> /// <param name="loc"></param> - public override void remove(MapViewWindow view, Location loc) + public override void Remove(MapViewWindow view, Location loc) { RailStationaryStructure s = RailStationaryStructure.get(loc); if (s != null) Modified: branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Road/RoadController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -151,7 +151,7 @@ this.Controls.Add(this.description); this.Controls.Add(this.level); this.Controls.Add(this.contribTree); - this.Resize += new EventHandler(this.updateSize); + this.Resize += new EventHandler(this.UpdateSize); this.Text = "Road construction"; //! this.Text = "道路工事"; this.ResumeLayout(false); @@ -171,7 +171,7 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected virtual void updateSize(object sender, System.EventArgs e) + protected virtual void UpdateSize(object sender, System.EventArgs e) { this.contribTree.Width = (this.Width - 5) / 2; this.description.Width = this.contribTree.Width - 10; Modified: branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Structs/CommercialStructPlacementController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -33,36 +33,12 @@ /// </summary> public class CommercialStructPlacementController : FixedSizeStructController { - #region Singleton instance management - /// <summary> - /// Creates a new controller window, or active the existing one. - /// </summary> - public static void create() - { - if (theInstance == null) - theInstance = new CommercialStructPlacementController(); - theInstance.Show(); - theInstance.Activate(); - } - - private static CommercialStructPlacementController theInstance; - /// <summary> - /// - /// </summary> - /// <param name="e"></param> - protected override void OnClosing(System.ComponentModel.CancelEventArgs e) - { - base.OnClosing(e); - theInstance = null; - } - #endregion - private CommercialStructPlacementController() : base(PluginManager.CommercialStructureGroup) { } /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) { - if (isPlacing) + if (IsPlacing) { // structures can be placed only on the ground return GroundDisambiguator.theInstance.IsSelectable(loc); @@ -76,7 +52,7 @@ /// <summary> /// Removes the structure from given location, if any. /// </summary> - public override void remove(MapViewWindow view, Location loc) + public override void Remove(MapViewWindow view, Location loc) { Commercial c = Commercial.get(loc); if (c != null) Modified: branches/FreeTrainSDL/core/Controllers/Structs/FixedSizeStructController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/FixedSizeStructController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Structs/FixedSizeStructController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -43,24 +43,27 @@ /// </summary> /// <param name="groupGroup"></param> protected FixedSizeStructController(StructureGroupGroup groupGroup) : base(groupGroup) { } + /// <summary> /// /// </summary> /// <param name="view"></param> /// <param name="loc"></param> - public abstract void remove(MapViewWindow view, Location loc); + public abstract void Remove(MapViewWindow view, Location loc); + // TODO: extend StructureContribution and Structure so that // the this method can be implemented here. /// <summary> /// /// </summary> - protected new FixedSizeStructureContribution selectedType + protected new FixedSizeStructureContribution SelectedType { get { - return (FixedSizeStructureContribution)base.selectedType; + return (FixedSizeStructureContribution)base.SelectedType; } } + /// <summary> /// /// </summary> @@ -69,22 +72,22 @@ /// <param name="ab"></param> public override void OnClick(MapViewWindow view, Location loc, Point ab) { - if (isPlacing) + if (IsPlacing) { - if (!selectedType.CanBeBuilt(loc, ControlMode.Player)) + if (!SelectedType.CanBeBuilt(loc, ControlMode.Player)) { MessageBox.Show("Can not build"); //! MessageBox.Show("設置できません"); } else { - CompletionHandler handler = new CompletionHandler(selectedType, loc, true); - new ConstructionSite(loc, new EventHandler(handler.handle), selectedType.Size); + CompletionHandler handler = new CompletionHandler(SelectedType, loc, true); + new ConstructionSite(loc, new EventHandler(handler.Handle), SelectedType.Size); } } else { - remove(view, loc); + Remove(view, loc); } } @@ -100,12 +103,13 @@ private readonly FixedSizeStructureContribution contribution; private readonly Location loc; private readonly bool owned; + /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> - public void handle(object sender, EventArgs args) + public void Handle(object sender, EventArgs args) { Structure s = contribution.Create(loc, owned); } @@ -115,9 +119,9 @@ /// /// </summary> /// <returns></returns> - protected override AlphaBlendSpriteSet createAlphaSprites() + protected override AlphaBlendSpriteSet CreateAlphaSprites() { - if (selectedType != null) return new AlphaBlendSpriteSet(selectedType.Sprites); + if (SelectedType != null) return new AlphaBlendSpriteSet(SelectedType.Sprites); else return null; } } Modified: branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Structs/StructPlacementController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -57,6 +57,7 @@ private FreeTrain.Controls.IndexSelector indexSelector; private Bitmap previewBitmap; + /// <summary> /// /// </summary> @@ -69,8 +70,9 @@ // load station type list structType.DataSource = groupGroup; structType.DisplayMember = "name"; - updateAfterResize(null, null); + UpdateAfterResize(null, null); } + /// <summary> /// /// </summary> @@ -88,10 +90,12 @@ if (alphaSprites != null) alphaSprites.Dispose(); } + /// <summary> /// /// </summary> public override ILocationDisambiguator Disambiguator { get { return this; } } + /// <summary> /// /// </summary> @@ -124,7 +128,7 @@ this.structType.Size = new System.Drawing.Size(130, 21); this.structType.Sorted = true; this.structType.TabIndex = 2; - this.structType.SelectedIndexChanged += new System.EventHandler(this.onGroupChanged); + this.structType.SelectedIndexChanged += new System.EventHandler(this.OnGroupChanged); // // preview // @@ -175,7 +179,7 @@ this.indexSelector.Name = "indexSelector"; this.indexSelector.Size = new System.Drawing.Size(130, 22); this.indexSelector.TabIndex = 3; - this.indexSelector.indexChanged += new System.EventHandler(this.onTypeChanged); + this.indexSelector.indexChanged += new System.EventHandler(this.OnTypeChanged); // // StructPlacementController // @@ -190,17 +194,18 @@ this.Name = "StructPlacementController"; this.Text = "Building construction"; //! this.Text = "建物の工事(仮)"; - this.Resize += new System.EventHandler(this.updateAfterResize); + this.Resize += new System.EventHandler(this.UpdateAfterResize); ((System.ComponentModel.ISupportInitialize)(this.preview)).EndInit(); this.ResumeLayout(false); } #endregion + /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected virtual void updateAfterResize(object sender, System.EventArgs e) + protected virtual void UpdateAfterResize(object sender, System.EventArgs e) { this.buttonPlace.Width = ((this.preview.Left + this.preview.Width) - this.buttonPlace.Left - 5) / 2; this.buttonRemove.Left = (this.buttonPlace.Left + this.buttonPlace.Width) + 10; @@ -208,15 +213,13 @@ UpdatePreview(); } - /// <summary> /// /// </summary> - protected bool isPlacing { get { return buttonPlace.Checked; } } + protected bool IsPlacing { get { return buttonPlace.Checked; } } + private Location baseLoc = World.Location.Unplaced; - - private Location baseLoc = World.Location.Unplaced; /// <summary> /// /// </summary> @@ -242,6 +245,7 @@ /// <param name="view"></param> /// <param name="surface"></param> public void DrawBefore(QuarterViewDrawer view, DrawContext surface) { } + /// <summary> /// /// </summary> @@ -251,13 +255,14 @@ /// <param name="pt"></param> public void DrawVoxel(QuarterViewDrawer view, DrawContext canvas, Location loc, Point pt) { - if (!isPlacing) return; + if (!IsPlacing) return; if (alphaSprites != null) { if (Cube.CreateExclusive(baseLoc, alphaSprites.size).Contains(loc)) alphaSprites.getSprite(loc - baseLoc).DrawAlpha(canvas.Surface, pt); } } + /// <summary> /// /// </summary> @@ -265,17 +270,17 @@ /// <param name="surface"></param> public void DrawAfter(QuarterViewDrawer view, DrawContext surface) { } - /// <summary> /// Currently selected structure contribution. /// </summary> - protected StructureContribution selectedType + protected virtual StructureContribution SelectedType { get { return (StructureContribution)indexSelector.currentItem; } } + /// <summary> /// /// </summary> @@ -283,7 +288,7 @@ protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); - updateAlphaSprites(); + UpdateAlphaSprites(); } private AlphaBlendSpriteSet alphaSprites; @@ -291,35 +296,35 @@ /// <summary> /// Re-builds an alpha-blending preview. /// </summary> - protected void updateAlphaSprites() + protected void UpdateAlphaSprites() { if (alphaSprites != null) alphaSprites.Dispose(); // builds a new alpha blended preview - alphaSprites = createAlphaSprites(); + alphaSprites = CreateAlphaSprites(); } /// <summary> /// Implemented by the derived class to provide a sprite set used /// to draw a preview of this structure on MapView. /// </summary> - protected abstract AlphaBlendSpriteSet createAlphaSprites(); + protected abstract AlphaBlendSpriteSet CreateAlphaSprites(); - private void onGroupChanged(object sender, System.EventArgs e) + private void OnGroupChanged(object sender, System.EventArgs e) { indexSelector.dataSource = (StructureGroup)structType.SelectedItem; - onTypeChanged(null, null); + OnTypeChanged(null, null); } - /// <summary> /// Called when a selection of the structure has changed. /// </summary> - protected virtual void onTypeChanged(object sender, System.EventArgs e) + protected virtual void OnTypeChanged(object sender, System.EventArgs e) { UpdatePreview(); } + /// <summary> /// /// </summary> @@ -331,7 +336,7 @@ preview.Image = previewBitmap = drawer.createBitmap(); }*/ - if (selectedType != null) updateAlphaSprites(); + if (SelectedType != null) UpdateAlphaSprites(); } } } Modified: branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs =================================================================== --- branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/core/Controllers/Structs/VarHeightBuildingController.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -71,7 +71,7 @@ /// <param name="ab"></param> public override void OnClick(MapViewWindow view, Location loc, Point ab) { - if (isPlacing) + if (IsPlacing) { if (!selectedType.CanBeBuilt(loc, height)) { @@ -96,7 +96,7 @@ /// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) { - if (isPlacing) + if (IsPlacing) { // structures can be placed only on the ground return GroundDisambiguator.theInstance.IsSelectable(loc); @@ -133,7 +133,7 @@ { get { - return (VarHeightBuildingContribution)base.selectedType; + return (VarHeightBuildingContribution)base.SelectedType; } } private int height @@ -148,7 +148,7 @@ /// <summary> /// Re-builds an alpha-blending preview. /// </summary> - protected override AlphaBlendSpriteSet createAlphaSprites() + protected override AlphaBlendSpriteSet CreateAlphaSprites() { // builds a new alpha blended preview @@ -171,7 +171,7 @@ private void heightBox_ValueChanged(object sender, System.EventArgs e) { - updateAlphaSprites(); + UpdateAlphaSprites(); UpdatePreview(); } @@ -180,9 +180,9 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - protected override void onTypeChanged(object sender, System.EventArgs e) + protected override void OnTypeChanged(object sender, System.EventArgs e) { - base.onTypeChanged(sender, e); + base.OnTypeChanged(sender, e); if (heightBox == null) return; // during initialization // update the min/max of the height Modified: branches/FreeTrainSDL/lib/Controls/MruMenuInline.cs =================================================================== --- branches/FreeTrainSDL/lib/Controls/MruMenuInline.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/lib/Controls/MruMenuInline.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -38,8 +38,17 @@ /// <summary> /// /// </summary> - protected MenuItem firstMenuItem; + private MenuItem firstMenuItem; + /// <summary> + /// + /// </summary> + protected MenuItem FirstMenuItem + { + get { return firstMenuItem; } + set { firstMenuItem = value; } + } + #region Construction /// <summary> @@ -109,16 +118,16 @@ /// <summary> /// /// </summary> - /// <param name="_recentFileMenuItem"></param> - /// <param name="_clickedHandler"></param> - /// <param name="_registryKeyName"></param> + /// <param name="recentFileMenuItem"></param> + /// <param name="clickedHandler"></param> + /// <param name="registryKeyName"></param> /// <param name="loadFromRegistry"></param> - /// <param name="_maxEntries"></param> - public MruMenuInline(MenuItem _recentFileMenuItem, ClickHandler _clickedHandler, String _registryKeyName, bool loadFromRegistry, int _maxEntries) - : base(_recentFileMenuItem, _clickedHandler, _registryKeyName, loadFromRegistry, _maxEntries) + /// <param name="maxEntries"></param> + public MruMenuInline(MenuItem recentFileMenuItem, ClickHandler clickedHandler, String registryKeyName, bool loadFromRegistry, int maxEntries) + : base(recentFileMenuItem, clickedHandler, registryKeyName, loadFromRegistry, maxEntries) { MaxShortenPathLength = 128; - firstMenuItem = _recentFileMenuItem; + this.firstMenuItem = recentFileMenuItem; } #endregion Modified: branches/FreeTrainSDL/lib/SdlDotNet.dll =================================================================== (Binary files differ) Modified: branches/FreeTrainSDL/lib/SdlDotNet.xml =================================================================== --- branches/FreeTrainSDL/lib/SdlDotNet.xml 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/lib/SdlDotNet.xml 2008-04-15 23:00:53 UTC (rev 365) @@ -7402,26 +7402,6 @@ Equivalent to SDL_SRCALPHA </summary> </member> - <member name="T:SdlDotNet.Graphics.ColorMask"> - <summary> - Color mask. - </summary> - </member> - <member name="F:SdlDotNet.Graphics.ColorMask.R"> - <summary> - - </summary> - </member> - <member name="F:SdlDotNet.Graphics.ColorMask.G"> - <summary> - - </summary> - </member> - <member name="F:SdlDotNet.Graphics.ColorMask.B"> - <summary> - - </summary> - </member> <member name="T:SdlDotNet.Graphics.Surface"> <summary> Represents an Sdl drawing surface. @@ -7863,30 +7843,6 @@ </summary> <param name="file">The filename to save to</param> </member> - <member name="M:SdlDotNet.Graphics.Surface.BlitAlpha(System.Drawing.Point,SdlDotNet.Graphics.Surface,System.Drawing.Point,System.Drawing.Size)"> - <summary> - - </summary> - <param name="dstPos"></param> - <param name="source"></param> - <param name="srcPos"></param> - <param name="sz"></param> - </member> - <member name="M:SdlDotNet.Graphics.Surface.HitTest(System.Drawing.Point)"> - <summary> - - </summary> - <param name="p"></param> - <returns></returns> - </member> - <member name="M:SdlDotNet.Graphics.Surface.HitTest(System.Int32,System.Int32)"> - <summary> - - </summary> - <param name="x"></param> - <param name="y"></param> - <returns></returns> - </member> <member name="M:SdlDotNet.Graphics.Surface.Draw(System.Drawing.Point,System.Int32)"> <summary> Draws a pixel to this surface using the color value to speed things up - uses 1,2 or 4 BytesPerPixel modes. @@ -8176,7 +8132,7 @@ </member> <member name="P:SdlDotNet.Graphics.Surface.SourceColorKey"> <summary> - Source color key. A mask color that will not be copied to other plains. + Source color key. A mask color that will not be copied to other Surfaces. </summary> </member> <member name="P:SdlDotNet.Graphics.Surface.ClipRectangle"> Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/ControllerImpl.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -40,7 +40,6 @@ get { return remove; } } - /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/MenuContributionImpl.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -36,6 +36,7 @@ /// </summary> /// <param name="e"></param> public MenuContributionImpl(XmlElement e) : base(e) { } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessory.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -32,6 +32,7 @@ { private readonly byte index; private readonly RoadAccessoryContribution contrib; + /// <summary> /// /// </summary> @@ -44,6 +45,7 @@ this.contrib = contrib; target.accessory = this; } + /// <summary> /// /// </summary> @@ -53,6 +55,7 @@ { contrib.sprites[index, 0].Draw(display.Surface, pt); } + /// <summary> /// /// </summary> @@ -62,6 +65,7 @@ { contrib.sprites[index, 1].Draw(display.Surface, pt); } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.RoadAccessory/RoadAccessoryContribution.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -62,6 +62,7 @@ /// y=1 if a sprite is in front of a train /// </summary> internal readonly ISprite[,] sprites = new ISprite[2, 2]; + /// <summary> /// /// </summary> @@ -78,6 +79,7 @@ } return drawer; } + /// <summary> /// /// </summary> @@ -87,6 +89,7 @@ { return new ControllerImpl(this, site, false); } + /// <summary> /// /// </summary> @@ -96,6 +99,7 @@ { return new ControllerImpl(this, site, true); } + /// <summary> /// /// </summary> Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ContributionReference.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ContributionReference.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/ContributionReference.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -88,7 +88,7 @@ this.hilightIdx = hilight; this.placeSide = side; this.frontface = front; - this.patternIdx = SpriteSet.getIndexOf(front, side); + this.patternIdx = SpriteSet.GetIndexOf(front, side); } /// <summary> /// Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/MenuContributionImpl.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/MenuContributionImpl.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/MenuContributionImpl.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -45,12 +45,12 @@ public override void MergeMenu(MainMenu containerMenu) { MenuItem item = new MenuItem("&Half-tile Construction..."); - item.Click += new System.EventHandler(onClick); + item.Click += new System.EventHandler(OnClick); containerMenu.MenuItems[4].MenuItems.Add(item); } - private void onClick(object sender, EventArgs e) + private void OnClick(object sender, EventArgs e) { new ControllerForm().Show(); } Modified: branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/SpriteSet.cs =================================================================== --- branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/SpriteSet.cs 2008-04-14 18:05:11 UTC (rev 364) +++ branches/FreeTrainSDL/plugins/Chiname.Structure.HalfVoxel/SpriteSet.cs 2008-04-15 23:00:53 UTC (rev 365) @@ -60,7 +60,7 @@ { } - static internal int getIndexOf(Direction d, PlaceSide s) + static internal int GetIndexOf(Direction d, PlaceSide s) { return d.index / 2 + (int)s * 4; } @@ -69,6 +69,7 @@ { get { return sprites[idx]; } } + /// <summary> /// /// </summary> @@ -79,11 +80,11 @@ { get { - return sprites[getIndexOf(d, s)]; + return sprites[GetIndexOf(d, s)]; } set { - sprites[getIndexOf(d, s)] = value; + sprites[GetIndexOf(d, s)] = value; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |