2019-03-20 16:02:05 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2019-03-20 16:51:35 +01:00
|
|
|
|
using System.ComponentModel;
|
2019-03-20 16:02:05 +01:00
|
|
|
|
using System.Linq;
|
2019-03-20 16:51:35 +01:00
|
|
|
|
using System.Runtime.CompilerServices;
|
2019-03-20 16:02:05 +01:00
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using CzokoŚmieciarka.DataModels.GeneralModels.Models;
|
|
|
|
|
using CzokoŚmieciarka.DataModels.Models;
|
2019-03-20 16:51:35 +01:00
|
|
|
|
using CzokoŚmieciarka.WPF.Annotations;
|
2019-03-20 16:02:05 +01:00
|
|
|
|
|
|
|
|
|
namespace CzokoŚmieciarka.WPF.Models
|
|
|
|
|
{
|
2019-03-20 16:51:35 +01:00
|
|
|
|
public class GarbageCollectorWPF : IObject, INotifyPropertyChanged
|
2019-03-20 16:02:05 +01:00
|
|
|
|
{
|
|
|
|
|
public Coords Location { get; set; }
|
|
|
|
|
|
|
|
|
|
public void Move(int columns, GarbageCollector garbageCollector)
|
|
|
|
|
{
|
|
|
|
|
Location.X = garbageCollector.Position.X;
|
|
|
|
|
Location.Y = garbageCollector.Position.Y * columns;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ImagePath { get; set; }
|
|
|
|
|
public string Data { get; set; }
|
|
|
|
|
public ImageBrush Image { get; set; }
|
|
|
|
|
|
2019-03-20 18:27:11 +01:00
|
|
|
|
public GarbageCollectorWPF(int columns,Coords location, string imagePath)
|
2019-03-20 16:02:05 +01:00
|
|
|
|
{
|
2019-03-20 18:27:11 +01:00
|
|
|
|
Location = new Coords(location.X, location.Y * columns);
|
2019-03-20 16:02:05 +01:00
|
|
|
|
ImagePath = imagePath;
|
|
|
|
|
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-20 16:51:35 +01:00
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
|
|
|
|
[NotifyPropertyChangedInvocator]
|
|
|
|
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
|
|
|
{
|
|
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
|
|
|
}
|
2019-03-20 16:02:05 +01:00
|
|
|
|
}
|
|
|
|
|
}
|