lowered size of generated image ( in linux the application crashed for bigger scenarios ) added warning if "setups" directory is missing ( otherwise application would crash )winforms
| GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
| SolutionGuid = {EF974075-C6B0-4BEA-B005-A1DA861E2655} | SolutionGuid = {EF974075-C6B0-4BEA-B005-A1DA861E2655} | ||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(MonoDevelopProperties) = preSolution | |||||
| Policies = $0 | |||||
| $0.DotNetNamingPolicy = $1 | |||||
| $1.DirectoryNamespaceAssociation = PrefixedHierarchical | |||||
| $0.TextStylePolicy = $2 | |||||
| $2.inheritsSet = null | |||||
| $2.scope = text/x-csharp | |||||
| $0.CSharpFormattingPolicy = $3 | |||||
| $3.SpaceWithinMethodDeclarationParenthesis = True | |||||
| $3.SpaceWithinMethodCallParentheses = True | |||||
| $3.SpaceWithinExpressionParentheses = True | |||||
| $3.SpaceWithinCastParentheses = True | |||||
| $3.SpaceWithinOtherParentheses = True | |||||
| $3.SpaceAfterCast = True | |||||
| $3.SpaceWithinSquareBrackets = True | |||||
| $3.scope = text/x-csharp | |||||
| $0.TextStylePolicy = $4 | |||||
| $4.FileWidth = 80 | |||||
| $4.TabsToSpaces = True | |||||
| $4.scope = text/plain | |||||
| $0.StandardHeader = $5 | |||||
| EndGlobalSection | |||||
| EndGlobal | EndGlobal |
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
| <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||||
| <PropertyGroup> | <PropertyGroup> | ||||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||||
| <Deterministic>true</Deterministic> | <Deterministic>true</Deterministic> | ||||
| </PropertyGroup> | </PropertyGroup> | ||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| <DebugSymbols>true</DebugSymbols> | <DebugSymbols>true</DebugSymbols> | ||||
| <DebugType>full</DebugType> | <DebugType>full</DebugType> | ||||
| <Optimize>false</Optimize> | <Optimize>false</Optimize> | ||||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | <DefineConstants>DEBUG;TRACE</DefineConstants> | ||||
| <ErrorReport>prompt</ErrorReport> | <ErrorReport>prompt</ErrorReport> | ||||
| <WarningLevel>4</WarningLevel> | <WarningLevel>4</WarningLevel> | ||||
| <LangVersion>Default</LangVersion> | |||||
| <NoStdLib>false</NoStdLib> | |||||
| <LangVersion>7.3</LangVersion> | |||||
| </PropertyGroup> | </PropertyGroup> | ||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||||
| <PlatformTarget>AnyCPU</PlatformTarget> | <PlatformTarget>AnyCPU</PlatformTarget> | ||||
| <DefineConstants>TRACE</DefineConstants> | <DefineConstants>TRACE</DefineConstants> | ||||
| <ErrorReport>prompt</ErrorReport> | <ErrorReport>prompt</ErrorReport> | ||||
| <WarningLevel>4</WarningLevel> | <WarningLevel>4</WarningLevel> | ||||
| <LangVersion>7.3</LangVersion> | |||||
| </PropertyGroup> | </PropertyGroup> | ||||
| <PropertyGroup> | <PropertyGroup> | ||||
| <StartupObject /> | <StartupObject /> |
| using System; | using System; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Globalization; | |||||
| using System.IO; | using System.IO; | ||||
| using System.Linq; | using System.Linq; | ||||
| using System.Text; | using System.Text; | ||||
| char type = matchedGroyne.Groups[ "type" ].Value.FirstOrDefault(); | char type = matchedGroyne.Groups[ "type" ].Value.FirstOrDefault(); | ||||
| // Forcing a multiple of 70 by using '/ 70 * 70' | // Forcing a multiple of 70 by using '/ 70 * 70' | ||||
| int level = int.Parse( matchedGroyne.Groups[ "level" ].Value ) / 70 * 70; | int level = int.Parse( matchedGroyne.Groups[ "level" ].Value ) / 70 * 70; | ||||
| double yCoord = double.Parse( matchedGroyne.Groups[ "yCoord" ].Value.Replace( ",", "" ).Replace( ".", "," ) ); | |||||
| double yCoord = double.Parse( matchedGroyne.Groups[ "yCoord" ].Value, CultureInfo.InvariantCulture ); | |||||
| if ( !this.Groynes.ContainsKey( level ) ) this.Groynes.Add( level, new List<Groyne>() ); | if ( !this.Groynes.ContainsKey( level ) ) this.Groynes.Add( level, new List<Groyne>() ); | ||||
| this.Groynes[ level ].Add( new Groyne( yCoord, type ) ); | this.Groynes[ level ].Add( new Groyne( yCoord, type ) ); | ||||
| } | } |
| { | { | ||||
| TimedGroyne safePath = field.getFastestSafeRoute( Dog.MAX, Dog.MINNIE, out var hunterMap, out var huntedMap ); | TimedGroyne safePath = field.getFastestSafeRoute( Dog.MAX, Dog.MINNIE, out var hunterMap, out var huntedMap ); | ||||
| float borderWidth = 7.5F; | |||||
| int boxRadius = 25; | |||||
| Size imagePadding = new Size( 10, 10 ); | |||||
| float borderWidth = 3.75F; | |||||
| int boxRadius = 12; | |||||
| Size imagePadding = new Size( 5, 5 ); | |||||
| Size imageSize = new Size( imagePadding.Width, imagePadding.Height ); | Size imageSize = new Size( imagePadding.Width, imagePadding.Height ); | ||||
| Font font = new Font( "Consolas", 30F ); | |||||
| Font nameFont = new Font( "Consolas", 50F ); | |||||
| Font font = new Font( "Consolas", 15F ); | |||||
| Font nameFont = new Font( "Consolas", 25F ); | |||||
| Brush hunterBrush = new SolidBrush( Color.DarkRed ); | Brush hunterBrush = new SolidBrush( Color.DarkRed ); | ||||
| Brush hunterFillBrush = new SolidBrush( Color.Red ); | Brush hunterFillBrush = new SolidBrush( Color.Red ); | ||||
| Brush huntedBrush = new SolidBrush( Color.DarkBlue ); | Brush huntedBrush = new SolidBrush( Color.DarkBlue ); | ||||
| Brush huntedFillBrush = new SolidBrush( Color.Cyan ); | Brush huntedFillBrush = new SolidBrush( Color.Cyan ); | ||||
| Brush safePathBrush = new SolidBrush( Color.Gold ); | Brush safePathBrush = new SolidBrush( Color.Gold ); | ||||
| Size boxSpacing = new Size( 700, 50 ); | |||||
| Size boxSize = new Size( 300, 200 ); | |||||
| Size boxSpacing = new Size( 350, 25 ); | |||||
| Size boxSize = new Size( 150, 100 ); | |||||
| int levels = ( ( int ) field.Groynes.Keys.Max() / 70 ) + 1; // + 1 cause 0 is also a level and hasn't been included yet | int levels = ( ( int ) field.Groynes.Keys.Max() / 70 ) + 1; // + 1 cause 0 is also a level and hasn't been included yet | ||||
| imageSize.Width += boxSize.Width * levels; | imageSize.Width += boxSize.Width * levels; |
| /// </summary> | /// </summary> | ||||
| private void Scripter_Load( object sender, EventArgs e ) | private void Scripter_Load( object sender, EventArgs e ) | ||||
| { | { | ||||
| if ( !Directory.Exists( "setups" ) ) | |||||
| { | |||||
| ColorMessageBox.Show( "Es wurden keine Setup-Dateien gefunden, bitte legt erst welche an und startet das Programm dann erneut." ); | |||||
| Application.Exit(); | |||||
| return; | |||||
| } | |||||
| var filenumbers_int = Directory.GetFiles( "setups", "buhnenrennen*.txt" ) | var filenumbers_int = Directory.GetFiles( "setups", "buhnenrennen*.txt" ) | ||||
| .Select( Path.GetFileName ) | .Select( Path.GetFileName ) | ||||
| .Where( file => setupFileRegex.IsMatch( file ) ) | .Where( file => setupFileRegex.IsMatch( file ) ) |