亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? game.cs

?? C#開(kāi)發(fā)的運(yùn)行于windows mobile PDA上的游戲
?? CS
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
////////////////////////////////////////////////
// 
// 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;
using System.Threading;
using Lines.Utils;

namespace Lines.Core
{
	/// <summary>
	/// Represents a top level wrapper for the Lines.NET game logic.
	/// </summary>
	/// <remarks>
	/// <p>This class encloses the top-level game logic of Lines.NET. The major functionality of the game 
	/// might be accessed through an instance of this class. It might be useful to access a 
	/// <see cref="Lines.Core.Board"/> methods and attributes via <see cref="Game.Board"/> property
	/// though.</p>
	/// <p>This class provides a set of events that are fired during the game so that one may assign
	/// his/her own event handler to them. There is a possibility to fire some of those events from 
	/// outside of the scope of this class. It's done in order to allow <see cref="Lines.Core.Board"/>
	/// and <see cref="Lines.Core.Ball"/> classes to propagate bottom-up events. This methods must not
	/// be abused.</p>
	/// </remarks>
	public class Game
	{
		/// <summary>
		/// Describes the ball event handler function interface.
		/// </summary>
		public delegate void BallEventHandler(Game game, Ball ball);
		/// <summary>
		/// Describes the balls event handler function interface.
		/// </summary>
		public delegate void BallsEventHandler(Game game, Ball[] balls);
		/// <summary>
		/// Describes the ball move event handler function interface.
		/// </summary>
		public delegate void BallMoveEventHandler(Game game, Ball ball, Point oldPos, Point newPos);

		#region Events
		/// <summary>
		/// Occurs when a new ball is added to the board.
		/// </summary>
		public event BallEventHandler BallAdd;
		/// <summary>
		/// Occurs when a ball is removed from the board.
		/// </summary>
		public event BallEventHandler BallDelete;
		/// <summary>
		/// Occurs when a ball has finished its movement over the board.
		/// </summary>
		public event BallEventHandler BallMoved;
		/// <summary>
		/// Occurs when a ball is moved from one field of the board to another (one-step movement).
		/// </summary>
		public event BallMoveEventHandler BallMove;
		/// <summary>
		/// Occurs when a set of balls is removed from the board.
		/// </summary>
		public event BallsEventHandler BallsDelete;
		#endregion

		#region Attributes
		/// <summary>
		/// Holds the reference to an instance of <see cref="Lines.Core.Board"/> class.
		/// </summary>
		private Board board;
		/// <summary>
		/// Defines wether the board is currently locked.
		/// </summary>
		private bool isLocked = false;
		/// <summary>
		/// Defines wether the current game is over.
		/// </summary>
		/// <remarks>
		/// This is an ad hoc for implementing a game over event. Unfortunately the problems in 
		/// threading with using classes of System.Windows.Forms namespace under .NET Compact Framework
		/// made me employ this strange approach.
		/// </remarks>
		private bool isGameOver = false;
		
		/// <summary>
		/// Defines the amount of new balls that will appear on each step of the game.
		/// </summary>
		private int ballsPerStep;
		/// <summary>
		/// Defines the minimum amount of balls the same color in line to be a reason to
		/// remove them from the board.
		/// </summary>
		private int ballsInLine;
		/// <summary>
		/// Defines the destroy ball pause in milliseconds.
		/// </summary>
		private int destroyBallPause;

		/// <summary>
		/// Defines whether the balls should be destroyed one by one or all at once.
		/// </summary>
		private bool oneByOneDestruction = true;

		/// <summary>
		/// Holds the counter of steps that player have done.
		/// </summary>
		private int stepCount = 0;
		/// <summary>
		/// Holds the player current score.
		/// </summary>
		private int score = 0;

		/// <summary>
		/// The reference to a hi score list class.
		/// </summary>
		private HiScoreList hiScore;
		/// <summary>
		/// Keeps the file name of hi score list.
		/// </summary>
		private string recordsFilename;

		/// <summary>
		/// The list of balls that will appear at the next step.
		/// </summary>
		private Ball[] virtualBalls;

		#endregion

		#region Properties

		/// <summary>
		/// Gets the reference to the game board.
		/// </summary>
		public Board Board
		{
			get {return board;}
		}

		/// <summary>
		/// Gets or sets an amount of new balls that will appear on each step of the game.
		/// </summary>
		/// <remarks>
		/// When assigned the value must be greater then <c>0</c>.
		/// </remarks>
		public int BallsPerStep
		{
			get {return ballsPerStep;}
			set {ballsPerStep = (value > 0) ? value : ballsPerStep;}
		}

		/// <summary>
		/// Gets or sets a minimum amount of balls the same color in line to be a reason to
		/// remove them from the board.
		/// </summary>
		/// <remarks>
		/// When assigned the value must be greater then <c>2</c>.
		/// </remarks>
		public int BallsInLine
		{
			get {return ballsInLine;}
			set {ballsInLine = (value > 2) ? value : ballsInLine;}
		}

