54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
|
|
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;
|
|
ImageBrush imgBrush = new ImageBrush(new BitmapImage(new Uri(@"F:\Projects\In-progress\CzokoSmieciarka\Trunk\CzokoŚmieciarka.WPF\Images\dirt.jpg")));
|
|
for (int r = 0; r < rows; r++)
|
|
{
|
|
for (int c = 0; c < columns; c++)
|
|
{
|
|
_tiles.Add(new Tile()
|
|
{
|
|
Data = string.Format("Dirt {0}", r * 10 + c),
|
|
Background = imgBrush
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
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; }
|
|
}
|
|
}
|
|
}
|