diff --git a/Trunk/MonoGameView/DataModels/Displayer.cs b/Trunk/MonoGameView/DataModels/Displayer.cs new file mode 100644 index 0000000..c734f44 --- /dev/null +++ b/Trunk/MonoGameView/DataModels/Displayer.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MonoGameView.DataModels +{ + public class Displayer + { + public Dictionary Content { get; set; } + } +} diff --git a/Trunk/MonoGameView/Game1.cs b/Trunk/MonoGameView/Game1.cs index 1bdb2d2..acda59b 100644 --- a/Trunk/MonoGameView/Game1.cs +++ b/Trunk/MonoGameView/Game1.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; +using System.CodeDom; using System.Collections.Generic; using System.Linq; using CzokoŚmieciarka.MonoGameView.Algorithms; @@ -37,6 +38,9 @@ namespace CzokoŚmieciarka.MonoGameView List steps; GarbageCollector collector; IDrawables[,] grid; + Displayer displayer = new Displayer(){Content = new Dictionary()}; + + public Game1() { graphics = new GraphicsDeviceManager(this); @@ -169,8 +173,26 @@ namespace CzokoŚmieciarka.MonoGameView } } collector.Draw(spriteBatch, size); - Display(new Dictionary(){["Dupa"] = "123", ["Stefan"] = "555", ["Dupa1"] = "123", ["Stefan1"] = "555", ["Dupa2"] = "123", ["Stefan2"] = "555"}); + displayer.Content = new Dictionary(); + try + { + foreach (var item in grid) + { + if (item is House) + { + var house = item as House; + displayer.Content.Add(house.Coords.X.ToString() + ":" + house.Coords.Y.ToString() + house.TrashCans.ElementAtOrDefault(0).Garbage.TypeOfGarbage.GarbageType.ToString(), house.TrashCans.ElementAtOrDefault(0).Garbage.Volume.ToString()); + displayer.Content.Add(house.Coords.X.ToString() + ":" + house.Coords.Y.ToString() + house.TrashCans.ElementAtOrDefault(1).Garbage.TypeOfGarbage.GarbageType.ToString(), house.TrashCans.ElementAtOrDefault(1).Garbage.Volume.ToString()); + displayer.Content.Add(house.Coords.X.ToString() + ":" + house.Coords.Y.ToString() + house.TrashCans.ElementAtOrDefault(2).Garbage.TypeOfGarbage.GarbageType.ToString(), house.TrashCans.ElementAtOrDefault(2).Garbage.Volume.ToString()); + displayer.Content.Add(house.Coords.X.ToString() + ":" + house.Coords.Y.ToString() + house.TrashCans.ElementAtOrDefault(3).Garbage.TypeOfGarbage.GarbageType.ToString(), house.TrashCans.ElementAtOrDefault(3).Garbage.Volume.ToString()); + } + } + } + catch + { + } + Display(displayer.Content); spriteBatch.End(); // TODO: Add your drawing code here diff --git a/Trunk/MonoGameView/MonoGameView.csproj b/Trunk/MonoGameView/MonoGameView.csproj index e76fbd6..7deca05 100644 --- a/Trunk/MonoGameView/MonoGameView.csproj +++ b/Trunk/MonoGameView/MonoGameView.csproj @@ -41,9 +41,13 @@ app.manifest + + + + diff --git a/Trunk/MonoGameView/map2.xml b/Trunk/MonoGameView/map2.xml index cc4236f..d632bdf 100644 --- a/Trunk/MonoGameView/map2.xml +++ b/Trunk/MonoGameView/map2.xml @@ -174,6 +174,48 @@ 100 + + + Organic + + + 1 + + + 1 + + + 100 + + + + + Paper + + + 1 + + + 1 + + + 100 + + + + + PlasticMetal + + + 1 + + + 1 + + + 100 + + @@ -280,6 +322,48 @@ 100 + + + + Organic + + + 1 + + + 1 + + + 100 + + + + + Paper + + + 1 + + + 1 + + + 100 + + + + + PlasticMetal + + + 1 + + + 1 + + + 100 + @@ -1171,6 +1255,48 @@ 100 + + + + Organic + + + 1 + + + 1 + + + 100 + + + + + Paper + + + 1 + + + 1 + + + 100 + + + + + PlasticMetal + + + 1 + + + 1 + + + 100 + @@ -1278,6 +1404,48 @@ 100 + + + + Organic + + + 1 + + + 1 + + + 100 + + + + + Paper + + + 1 + + + 1 + + + 100 + + + + + PlasticMetal + + + 1 + + + 1 + + + 100 +