diff --git a/Trunk/CzokoŚmieciarka.sln b/Trunk/CzokoŚmieciarka.sln index 44717df..fa54b36 100644 --- a/Trunk/CzokoŚmieciarka.sln +++ b/Trunk/CzokoŚmieciarka.sln @@ -11,28 +11,54 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPFv2", "I EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.AI_Naive", "Components\CzokoŚmieciarka.AI_Naive\CzokoŚmieciarka.AI_Naive.csproj", "{10E77BBE-55E1-483D-A456-0E94EAC9B24A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.MonoGame", "Interface\CzokoŚmieciarka.MonoGame\CzokoŚmieciarka.MonoGame.csproj", "{3A27CBFB-44DF-4B1D-B776-770FCA3DF905}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x86.ActiveCfg = Debug|Any CPU + {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x86.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 + {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x86.ActiveCfg = Release|Any CPU + {F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x86.Build.0 = Release|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x86.ActiveCfg = Debug|Any CPU + {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x86.Build.0 = Debug|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.Build.0 = Release|Any CPU + {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x86.ActiveCfg = Release|Any CPU + {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x86.Build.0 = Release|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x86.ActiveCfg = Debug|Any CPU + {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x86.Build.0 = Debug|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.ActiveCfg = Release|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.Build.0 = Release|Any CPU + {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x86.ActiveCfg = Release|Any CPU + {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x86.Build.0 = Release|Any CPU {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x86.ActiveCfg = Debug|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x86.Build.0 = Debug|Any CPU {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.ActiveCfg = Release|Any CPU {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.Build.0 = Release|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x86.ActiveCfg = Release|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x86.Build.0 = Release|Any CPU + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Debug|Any CPU.ActiveCfg = Debug|x86 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Debug|x86.ActiveCfg = Debug|x86 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Debug|x86.Build.0 = Debug|x86 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Release|Any CPU.ActiveCfg = Release|x86 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Release|x86.ActiveCfg = Release|x86 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Content.mgcb b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Content.mgcb new file mode 100644 index 0000000..297518a --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Content.mgcb @@ -0,0 +1,118 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:Windows +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + +#begin Font.spritefont +/importer:FontDescriptionImporter +/processor:FontDescriptionProcessor +/processorParam:PremultiplyAlpha=True +/processorParam:TextureFormat=Compressed +/build:Font.spritefont + +#begin Images/Dumps/glass.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/Dumps/glass.png + +#begin Images/Dumps/organic.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/Dumps/organic.png + +#begin Images/Dumps/paper.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/Dumps/paper.png + +#begin Images/Dumps/plasticmetal.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/Dumps/plasticmetal.png + +#begin Images/garbageCollector.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/garbageCollector.png + +#begin Images/house.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/house.png + +#begin Images/intersection.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/intersection.png + +#begin Images/intersectionRED.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Images/intersectionRED.png + diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Font.spritefont b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Font.spritefont new file mode 100644 index 0000000..bd33ecf --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Font.spritefont @@ -0,0 +1,60 @@ + + + + + + + Arial + + + 12 + + + 0 + + + true + + + + + + + + + + + + ~ + + + + diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/glass.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/glass.png new file mode 100644 index 0000000..60a475e Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/glass.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/organic.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/organic.png new file mode 100644 index 0000000..fec2e9e Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/organic.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/paper.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/paper.png new file mode 100644 index 0000000..548493e Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/paper.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/plasticmetal.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/plasticmetal.png new file mode 100644 index 0000000..cbf47a7 Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/Dumps/plasticmetal.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/garbageCollector.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/garbageCollector.png new file mode 100644 index 0000000..3283e83 Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/garbageCollector.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/house.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/house.png new file mode 100644 index 0000000..c69da1e Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/house.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersection.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersection.png new file mode 100644 index 0000000..c57ed66 Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersection.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersectionRED.png b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersectionRED.png new file mode 100644 index 0000000..3914a2d Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Content/Images/intersectionRED.png differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/CzokoŚmieciarka.MonoGame.csproj b/Trunk/Interface/CzokoŚmieciarka.MonoGame/CzokoŚmieciarka.MonoGame.csproj new file mode 100644 index 0000000..abc7533 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/CzokoŚmieciarka.MonoGame.csproj @@ -0,0 +1,91 @@ + + + + + Debug + x86 + 8.0.30703 + 2.0 + {3A27CBFB-44DF-4B1D-B776-770FCA3DF905} + WinExe + Properties + CzokoŚmieciarka.MonoGame + CzokoŚmieciarka.MonoGame + 512 + Windows + v4.5 + + + x86 + true + full + false + bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ + DEBUG;TRACE;WINDOWS + prompt + 4 + + + x86 + pdbonly + true + bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ + TRACE;WINDOWS + prompt + 4 + + + Icon.ico + + + app.manifest + + + + + + + + + + + + + + + $(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll + + + + + + + + + + + + + + {10e77bbe-55e1-483d-a456-0e94eac9b24a} + CzokoŚmieciarka.AI_Naive + + + {a3d5da96-69d7-463f-b1ee-6fc70716e3b2} + CzokoŚmieciarka.DataModels.GeneralModels + + + {f2e11fee-c5ac-47d2-ba9c-819909b6dff7} + CzokoŚmieciarka.DataModels + + + + + + \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Game1.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Game1.cs new file mode 100644 index 0000000..d0cd7db --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Game1.cs @@ -0,0 +1,94 @@ +using System.Collections.Generic; +using CzokoŚmieciarka.MonoGame.Interfaces; +using CzokoŚmieciarka.MonoGame.Models; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace CzokoŚmieciarka.MonoGame +{ + /// + /// This is the main type for your game. + /// + public class Game1 : Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + private Texture2D road; + private IWPFObject[,] Objects = new IWPFObject[9, 9]; + private IEnumerable GarbageCollectorContainers; + private WPFGarbageCollector garbageCollector; + + public Game1() + { + graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + } + + /// + /// Allows the game to perform any initialization it needs to before starting to run. + /// This is where it can query for any required services and load any non-graphic + /// related content. Calling base.Initialize will enumerate through any components + /// and initialize them as well. + /// + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be used to draw textures. + spriteBatch = new SpriteBatch(GraphicsDevice); + road = Content.Load("Images/intersection"); + // TODO: use this.Content to load your game content here + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// game-specific content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + Content.Unload(); + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + protected override void Update(GameTime gameTime) + { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) + Exit(); + + // TODO: Add your update logic here + + base.Update(gameTime); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + // TODO: Add your drawing code here + + spriteBatch.Begin(); + spriteBatch.Draw(road, new Rectangle(0,0,40,40),Color.White); + spriteBatch.End(); + base.Draw(gameTime); + } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Icon.ico b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Icon.ico new file mode 100644 index 0000000..7d9dec1 Binary files /dev/null and b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Icon.ico differ diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Interfaces/IWPFObject.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Interfaces/IWPFObject.cs new file mode 100644 index 0000000..7606df3 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Interfaces/IWPFObject.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + + +namespace CzokoŚmieciarka.MonoGame.Interfaces +{ + public interface IWPFObject + { + Coords Coords { get; set; } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Dump.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Dump.cs new file mode 100644 index 0000000..4e43c94 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Dump.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CzokoŚmieciarka.DataModels.Enums; +using CzokoŚmieciarka.DataModels.GeneralModels.Models; +using CzokoŚmieciarka.DataModels.Interfaces; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.MonoGame.Interfaces; + +namespace CzokoŚmieciarka.MonoGame.Models +{ + class WPFDump : ADump, IWPFObject + { + public string ImagePath { get; set; } + + public WPFDump(ITypeOfGarbage typeofGarbage, int maxVolume, Coords localization) : base ( typeofGarbage, maxVolume, localization) + { + switch (typeofGarbage.GarbageType) + { + case GarbageType.Glass: + ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png"; + break; + case GarbageType.PlasticMetal: + ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png"; + break; + case GarbageType.Organic: + ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png"; + break; + case GarbageType.Paper: + ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png"; + break; + } + } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/GarbageCollector.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/GarbageCollector.cs new file mode 100644 index 0000000..f20de22 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/GarbageCollector.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.MonoGame.Interfaces; + +namespace CzokoŚmieciarka.MonoGame.Models +{ + class WPFGarbageCollector : AGarbageCollector, IWPFObject, INotifyPropertyChanged + { + + + public WPFGarbageCollector(Coords startPosition, IEnumerable trashContainers, int columns, int rows) : base(startPosition, trashContainers, columns, rows) + { + + } + + public event PropertyChangedEventHandler PropertyChanged; + + [NotifyPropertyChangedInvocator] + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + + + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/House.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/House.cs new file mode 100644 index 0000000..d7d4de1 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/House.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CzokoŚmieciarka.DataModels.Interfaces; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.MonoGame.Interfaces; + +namespace CzokoŚmieciarka.MonoGame.Models +{ + class WPFHouse : IGarbageLocalization, IWPFObject + { + public Coords Coords { get; set; } + public IEnumerable TrashCans { get; set; } + + + public WPFHouse(Coords coords, IEnumerable trashCans) + { + TrashCans = trashCans; + Coords = coords; + } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road.cs new file mode 100644 index 0000000..5b667f1 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mime; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.MonoGame.Interfaces; + +namespace CzokoŚmieciarka.MonoGame.Models +{ + class Road : IWPFObject + { + public MediaTypeNames.Image Image + { + get + { + return new MediaTypeNames.Image + { + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")), + Width = 100, + Height = 100 + }; + } + } + + public Road() + { + //Image = new Image() + //{ + // Source = + // new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) + //}; + } + + public Coords Coords { get; set; } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road2.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road2.cs new file mode 100644 index 0000000..bb5fd79 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Models/Road2.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.MonoGame.Interfaces; + +namespace CzokoŚmieciarka.MonoGame.Models +{ + class Road2 : IWPFObject + { + public string ImagePath { get; set; } + public Coords Coords { get; set; } + + public Road2() + { + } + } +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Program.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Program.cs new file mode 100644 index 0000000..dab9e40 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Program.cs @@ -0,0 +1,22 @@ +using System; + +namespace CzokoŚmieciarka.MonoGame +{ +#if WINDOWS || LINUX + /// + /// The main class. + /// + public static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + using (var game = new Game1()) + game.Run(); + } + } +#endif +} diff --git a/Trunk/Interface/CzokoŚmieciarka.MonoGame/Properties/AssemblyInfo.cs b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ee41ef7 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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.MonoGame")] +[assembly: AssemblyProduct("CzokoŚmieciarka.MonoGame")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3cdbdf0b-e65f-481e-83b9-45c21a07b884")] + +// 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Śmieciarka.MonoGame/app.manifest b/Trunk/Interface/CzokoŚmieciarka.MonoGame/app.manifest new file mode 100644 index 0000000..77b9e59 --- /dev/null +++ b/Trunk/Interface/CzokoŚmieciarka.MonoGame/app.manifest @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + + + + diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml index fe91d13..f18bd30 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml @@ -5,12 +5,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:CzokoŚmieciarka.WPFv2" mc:Ignorable="d" - Title="MainWindow" Height="800" Width="1000" + Title="MainWindow" Height="800" Width="800" KeyDown="MainWindow_OnKeyDown"> - - - - + + diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs index 4523793..1940503 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs @@ -51,18 +51,17 @@ namespace CzokoŚmieciarka.WPFv2 //routePlanningEngine.PerformStep(); } - CollectorBoard.Children.Clear(); - Grid.SetColumn(garbageCollector.Image, garbageCollector.Coords.X); - Grid.SetRow(garbageCollector.Image, garbageCollector.Coords.Y); - CollectorBoard.Children.Add(garbageCollector.Image); Board.Children.Clear(); - for (int x=0;x() @@ -122,10 +111,9 @@ namespace CzokoŚmieciarka.WPFv2 new GarbageCollectorContainer(new TypeOfGarbage(GarbageType.Paper, 1,1), 500) }; garbageCollector = new WPFGarbageCollector(new Coords(2, 1), GarbageCollectorContainers, Columns, Rows); - Grid.SetRow(garbageCollector.Image, garbageCollector.Coords.Y); - Grid.SetColumn(garbageCollector.Image, garbageCollector.Coords.X); - CollectorBoard.Children.Add(garbageCollector.Image); - CollectorBoard.ShowGridLines = true; + Canvas.SetLeft(garbageCollector.Image, garbageCollector.Coords.X * 100); + Canvas.SetTop(garbageCollector.Image, garbageCollector.Coords.Y * 100); + Board.Children.Add(garbageCollector.Image); //CollectorInfo.ItemsSource = garbageCollector; //CollectorInfo.Items.Add(garbageCollector); //CollectorInfo.Columns.Add(new DataGridTextColumn {Header="X", Binding = new Binding("Coords.X")}); @@ -140,8 +128,8 @@ namespace CzokoŚmieciarka.WPFv2 WPFHouse house = new WPFHouse(new Coords(1, 3), trashCans); Objects[1, 3] = house; - Grid.SetRow(Objects[1, 3].Image, 3); - Grid.SetColumn(Objects[1, 3].Image, 1); + Canvas.SetLeft(Objects[1, 3].Image, 1 * 100); + Canvas.SetTop(Objects[1, 3].Image, 3 * 100); Board.Children.Add(Objects[1, 3].Image); diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs index 64e56d8..dce1412 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs @@ -33,7 +33,9 @@ namespace CzokoŚmieciarka.WPFv2.Models { 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")), + Width = 100, + Height = 100 }; } diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs index eb7b999..b8aea36 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/House.cs @@ -30,7 +30,9 @@ namespace CzokoŚmieciarka.WPFv2.Models { Image = new Image() { - Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png")) + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png")), + Width = 100, + Height = 100 }; 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 8e4f5d7..4c81dd5 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Road.cs @@ -13,24 +13,26 @@ namespace CzokoŚmieciarka.WPFv2.Models { class Road : IWPFObject { - public Image Image { get; set; } - //{ - // get - // { - // return new Image - // { - // Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) - // }; - // } - //} + public Image Image + { + get + { + return new Image + { + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")), + Width = 100, + Height = 100 + }; + } + } public Road() { - Image = new Image() - { - Source = - new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) - }; + //Image = new Image() + //{ + // Source = + // new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) + //}; } public Coords Coords { get; set; }