diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels.GeneralModels/Models/GarbageCollector.cs b/Trunk/Components/CzokoŚmieciarka.DataModels.GeneralModels/Models/GarbageCollector.cs index f13df43..5a224df 100644 --- a/Trunk/Components/CzokoŚmieciarka.DataModels.GeneralModels/Models/GarbageCollector.cs +++ b/Trunk/Components/CzokoŚmieciarka.DataModels.GeneralModels/Models/GarbageCollector.cs @@ -7,7 +7,7 @@ namespace CzokoŚmieciarka.DataModels.GeneralModels.Models { public class GarbageCollector : AGarbageCollector { - public GarbageCollector(Coords startPosition, IEnumerable trashContainers) : base(startPosition, trashContainers) + public GarbageCollector(Coords startPosition, IEnumerable trashContainers, int columns, int rows) : base(startPosition, trashContainers, columns, rows) { } } diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj b/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj index 63428d0..c8a4a65 100644 --- a/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj +++ b/Trunk/Components/CzokoŚmieciarka.DataModels/CzokoŚmieciarka.DataModels.csproj @@ -1,3 +1,4 @@ +<<<<<<< HEAD  @@ -66,4 +67,73 @@ +======= + + + + + Debug + AnyCPU + {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7} + Library + Properties + CzokoŚmieciarka.DataModels + CzokoŚmieciarka.DataModels + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> 9aaa79a5c5258bc287f1041f4b31f5a40e5cf25f \ No newline at end of file diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/Exceptions/OutOfGridException.cs b/Trunk/Components/CzokoŚmieciarka.DataModels/Exceptions/OutOfGridException.cs new file mode 100644 index 0000000..a0c69cc --- /dev/null +++ b/Trunk/Components/CzokoŚmieciarka.DataModels/Exceptions/OutOfGridException.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CzokoŚmieciarka.DataModels.Exceptions +{ + public class OutOfGridException : Exception + { + public OutOfGridException() + { + } + public OutOfGridException(string message) + : base(message) + { + } + + public OutOfGridException(string message, Exception inner) + : base(message, inner) + { + } + } +} diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/AGarbageCollector.cs b/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/AGarbageCollector.cs index 36581ba..b606334 100644 --- a/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/AGarbageCollector.cs +++ b/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/AGarbageCollector.cs @@ -1,3 +1,4 @@ +<<<<<<< HEAD using System; using System.Collections.Generic; using System.Linq; @@ -35,6 +36,65 @@ namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector public Coords MoveRight() { return new Coords(Coords.X+1, Coords.Y); +======= +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CzokoŚmieciarka.DataModels.Exceptions; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; +using CzokoŚmieciarka.DataModels.Models; + +namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector +{ + public abstract class AGarbageCollector : IGarbageCollector + { + public AGarbageCollector(Coords startPosition, IEnumerable trashContainers, int columns, int rows) + { + this.columns = columns; + this.rows = rows; + this.Coords = startPosition; + this.TrashContainers = trashContainers; + } + public Coords Coords { get; set; } + public int columns { get; set; } + public int rows { get; set; } + public void MoveUp() + { + if(Coords.Y -1 < 0) + { + throw new OutOfGridException(); + } + Coords.Y -= 1; + } + + public void MoveDown() + { + if (Coords.Y + 1 >= rows) + { + throw new OutOfGridException(); + } + Coords.Y +=1; + } + + public void MoveLeft() + { + if (Coords.X - 1 < 0) + { + throw new OutOfGridException(); + } + Coords.X -= 1; + } + + public void MoveRight() + { + if (Coords.X + 1 >= columns) + { + throw new OutOfGridException(); + } + Coords.X += 1; +>>>>>>> 9aaa79a5c5258bc287f1041f4b31f5a40e5cf25f } public object Clone() diff --git a/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/IGarbageCollector.cs b/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/IGarbageCollector.cs index 260a030..89bc30e 100644 --- a/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/IGarbageCollector.cs +++ b/Trunk/Components/CzokoŚmieciarka.DataModels/Interfaces/GarbageCollector/IGarbageCollector.cs @@ -11,10 +11,10 @@ namespace CzokoŚmieciarka.DataModels.Interfaces public interface IGarbageCollector : ICloneable { Coords Coords { get; } - Coords MoveUp(); - Coords MoveDown(); - Coords MoveLeft(); - Coords MoveRight(); + void MoveUp(); + void MoveDown(); + void MoveLeft(); + void MoveRight(); IEnumerable TrashContainers { get; } } diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Interfaces/IWPFObject.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Interfaces/IWPFObject.cs index 29b240a..6db260b 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Interfaces/IWPFObject.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Interfaces/IWPFObject.cs @@ -11,9 +11,7 @@ namespace CzokoŚmieciarka.WPFv2.Interfaces { public interface IWPFObject { - string ImagePath { get; set; } - Image Image { get; set; } + Image Image { get; } Coords Coords { get; set; } - } } diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs index bf9c145..4523793 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs @@ -47,7 +47,8 @@ namespace CzokoŚmieciarka.WPFv2 if (e.Key == Key.Space) { - routePlanningEngine.PerformStep(); + garbageCollector.MoveLeft(); + //routePlanningEngine.PerformStep(); } CollectorBoard.Children.Clear(); @@ -55,12 +56,18 @@ namespace CzokoŚmieciarka.WPFv2 Grid.SetRow(garbageCollector.Image, garbageCollector.Coords.Y); CollectorBoard.Children.Add(garbageCollector.Image); Board.Children.Clear(); - foreach (var item in Objects) + for (int x=0;x trashContainers) : base(startPosition, trashContainers) + public WPFGarbageCollector(Coords startPosition, IEnumerable trashContainers, int columns, int rows) : base(startPosition, trashContainers, columns, rows) { - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png"; - Image = new Image + Image = new Image() { - Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + - @"..\..\Images\garbageCollector.png")) + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png")) }; } @@ -38,5 +44,8 @@ namespace CzokoŚmieciarka.WPFv2.Models { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } + + + } } diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs index 03cec39..eb7b999 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs @@ -17,16 +17,20 @@ namespace CzokoŚmieciarka.WPFv2.Models { public Coords Coords { get; set; } public IEnumerable TrashCans { get; set; } - public string ImagePath { get; set; } public Image Image { get; set; } + //{ get { + // return new Image + // { + // Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png")) + // }; + // } } public WPFHouse(Coords coords, IEnumerable trashCans) { - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png"; - Image = new Image + Image = new Image() { - Source = new BitmapImage(new Uri(ImagePath)) + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png")) }; TrashCans = trashCans; Coords = coords; diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs index ddcc2a2..d50abb3 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs @@ -14,17 +14,26 @@ namespace CzokoŚmieciarka.WPFv2.Models { class Road : IWPFObject, IRoad { - public string ImagePath { get; set; } public Image Image { get; set; } - public Coords Coords { get; set; } + //{ + // get + // { + // return new Image + // { + // Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) + // }; + // } + //} public Road() { - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"; - Image = new Image + Image = new Image() { - Source = new BitmapImage(new Uri(ImagePath)) + Source = + new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) }; } + + public Coords Coords { get; set; } } } 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