		/// <summary>
		/// Gets or sets a value of destroy ball pause in milliseconds.
		/// </summary>
		public int DestroyBallPause
		{
			get {return destroyBallPause;}
			set {destroyBallPause = value;}
		}

		/// <summary>
		/// Gets or sets a value of <see cref="oneByOneDestruction"/> flag.
		/// </summary>
		/// <remarks>
		/// Defines whether the balls should be destroyed one by one or all at once.
		/// </remarks>
		public bool OneByOneDestruction
		{
			get {return oneByOneDestruction;}
			set {oneByOneDestruction = value;}
		}

		/// <summary>
		/// Returns current step.
		/// </summary>
		public int StepCount
		{
			get {return stepCount;}
		}

		/// <summary>
		/// Returns a value of current player score.
		/// </summary>
		public int Score
		{
			get {return score;}
		}

		/// <summary>
		/// Gets an array of balls that will apper the next step.
		/// </summary>
		public Ball[] VirtualBalls
		{
			get {return virtualBalls;}
		}

		/// <summary>
		/// Gets or sets a hi score list file name.
		/// </summary>
		/// <remarks>
		/// While setting a new file name the hi score records are read from the file if present.
		/// </remarks>
		public string RecordsFilename
		{
			get {return recordsFilename;}
			set
			{
				recordsFilename = value;
				hiScore.Load(recordsFilename);
			}
		}

		/// <summary>
		/// Gets a value of <see cref="isLocked"/> flag.
		/// </summary>
		/// <remarks>
		/// Defines wether the board is currently locked.
		/// </remarks>
		public bool IsLocked
		{
			get {return isLocked;}
		}

		/// <summary>
		/// Checks whether the current score is a record and return <c>true</c> if it is so, <c>false</c>
		/// otherwise.
		/// </summary>
		public bool IsRecord
		{
			get {return Records.IsRecord(score, stepCount);}
		}

		/// <summary>
		/// Lousy implementation of game over event. A solution for threading problem in .NET 
		/// Compact Framework.
		/// <seealso cref="isGameOver"/>
		/// </summary>
		public bool IsGameOverEvent
		{
			get 
			{
				// Solution for thread problem :(
				if (isGameOver)
				{
					isGameOver = false;
					return true;
				}
				return false;
			}
		}

		/// <summary>
		/// Gets the reference to a hi score list class.
		/// </summary>
		public HiScoreList Records
		{
			get {return hiScore;}
		}
		#endregion

		/// <summary>
		/// Creates an instance of Lines.NET game class.
		/// </summary>
		/// <remarks>
		/// <p>Initializes the default values of game properties and loads hi score list from the records 
		/// file name.</p>
		/// <p>Constructor does not perform complete initialization. Use the method <see cref="NewGame"/>
		/// do so and start a new game.</p>
		/// </remarks>
		public Game()
		{
			ballsPerStep = AppSettings.Instance.BallsPerStep;
			ballsInLine = AppSettings.Instance.MinBallsInLine;
			destroyBallPause = AppSettings.Instance.PauseDestroyBall;
			
			hiScore = new HiScoreList(AppSettings.Instance.HiScoreListSize);
			recordsFilename = PathHelper.GetAppFile(AppSettings.Instance.HiScoreListFile);

			// Load records from file
			hiScore.Load(recordsFilename);
		}

