From 58ba4a5b1c7e660eb3b0d5cae8cc1427884282c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulski?= Date: Wed, 13 Mar 2019 16:45:38 +0100 Subject: [PATCH] Board --- .../CzokoŚmieciarka.DataModels.csproj | 3 +- .../CzokoŚmieciarka.DataModels/Models/Map.cs | 23 ---- Trunk/CzokoŚmieciarka.WPF/App.config | 6 + Trunk/CzokoŚmieciarka.WPF/App.xaml | 9 ++ Trunk/CzokoŚmieciarka.WPF/App.xaml.cs | 17 +++ .../CzokoŚmieciarka.WPF.csproj | 111 +++++++++++++++++ Trunk/CzokoŚmieciarka.WPF/Images/dirt.jpg | Bin 0 -> 5956 bytes Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml | 24 ++++ Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml.cs | 31 +++++ Trunk/CzokoŚmieciarka.WPF/Models/Board.cs | 64 ++++++++++ .../Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 71 +++++++++++ .../Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 ++ Trunk/CzokoŚmieciarka.sln | 6 + 16 files changed, 550 insertions(+), 24 deletions(-) delete mode 100644 Trunk/Components/CzokoŚmieciarka.DataModels/Models/Map.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/App.config create mode 100644 Trunk/CzokoŚmieciarka.WPF/App.xaml create mode 100644 Trunk/CzokoŚmieciarka.WPF/App.xaml.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj create mode 100644 Trunk/CzokoŚmieciarka.WPF/Images/dirt.jpg create mode 100644 Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml create mode 100644 Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/Models/Board.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/Properties/Resources.resx create mode 100644 Trunk/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs create mode 100644 Trunk/CzokoŚmieciarka.WPF/Properties/Settings.settings diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj b/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj index edceb74..b1e3973 100644 --- a/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj +++ b/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj @@ -31,6 +31,8 @@ 4 + + @@ -54,7 +56,6 @@ - diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/Models/Map.cs b/Trunk/Components/CzokoŚmieciarka.DataModels/Models/Map.cs deleted file mode 100644 index d852af3..0000000 --- a/Trunk/Components/CzokoŚmieciarka.DataModels/Models/Map.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CzokoŚmieciarka.DataModels.Interfaces; - -namespace CzokoŚmieciarka.DataModels.Models -{ - public class Map - { - public Map(Rectangle mapRectangle, IEnumerable garbageLocalizations=null) - { - this.MapRectangle = mapRectangle; - this.GarbageLocalizations = garbageLocalizations; - } - - Rectangle MapRectangle { get; } - - IEnumerable GarbageLocalizations { get; } - } -} diff --git a/Trunk/CzokoŚmieciarka.WPF/App.config b/Trunk/CzokoŚmieciarka.WPF/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Trunk/CzokoŚmieciarka.WPF/App.xaml b/Trunk/CzokoŚmieciarka.WPF/App.xaml new file mode 100644 index 0000000..321ffef --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Trunk/CzokoŚmieciarka.WPF/App.xaml.cs b/Trunk/CzokoŚmieciarka.WPF/App.xaml.cs new file mode 100644 index 0000000..65591e4 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/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Śmieciarka.WPF +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Trunk/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj b/Trunk/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj new file mode 100644 index 0000000..6c5ebd1 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {AFCA9593-EF6B-4860-95F5-4F56F2AF221B} + WinExe + CzokoŚmieciarka.WPF + CzokoŚmieciarka.WPF + 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 + + + + + + + + {f2e11fee-c5ac-47d2-ba9c-819909b6dff7} + CzokoŚmieciarka.DataModels + + + + + Always + + + + \ No newline at end of file diff --git a/Trunk/CzokoŚmieciarka.WPF/Images/dirt.jpg b/Trunk/CzokoŚmieciarka.WPF/Images/dirt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c3a679dd706a222b396c4e470985ff5991025b4b GIT binary patch literal 5956 zcmd5=dr(wm6u-N7m&fv078f+fY6Y!puTeARCCDW&Ek(ZrldFtw1HCh@_BG6OCutSFtc^4;&We9K~gdEw4?x%Zs& zo%1`tbMCqHH1zx}#pLEp$&m~ONix8X)N@;UDl0#G;*6>JsgA-qkC)7wTj*Fc=84e` zrL460^+Ly#+)0kyY1xw;i;|N@J?5BSHtV(Gg-aaij+D`so0T^~I^O13bgWRzq>f@HKAWSgPqi1Z)?X*T!{srN7#!N-u$uy9KR2vo;N zMuRLHO)`27(r?0Z$z(If4j(fyWKiC$(1iK+q~)tOh9ze1I24zEvTelJ*$c|UE%Aeg z+&6UOLk}yX9vSy!^7siUsaa2F=S-SBC3pIa=boSW!iz7xGH33qg+;|Br3=dzEq-Ik z(u%jmD8^+l zE{0RKnasn-gv3tF3!OE8P(sr3Fni|ejXMs7Cyvc;i<`aRq$PgDxN{@hF*ILf0}HJD ze?_JT#^Y*~B4q<4Pqs-esl~0S-N$Z?Q#4ibELF50o^@!dBK4kf9X!6AVpNq4?6hhi z+Fn;MaD^02eRS7Fi=r({AF3+b601;^o!$gh**@$#TDPuuYwC6DFnmOA>l=?pJ56YZ zooTnh-p*CbmY>lt*wx!9M|dFY=T?(ZvY@VhNCwiAqXZE}~R;ePo@lldMv zRKy3Bax*CM8KpY%} z0(#5#Vb?NI+6B^EFZi-k=?h{R+WW-~DV|Uc0><8x2og)29W>8rQ2yIa-Qk>9(e|Fm zK%4ad=OpvVvI_9pBos!1;7hY4gGDXs~ z`iNIST3V;7D4GKO_JDE|Yn_P&u@>y{T@(i41aq6M(CD=Tr#m-bbZf!grj^y~5w3(; zy4%EBkjEq&o*)&?HWgVEw3W|_aF9`uAf%ZPNQgj?;;Mm)s&@KJop(da?!KjuPH3Jx zt^+{cP0Vf5yHE*F!au?{0tpq^ScN0si~t+{3HNVKZz_lKh<1Xzb#?Vdzp}x%a6^+(>KF}S4_l)1?fp`zD>O28m;nGTt znZT9wJjx|u`bglUZUR`C40~0!;ufT!2myqE(OHhv5#!_)xVR;CcjMn}(1rZFu#kVG z4FwqW$lSsE6D19up_wn8WJD%yiRC`J28x>vWLDmdNi}ddMVt+m0Um24ypIlMxLk;J zGPuXu9s!$qWfg$R-JoJSEiu4mE1E_iDD_r16nLY32ElOUtU20_CfCLGB3r + + + + + + + + + + + + + + + diff --git a/Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml.cs b/Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml.cs new file mode 100644 index 0000000..3f021f8 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/MainWindow.xaml.cs @@ -0,0 +1,31 @@ +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; +using CzokoŚmieciarka.WPF.Models; + +namespace CzokoŚmieciarka.WPF +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + + this.DataContext = new Board(10, 10); + } + } +} diff --git a/Trunk/CzokoŚmieciarka.WPF/Models/Board.cs b/Trunk/CzokoŚmieciarka.WPF/Models/Board.cs new file mode 100644 index 0000000..a731223 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/Models/Board.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Media; +using CzokoŚmieciarka.DataModels.Interfaces; + +namespace CzokoŚmieciarka.WPF.Models +{ + public class Board + { + int _rows; + int _columns; + List _tiles = new List(); + + public Board(int rows, int columns) + { + _rows = rows; + _columns = columns; + + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < columns; c++) + { + string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Images\dirt.jpg"); + var Bitmap = new Bitmap(path); + _tiles.Add(new Tile() + { + Data = string.Format("Tile {0}", r*10+c), + Img = Bitmap + }); + } + } + } + + public int Rows + { + get { return _rows; } + set { _rows = value; } + } + + public int Columns + { + get { return _columns; } + set { _columns = value; } + } + + public List Tiles + { + get { return _tiles; } + set { _tiles = value; } + } + } + + public class Tile + { + public string Data { get; set; } + public Bitmap Img { get; set; } + } +} diff --git a/Trunk/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs b/Trunk/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d80f65d --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/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Śmieciarka.WPF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CzokoŚmieciarka.WPF")] +[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/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs b/Trunk/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs new file mode 100644 index 0000000..bc2fe6a --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/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Śmieciarka.WPF.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Śmieciarka.WPF.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/CzokoŚmieciarka.WPF/Properties/Resources.resx b/Trunk/CzokoŚmieciarka.WPF/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/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/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs b/Trunk/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs new file mode 100644 index 0000000..c7d73f4 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/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Śmieciarka.WPF.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/CzokoŚmieciarka.WPF/Properties/Settings.settings b/Trunk/CzokoŚmieciarka.WPF/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Trunk/CzokoŚmieciarka.WPF/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Trunk/CzokoŚmieciarka.sln b/Trunk/CzokoŚmieciarka.sln index 158c32e..09f9f36 100644 --- a/Trunk/CzokoŚmieciarka.sln +++ b/Trunk/CzokoŚmieciarka.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28307.136 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.DataModels", "Components\CzokoŚmieciarka.DataModels\CzokoŚmieciarka.DataModels.csproj", "{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPF", "CzokoŚmieciarka.WPF\CzokoŚmieciarka.WPF.csproj", "{AFCA9593-EF6B-4860-95F5-4F56F2AF221B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|Any CPU.Build.0 = Release|Any CPU + {AFCA9593-EF6B-4860-95F5-4F56F2AF221B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFCA9593-EF6B-4860-95F5-4F56F2AF221B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFCA9593-EF6B-4860-95F5-4F56F2AF221B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFCA9593-EF6B-4860-95F5-4F56F2AF221B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE