Czoko_Smieciarka/Trunk/CzokoŚmieciarka.WPF/Models/Board.cs

65 lines
1.5 KiB
C#
Raw Normal View History

2019-03-13 16:45:38 +01:00
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using CzokoŚmieciarka.DataModels.Interfaces;
namespace CzokoŚmieciarka.WPF.Models
{
public class Board
{
int _rows;
int _columns;
List<Tile> _tiles = new List<Tile>();
public Board(int rows, int columns)
{
_rows = rows;
_columns = columns;
for (int r = 0; r < rows; r++)
{
for (int c = 0; c < columns; c++)
{
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Images\dirt.jpg");
var Bitmap = new Bitmap(path);
_tiles.Add(new Tile()
{
Data = string.Format("Tile {0}", r*10+c),
Img = Bitmap
});
}
}
}
public int Rows
{
get { return _rows; }
set { _rows = value; }
}
public int Columns
{
get { return _columns; }
set { _columns = value; }
}
public List<Tile> Tiles
{
get { return _tiles; }
set { _tiles = value; }
}
}
public class Tile
{
public string Data { get; set; }
public Bitmap Img { get; set; }
}
}