コード例 #1
0
	/// <summary>
	/// Starts a new game.
	/// </summary>
	/// <remarks>
	/// Creates an AI player based upon the _aiSetting.
	/// </remarks>
	public static void StartGame()
	{
		if (_theGame != null)
			EndGame();

		//Create the game
		_theGame = new BattleShipsGame();

		//create the players
		switch (_aiSetting) {
			case AIOption.Medium:
				_ai = new AIMediumPlayer(_theGame);
				break;
			case AIOption.Hard:
				_ai = new AIHardPlayer(_theGame);
				break;
			default:
				_ai = new AIHardPlayer(_theGame);
				break;
		}

		_human = new Player(_theGame);

		//AddHandler _human.PlayerGrid.Changed, AddressOf GridChanged
		_ai.PlayerGrid.Changed += GridChanged;
		_theGame.AttackCompleted += AttackCompleted;

		AddNewState(GameState.Deploying);
	}
コード例 #2
0
 public AIMediumPlayer(BattleShipsGame controller)
     : base(controller)
 {
 }
コード例 #3
0
 public AIHardPlayer(BattleShipsGame game)
     : base(game)
 {
 }
コード例 #4
0
 public AIEasyPlayer(BattleShipsGame controller)
     : base(controller)
 {
 }
コード例 #5
0
ファイル: AIMediumPlayer.cs プロジェクト: dec0004/Battleship
 public AIMediumPlayer(BattleShipsGame controller) : base(controller)
 {
 }
コード例 #6
0
ファイル: AIEasyPlayer.cs プロジェクト: KazitoAz/Battle-ships
 public AIEasyPlayer(BattleShipsGame controller) : base(controller)
 {
 }
コード例 #7
0
ファイル: AIHardPlayer.cs プロジェクト: 101639803/Battleship
 public AIHardPlayer(BattleShipsGame game) :
     base(game)
 {
 }