preferences.cs

来自「C#开发的运行于windows mobile PDA上的游戏」· CS 代码 · 共 145 行

CS
145
字号
////////////////////////////////////////////////
// 
// Project: Lines.NET
// Version: 1.1
// Author:  Vladimir L.
// 
// homepage: http://www.boomsoft.org
// e-mail:   support@boomsoft.org
// 
// Copyright (c) 2003-2004, Boomsoft.org
// 

using System;
using System.Drawing;

namespace Lines.GUI
{
	/// <summary>
	/// Describes graphics and color preferences of the game.
	/// </summary>
	/// <remarks>
	/// <p style="color:red">This class currently has a very simple implementation and is a topic to
	/// change in a future to be more flexible and customizable.</p>
	/// </remarks>
	public class Preferences
	{
		/// <summary>
		/// Creates an instance of Preferences class.
		/// </summary>
		public Preferences()
		{
		}

		/// <summary>
		/// Matches between color index of ball and <see cref="Color"/> object to to draw this ball.
		/// </summary>
		/// <param name="color">The color index of ball.</param>
		/// <returns>The fillup color itself to draw the ball.</returns>
		public Color GetBallColor(int color)
		{
			switch (color)
			{
				case 1:
					return Color.Red;
				case 2:
					return Color.Green;
				case 3:
					return Color.Blue;
				case 4:
					return Color.Yellow;
				case 5:
					return Color.Orange;
				case 6:
					return Color.Brown;
				case 7:
					return Color.Cyan;
				case 8:
					return Color.Violet;
				// So on, anyway will be changed in a future
				default:
					return Color.Black;
			}
		}

		/// <summary>
		/// Matches between color index of ball and <see cref="Color"/> object to to draw the frame of this ball.
		/// </summary>
		/// <param name="color">The color index of ball.</param>
		/// <returns>The border color itself to draw the ball frame.</returns>
		public Color GetBallBorderColor(int color)
		{
			switch (color)
			{
				case 1:
					return Color.DarkRed;
				case 2:
					return Color.DarkGreen;
				case 3:
					return Color.DarkBlue;
				case 4:
					return Color.Gold;
				case 5:
					return Color.DarkOrange;
				case 6:
					return Color.Black;
				case 7:
					return Color.DarkCyan;
				case 8:
					return Color.DarkViolet;
					// So on, anyway will be changed in a future
				default:
					return Color.Black;
			}
		}

		/// <summary>
		/// Gets the field (game board) background color.
		/// </summary>
		public Color FieldBgColor
		{
			get {return Color.WhiteSmoke;}
		}

		/// <summary>
		/// Gets the field (game board) foreground color.
		/// </summary>
		public Color FieldFgColor
		{
			get {return Color.Black;}
		}

		/// <summary>
		/// Gets the score/steps/next balls indicator background color.
		/// </summary>
		public Color IndicatorBgColor
		{
			get {return Color.WhiteSmoke;}
		}

		/// <summary>
		/// Gets the score/steps/next balls indicator foreground color.
		/// </summary>
		public Color IndicatorFgColor
		{
			get {return Color.Black;}
		}

		/// <summary>
		/// Gets the score/steps indicator text color.
		/// </summary>
		public Color IndicatorTextColor
		{
			get {return Color.PaleGreen;}
		}

		/// <summary>
		/// Gets the background color of indicator itself.
		/// </summary>
		public Color IndicatorCtrlBgColor
		{
			get {return Color.DarkSlateGray;}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?