		/// <summary>
		/// Starts a new game.
		/// </summary>
		/// <remarks>
		/// Creates a new instance of empty board, reset all counters and unlockes the board 
		/// if it was locked.
		/// </remarks>
		public void NewGame()
		{
			// Create new game
			board = new Board(this);

			// Generate first set of balls

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人教育av在线| 91丨porny丨首页| 亚洲免费观看高清在线观看| 欧美一区二区三区爱爱| bt欧美亚洲午夜电影天堂| 日韩精品久久理论片| 日韩一区在线播放| 久久免费视频一区| 8x福利精品第一导航| 在线免费亚洲电影| 成人av电影免费观看| 久久国产精品72免费观看| 亚洲国产精品久久久久秋霞影院| 久久久久久97三级| 精品三级av在线| 欧美日韩在线亚洲一区蜜芽| av电影在线观看一区| 国产一区二区在线影院| 视频一区中文字幕国产| 一区二区视频免费在线观看| 国产精品午夜免费| 国产视频不卡一区| 欧美一区二区三区小说| 在线观看国产日韩| 在线观看视频一区二区| 91麻豆swag| 99国产精品久久| 成人免费视频网站在线观看| 国产精品99久久不卡二区| 久久狠狠亚洲综合| 日本一区中文字幕| 日日摸夜夜添夜夜添国产精品| 洋洋成人永久网站入口| 亚洲一区二区三区四区在线观看| 亚洲色图欧美偷拍| 亚洲三级小视频| 综合久久国产九一剧情麻豆| 中文字幕在线一区| 亚洲国产精品ⅴa在线观看| 久久久精品2019中文字幕之3| 欧美电影免费观看高清完整版在线 | 欧美日韩国产首页| 欧美亚洲日本一区| 欧美色精品天天在线观看视频| 在线视频国产一区| 欧美日韩视频在线观看一区二区三区| 在线亚洲精品福利网址导航| 91成人免费在线| 色欧美日韩亚洲| 色婷婷久久综合| 日本高清不卡一区| 欧美日韩你懂得| 欧美一区二区视频在线观看| 精品国产乱码久久久久久牛牛 | 91黄视频在线观看| 欧美性猛交xxxxxxxx| 欧美久久免费观看| 中文字幕一区在线| 亚洲欧美自拍偷拍色图| 亚洲一二三区不卡| 免费在线观看视频一区| 韩国精品免费视频| 97se亚洲国产综合自在线观| 欧美三级中文字幕在线观看| 日韩一区二区三区四区五区六区| 日韩精品一区二| 中文字幕精品—区二区四季| 亚洲精品日日夜夜| 免费成人在线网站| 国产白丝精品91爽爽久久| 91麻豆自制传媒国产之光| 欧美日本一道本| 国产亚洲自拍一区| 亚洲一区二区三区四区中文字幕| 男女视频一区二区| 成人美女视频在线看| 欧美日韩美少妇| 久久免费视频色| 一区二区高清在线| 韩国成人在线视频| 91视频国产资源| 精品美女被调教视频大全网站| 中文字幕av一区二区三区| 午夜一区二区三区在线观看| 韩国精品主播一区二区在线观看 | 波多野结衣中文字幕一区| 欧美丝袜丝交足nylons| 久久久久国色av免费看影院| 夜夜夜精品看看| 国产成人aaa| 欧美一区二区三区四区久久| 中文字幕在线不卡一区| 九九九久久久精品| 在线亚洲欧美专区二区| 国产午夜精品理论片a级大结局| 亚洲午夜久久久久中文字幕久| 国产成人精品免费一区二区| 欧美男生操女生| 亚洲免费在线电影| 国产福利一区在线观看| 7777精品伊人久久久大香线蕉| 一区在线观看免费| 国产伦理精品不卡| 欧美一区二区播放| 亚洲一区二区三区影院| 成人黄色电影在线 | 久久综合九色综合97_久久久| 亚洲国产一区二区三区青草影视| 成人动漫在线一区| 精品999在线播放| 青娱乐精品视频在线| 欧美日韩亚洲综合在线| 亚洲欧洲日韩av| 成人黄色一级视频| 石原莉奈在线亚洲二区| 在线一区二区三区做爰视频网站| 国产精品久久99| 成人免费不卡视频| 国产色爱av资源综合区| 国内精品国产成人国产三级粉色| 欧美色偷偷大香| 亚洲一卡二卡三卡四卡五卡| 91丝袜高跟美女视频| 国产精品久久久久久久裸模| 国产精品一二一区| 26uuu久久天堂性欧美| 蜜臀久久久久久久| 欧美一区三区二区| 婷婷开心激情综合| 欧美日韩激情在线| 亚洲一区二区高清| 欧美色综合天天久久综合精品| 亚洲欧美激情插| 在线中文字幕一区| 亚洲不卡av一区二区三区| 色综合av在线| 亚洲国产精品一区二区www在线| 99九九99九九九视频精品| 国产精品国产精品国产专区不片| 国产高清久久久| 国产蜜臀97一区二区三区| 成人午夜电影网站| 国产精品久久久久影院| 成人久久视频在线观看| 国产精品二三区| 色婷婷久久久久swag精品| 樱桃视频在线观看一区| 欧美亚一区二区| 青娱乐精品视频| 欧美精品一区二区三区很污很色的 | 久久久一区二区三区捆绑**| 国产乱子伦视频一区二区三区| 久久综合一区二区| 国产91精品免费| 亚洲欧洲日韩女同| 欧美午夜不卡视频| 丝袜美腿成人在线| 日韩亚洲欧美综合| 国产成人午夜精品5599| 亚洲欧洲国产专区| 欧美精品在线观看播放| 精品无人码麻豆乱码1区2区| 久久久影院官网| 色综合久久久久久久久| 日韩电影在线免费观看| 久久久久久久久97黄色工厂| 成+人+亚洲+综合天堂| 亚洲成精国产精品女| 精品国产乱码久久久久久老虎| 成人福利在线看| 日日夜夜精品视频免费 | 夜夜嗨av一区二区三区四季av| 8x8x8国产精品| 高清国产午夜精品久久久久久| 一二三区精品视频| 精品成人一区二区| 91丨九色丨国产丨porny| 日本成人在线电影网| 国产精品三级av| 欧美精品在线一区二区| 成人av电影免费在线播放| 午夜激情久久久| 免费人成网站在线观看欧美高清| 久久久久久久久久久99999| 91久久香蕉国产日韩欧美9色| 久久精品久久综合| 中文字幕在线不卡一区| 精品人伦一区二区色婷婷| 91在线视频官网| 精品一区二区在线视频| 一区二区三区在线视频播放| 精品福利一区二区三区免费视频| 91国产福利在线| 岛国一区二区在线观看| 秋霞电影一区二区| 亚洲成人免费观看| 中文字幕字幕中文在线中不卡视频| 欧美一级淫片007| 日本伦理一区二区| 成人一级片在线观看|