From bad680f65e9547216d20b391e2c242664b3152d6 Mon Sep 17 00:00:00 2001 From: s434678 Date: Wed, 10 Apr 2019 11:53:12 +0200 Subject: [PATCH] x --- Trunk/CzokoŚmieciarka.sln | 8 +- .../CzokoŚmieciarka.WPF/MainWindow.xaml.cs | 10 +- .../Models/GarbageCollectorWPF.cs | 12 +- .../CzokoŚmierciarka.WPF2.0/App.config | 6 + .../CzokoŚmierciarka.WPF2.0/App.xaml | 9 ++ .../CzokoŚmierciarka.WPF2.0/App.xaml.cs | 17 +++ .../CzokoŚmierciarka.WPF2.0.csproj | 98 +++++++++++++++ .../CzokoŚmierciarka.WPF2.0/MainWindow.xaml | 14 +++ .../MainWindow.xaml.cs | 36 ++++++ .../CzokoŚmierciarka.WPF2.0/Models/House.cs | 12 ++ .../Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 71 +++++++++++ .../Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 ++ 15 files changed, 492 insertions(+), 10 deletions(-) create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.config create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/CzokoŚmierciarka.WPF2.0.csproj create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Models/House.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/AssemblyInfo.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.Designer.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.resx create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.Designer.cs create mode 100644 Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.settings diff --git a/Trunk/CzokoŚmieciarka.sln b/Trunk/CzokoŚmieciarka.sln index abbf3b7..1025652 100644 --- a/Trunk/CzokoŚmieciarka.sln +++ b/Trunk/CzokoŚmieciarka.sln @@ -9,7 +9,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.DataModels EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPF", "Interface\CzokoŚmieciarka.WPF\CzokoŚmieciarka.WPF.csproj", "{06937DFB-242D-46BD-9A4B-486D156B62A9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Czoko_Smieciarka.AI_Naive", "Czoko_Smieciarka.AI_Naive\Czoko_Smieciarka.AI_Naive.csproj", "{A1F1D99A-4E5B-4389-B776-321D8A5976EE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Czoko_Smieciarka.AI_Naive", "Czoko_Smieciarka.AI_Naive\Czoko_Smieciarka.AI_Naive.csproj", "{A1F1D99A-4E5B-4389-B776-321D8A5976EE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmierciarka.WPF2.0", "Interface\CzokoŚmierciarka.WPF2.0\CzokoŚmierciarka.WPF2.0.csproj", "{6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -33,6 +35,10 @@ Global {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Release|Any CPU.Build.0 = Release|Any CPU + {6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs index 0e867bc..06dba2c 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs @@ -32,7 +32,7 @@ namespace CzokoŚmieciarka.WPF //public Board board; private static int rows = 9; private static int columns = 9; - private GarbageCollectorWPF garbageCollector = new GarbageCollectorWPF(columns, new Coords(0, 0), AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png", new List()); + private GarbageCollectorWPF garbageCollector = new GarbageCollectorWPF(columns, rows, new Coords(0, 0), AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png", new List()); private List Objects = new List(); public MainWindow() { @@ -83,21 +83,21 @@ namespace CzokoŚmieciarka.WPF if (e.Key == Key.Up) { - garbageCollector.Move(columns, Direction.Up); + garbageCollector.Move(Direction.Up); } if (e.Key == Key.Down) { - garbageCollector.Move(columns, Direction.Down); + garbageCollector.Move(Direction.Down); } if (e.Key == Key.Left) { - garbageCollector.Move(columns, Direction.Left); + garbageCollector.Move(Direction.Left); } if (e.Key == Key.Right) { - garbageCollector.Move(columns, Direction.Right); + garbageCollector.Move(Direction.Right); } Board board = new Board(Objects, garbageCollector); board.BoardRefresh(Objects, garbageCollector); diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs index 3e92782..3daf191 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs @@ -23,16 +23,18 @@ namespace CzokoŚmieciarka.WPF.Models public string ImagePath { get; set; } public string Data { get; set; } public ImageBrush Image { get; set; } - public void Move(int columns, Direction direction) + public int _columns { get; set; } + public int _rows { get; set; } + public void Move(Direction direction) { switch (direction) { case (Direction.Up): - Location.Y = Location.Y + (-1 * columns); + Location.Y = Location.Y + (-1 * _columns); Position = this.MoveUp(); break; case (Direction.Down): - Location.Y = Location.Y + (1 * columns); + Location.Y = Location.Y + (1 * _columns); Position = this.MoveDown(); break; case (Direction.Left): @@ -48,8 +50,10 @@ namespace CzokoŚmieciarka.WPF.Models } - public GarbageCollectorWPF(int columns, Coords location, string imagePath, IEnumerable trashContainers) : base(location, trashContainers) + public GarbageCollectorWPF(int columns, int rows, Coords location, string imagePath, IEnumerable trashContainers) : base(location, trashContainers) { + _columns = columns; + _rows = rows; Location = new Coords(location.X, location.Y * columns); ImagePath = imagePath; Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.config b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml new file mode 100644 index 0000000..d4d1f6d --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml.cs new file mode 100644 index 0000000..a84f868 --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace CzokoŚmierciarka.WPF2._0 +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/CzokoŚmierciarka.WPF2.0.csproj b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/CzokoŚmierciarka.WPF2.0.csproj new file mode 100644 index 0000000..74bae35 --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/CzokoŚmierciarka.WPF2.0.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {6EE3CBC0-CD10-41D8-9282-FF91DCFB9D67} + WinExe + CzokoŚmierciarka.WPF2._0 + CzokoŚmierciarka.WPF2.0 + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml new file mode 100644 index 0000000..449d76f --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml.cs new file mode 100644 index 0000000..d87befe --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/MainWindow.xaml.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace CzokoŚmierciarka.WPF2._0 +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + for(int i = 0; i < 10; i++) + { + ColumnDefinition column = new ColumnDefinition(); + RowDefinition row = new RowDefinition(); + Board.ColumnDefinitions.Add(column); + Board.RowDefinitions.Add(row); + } + Board.Set + } + } +} diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Models/House.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Models/House.cs new file mode 100644 index 0000000..b0e0cab --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Models/House.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CzokoŚmierciarka.WPF2._0.Models +{ + class House + { + } +} diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/AssemblyInfo.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..78e4e9b --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CzokoŚmierciarka.WPF2.0")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CzokoŚmierciarka.WPF2.0")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.Designer.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.Designer.cs new file mode 100644 index 0000000..bee5fca --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CzokoŚmierciarka.WPF2._0.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CzokoŚmierciarka.WPF2._0.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.resx b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.Designer.cs b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ebdd33d --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CzokoŚmierciarka.WPF2._0.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.settings b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Trunk/Interface/CzokoŚmierciarka.WPF2.0/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file