zalążek wyświetlania info o domkach
This commit is contained in:
parent
b192473972
commit
0d840d4a77
13
Trunk/MonoGameView/DataModels/Displayer.cs
Normal file
13
Trunk/MonoGameView/DataModels/Displayer.cs
Normal file
@ -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<string,string> Content { get; set; }
|
||||
}
|
||||
}
|
@ -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<IStep> steps;
|
||||
GarbageCollector collector;
|
||||
IDrawables[,] grid;
|
||||
Displayer displayer = new Displayer(){Content = new Dictionary<string, string>()};
|
||||
|
||||
|
||||
public Game1()
|
||||
{
|
||||
graphics = new GraphicsDeviceManager(this);
|
||||
@ -169,8 +173,23 @@ namespace CzokoŚmieciarka.MonoGameView
|
||||
}
|
||||
}
|
||||
collector.Draw(spriteBatch, size);
|
||||
Display(new Dictionary<string, string>(){["Dupa"] = "123", ["Stefan"] = "555", ["Dupa1"] = "123", ["Stefan1"] = "555", ["Dupa2"] = "123", ["Stefan2"] = "555"});
|
||||
displayer.Content = new Dictionary<string, string>();
|
||||
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.LastOrDefault().FillPercent.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
Display(displayer.Content);
|
||||
|
||||
spriteBatch.End();
|
||||
// TODO: Add your drawing code here
|
||||
|
@ -47,6 +47,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Algorithms\BFS.cs" />
|
||||
<Compile Include="Algorithms\DFS.cs" />
|
||||
<Compile Include="DataModels\Displayer.cs" />
|
||||
<Compile Include="DataModels\Enums\Directions.cs" />
|
||||
<Compile Include="DataModels\Enums\GarbageTypes.cs" />
|
||||
<Compile Include="DataModels\Exceptions\Exceptions.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user