using System;
using System.Collections;
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;
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.WPFv2.Interfaces;
using CzokoŚmieciarka.WPFv2.Models;
namespace CzokoŚmieciarka.WPFv2
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public static int Columns = 9;
public static int Rows = 9;
IWPFObject[,] Objects = new IWPFObject[Columns,Rows];
private IEnumerable GarbageCollectorContainers;
private WPFGarbageCollector garbageCollector;
public MainWindow()
{
InitializeComponent();
BoardInitialize();
}
private void MainWindow_OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
garbageCollector.MoveLeft();
//routePlanningEngine.PerformStep();
}
Board.Children.Clear();
Canvas.SetLeft(garbageCollector.Image, garbageCollector.Coords.X * 100);
Canvas.SetTop(garbageCollector.Image, garbageCollector.Coords.Y * 100);
Board.Children.Add(garbageCollector.Image);
for (int y=0;y()
{
new GarbageCollectorContainer(new TypeOfGarbage(GarbageType.Glass,1,1), 500),
new GarbageCollectorContainer(new TypeOfGarbage(GarbageType.Organic,1,1), 500),
new GarbageCollectorContainer(new TypeOfGarbage(GarbageType.PlasticMetal, 1,1),500),
new GarbageCollectorContainer(new TypeOfGarbage(GarbageType.Paper, 1,1), 500)
};
garbageCollector = new WPFGarbageCollector(new Coords(2, 1), GarbageCollectorContainers, Columns, Rows);
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")});
//CollectorInfo.Columns.Add(new DataGridTextColumn { Header = "Y", Binding = new Binding("Coords.Y") });
IEnumerable trashCans = new List()
{
new TrashCan(new TypeOfGarbage(GarbageType.Glass,1,1), 500, new Garbage(new TypeOfGarbage(GarbageType.Glass,1,1), 100)),
new TrashCan(new TypeOfGarbage(GarbageType.Organic,1,1), 500, new Garbage(new TypeOfGarbage(GarbageType.Organic,1,1), 100)),
new TrashCan(new TypeOfGarbage(GarbageType.Paper,1,1), 500, new Garbage(new TypeOfGarbage(GarbageType.Paper,1,1), 100)),
new TrashCan(new TypeOfGarbage(GarbageType.PlasticMetal,1,1), 500, new Garbage(new TypeOfGarbage(GarbageType.PlasticMetal,1,1), 100))
};
WPFHouse house = new WPFHouse(new Coords(1, 3), trashCans);
Objects[1, 3] = house;
Canvas.SetLeft(Objects[1, 3].Image, 1 * 100);
Canvas.SetTop(Objects[1, 3].Image, 3 * 100);
Board.Children.Add(Objects[1, 3].Image);
}
}
}