|
using System;
using System.Drawing;
namespace Reversi
{
/// <summary>
/// Summary description for Options.
/// </summary>
public class Options
{
// Define the game options.
public bool ShowValidMoves;
public bool PreviewMoves;
public bool AnimateMoves;
public Color BoardColor;
public Color ValidMoveColor;
public Color ActiveSquareColor;
public Color MoveIndicatorColor;
public int FirstMove;
public bool ComputerPlaysBlack;
public bool ComputerPlaysWhite;
public ReversiForm.Difficulty
Difficulty;
//
// Creates a new Options object using the defaults.
//
public Options()
{
//
// TODO: Add constructor logic here
//
// Initialize the game options to their default values.
this.RestoreDefaults();
}
//
// Creates a new Options object by copying an existing one.
//
public Options(Options options)
{
this.ShowValidMoves = options.ShowValidMoves;
this.PreviewMoves = options.PreviewMoves;
this.AnimateMoves = options.AnimateMoves;
this.BoardColor = options.BoardColor;
this.ValidMoveColor = options.ValidMoveColor;
this.ActiveSquareColor = options.ActiveSquareColor;
this.MoveIndicatorColor = options.MoveIndicatorColor;
this.FirstMove = options.FirstMove;
this.ComputerPlaysBlack = options.ComputerPlaysBlack;
this.ComputerPlaysWhite = options.ComputerPlaysWhite;
this.Difficulty = options.Difficulty;
}
//
// Restores all game options to their default values.
//
public void RestoreDefaults()
{
this.ShowValidMoves = true;
this.AnimateMoves = true;
this.PreviewMoves = false;
this.BoardColor = SquareControl.NormalBackColorDefault;
this.ValidMoveColor = SquareControl.ValidMoveBackColorDefault;
this.ActiveSquareColor = SquareControl.ActiveSquareBackColorDefault;
this.MoveIndicatorColor = SquareControl.MoveIndicatorColorDefault;
this.FirstMove = Board.Black;
this.ComputerPlaysBlack = false;
this.ComputerPlaysWhite = true;
this.Difficulty = ReversiForm.Difficulty.Intermediate;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.