// (c) 2005 kp@kp73.com
using System;
namespace KP.Tetris{
/// <summary>
/// Configuration settings.
/// </summary>
public class Config
{
private int boardWidth;
private int boardHeight;
/// <summary>
/// Get or set the height of the play area.
/// </summary>
public int BoardWidth
{
get { return boardWidth; }
set { boardWidth = value; }
}
/// <summary>
/// Get or set the width of the play area.
/// </summary>
public int BoardHeight
{
get { return boardHeight; }
set { boardHeight = value; }
}
private Config()
{
boardWidth = 10;
boardHeight = 20;
}
private static Config instance;
private static Config GetInstance()
{
lock (typeof(Config))
{
if (instance == null)
instance = new Config();
}
return instance;
}
/// <summary>
/// Get the users configuration options values.
/// </summary>
public static Config UserPreference
{
get { return GetInstance(); }
}
}
}
|