This commit is contained in:
Michał Dulski 2019-04-01 21:53:06 +02:00
parent e1bb924f69
commit 1abeccfcdc
14 changed files with 64 additions and 7 deletions

View File

@ -63,6 +63,7 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IWPFObject.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
@ -72,6 +73,7 @@
<Compile Include="Models\Dump.cs" />
<Compile Include="Models\GarbageCollector.cs" />
<Compile Include="Models\House.cs" />
<Compile Include="Models\Road.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
namespace CzokoŚmieciarka.WPFv2.Interfaces
{
public interface IWPFObject
{
string ImagePath { get; set; }
Image Image { get; set; }
}
}

View File

@ -12,6 +12,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CzokoŚmieciarka.WPFv2.Interfaces;
using CzokoŚmieciarka.WPFv2.Models;
namespace CzokoŚmieciarka.WPFv2
{
@ -20,17 +22,25 @@ namespace CzokoŚmieciarka.WPFv2
/// </summary>
public partial class MainWindow : Window
{
public static int Columns = 9;
public static int Rows = 9;
IWPFObject[,] Objects = new IWPFObject[Columns,Rows];
public MainWindow()
{
ColumnDefinition column;
RowDefinition row;
InitializeComponent();
for(int i = 0; i < 10; i++)
for(int i = 0; i < Rows; i++)
{
column = new ColumnDefinition();
row = new RowDefinition();
Board.ColumnDefinitions.Add(column);
Board.RowDefinitions.Add(row);
for (int j = 0; j < Columns; j++)
{
Road road = new Road("path");
Objects[i, j] = road;
}
}
Board.ShowGridLines = true;

View File

@ -3,17 +3,19 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class WPFDump : ADump
class WPFDump : ADump, IWPFObject
{
public string ImagePath { get; set; }
public ImageBrush ImageBrush { get; set; }
public Image Image { get; set; }
public WPFDump(ITypeOfGarbage typeOfGarbage, int maxVolume, Coords localization, string imagePath) : base(typeOfGarbage, maxVolume, localization)
{

View File

@ -3,17 +3,19 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class WPFGarbageCollector : AGarbageCollector
class WPFGarbageCollector : AGarbageCollector, IWPFObject
{
public string ImagePath { get; set; }
public ImageBrush ImageBrush { get; set; }
public Image Image { get; set; }
public WPFGarbageCollector(Coords startPosition, IEnumerable<AGarbageCollectorContainer> trashContainers, string imagePath) : base(startPosition, trashContainers)
{

View File

@ -7,14 +7,15 @@ using System.Windows.Media;
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class WPFHouse : IGarbageLocalization
class WPFHouse : IGarbageLocalization, IWPFObject
{
public Coords Coords { get; }
public IEnumerable<ATrashCan> TrashCans { get; set; }
private string ImagePath { get; set; }
public string ImagePath { get; set; }
public ImageBrush ImageBrush { get; set; }

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
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.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class Road : IWPFObject
{
public string ImagePath { get; set; }
public Image Image { get; set; }
public Road(string imagePath)
{
ImagePath = imagePath;
}
}
}