namespace Boggle
{
public class Tile
{
//declaring readonly as these values will never be modified once set and compiler has ways to optimize for this.
private readonly int _X;
///
/// X co-ordinate of the tile in the board array.
/// This is a read only property.
///
public int X
{
get
{
return _X;
}
}
///
/// Y co-ordinate of the tile in the board array.
/// This is a read only property.
///
/// The alphabet contained in the tile. It can be any valid letter or 'QU'.
/// This is a read only property.
///
private readonly string _Alphabet;
public string Alphabet
{
get
{
return _Alphabet;
}
}
///
/// Tells whether this tile has been visited or not during recursion.
///
public bool IsVisited { get; set; }
public Tile(int x, int y, string alphabet)
{
_X = x;
_Y = y;
_Alphabet = alphabet;
IsVisited = false;
}
///
/// Copy constructor to use when using threads.
///
///
public Tile(Tile t)
{
_X = t._X;
_Y = t._Y;
_Alphabet = t._Alphabet;
IsVisited = t.IsVisited;
}
}
}