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

54 lines
1.3 KiB
C#
Raw Normal View History

2019-03-13 16:45:38 +01:00
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;
2019-03-13 16:45:38 +01:00
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")));
2019-03-13 16:45:38 +01:00
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
2019-03-13 16:45:38 +01:00
});
}
}
}
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; }
}
}
}