From 091b11445e06c645d70663497c190a909f0d1964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulski?= Date: Mon, 13 May 2019 19:22:46 +0200 Subject: [PATCH] =?UTF-8?q?Wy=C5=9Bwietlanie=20ilo=C5=9Bci=20=C5=9Bmieci?= =?UTF-8?q?=20w=20=C5=9Bmieciarce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Trunk/MonoGameView/Game1.cs | 40 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/Trunk/MonoGameView/Game1.cs b/Trunk/MonoGameView/Game1.cs index 048cb3f..287367a 100644 --- a/Trunk/MonoGameView/Game1.cs +++ b/Trunk/MonoGameView/Game1.cs @@ -148,7 +148,15 @@ namespace CzokoŚmieciarka.MonoGameView } */ // TODO: Add your update logic here - + var collectorDictionary = new Dictionary + { + {"Garbage Collector Info", ""}, + {collector.TrashContainers.ElementAtOrDefault(0).TypeOfGarbage.GarbageType.ToString(), collector.TrashContainers.ElementAtOrDefault(0).Garbage.Weight.ToString()}, + {collector.TrashContainers.ElementAtOrDefault(1).TypeOfGarbage.GarbageType.ToString(), collector.TrashContainers.ElementAtOrDefault(1).Garbage.Weight.ToString()}, + {collector.TrashContainers.ElementAtOrDefault(2).TypeOfGarbage.GarbageType.ToString(), collector.TrashContainers.ElementAtOrDefault(2).Garbage.Weight.ToString()}, + {collector.TrashContainers.ElementAtOrDefault(3).TypeOfGarbage.GarbageType.ToString(), collector.TrashContainers.ElementAtOrDefault(3).Garbage.Weight.ToString()} + }; + displayer.Content = collectorDictionary; base.Update(gameTime); } @@ -165,15 +173,11 @@ namespace CzokoŚmieciarka.MonoGameView { for (int y = 0; y < size; y++) { - //if (grid[x, y] is Road1) spriteBatch.Draw(road1, new Rectangle(x*500 / size, y*500 / size, 500/size, 500/size),Color.White); - //else if (grid[x,y] is Road2) spriteBatch.Draw(road2, new Rectangle(x * 500 / size, y * 500 / size, 500 / size, 500 / size), Color.White); - //else if (grid[x, y] is House) spriteBatch.Draw(house, new Rectangle(x * 500 / size, y * 500 / size, 500 / size, 500 / size), Color.White); - //else spriteBatch.Draw(grass, new Rectangle(x * 500 / size, y * 500 / size, 500 / size, 500 / size), Color.White); grid[x, y].Draw(spriteBatch, size); } } collector.Draw(spriteBatch, size); - + Display(displayer.Content); spriteBatch.End(); // TODO: Add your drawing code here @@ -184,18 +188,18 @@ namespace CzokoŚmieciarka.MonoGameView /// /// /// - //public void Display(Dictionary info) - //{ - // int x = 510; - // int y = 10; - // foreach (KeyValuePair item in info) - // { - // spriteBatch.DrawString(font, item.Key, new Vector2(x, y),Color.Black); - // y += 15; - // spriteBatch.DrawString(font, item.Value, new Vector2(x, y), Color.White); - // y += 30; + public void Display(Dictionary info) + { + int x = 510; + int y = 10; + foreach (KeyValuePair item in info) + { + spriteBatch.DrawString(font, item.Key, new Vector2(x, y), Color.Black); + y += 15; + spriteBatch.DrawString(font, item.Value, new Vector2(x, y), Color.White); + y += 30; - // } - //} + } + } } }