From 2d87d7e0a6352929eef631df9e427d03e0fdbf10 Mon Sep 17 00:00:00 2001 From: dodikk Date: Sat, 19 Dec 2015 16:40:54 +0200 Subject: [PATCH] [GUI] Addeed turn selector to model --- Reversi/Assets/BoardEventsHandler.cs | 8 ++++++-- Reversi/Assets/ReversiKit/GreedyTurnSelector.cs.meta | 12 ++++++++++++ Reversi/Assets/ReversiKit/RandomTurnSelector.cs.meta | 12 ++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Reversi/Assets/ReversiKit/GreedyTurnSelector.cs.meta create mode 100644 Reversi/Assets/ReversiKit/RandomTurnSelector.cs.meta diff --git a/Reversi/Assets/BoardEventsHandler.cs b/Reversi/Assets/BoardEventsHandler.cs index 50da452..c997105 100644 --- a/Reversi/Assets/BoardEventsHandler.cs +++ b/Reversi/Assets/BoardEventsHandler.cs @@ -18,8 +18,9 @@ void Start() this._isGameOver = false; this._mutableBoardModel = new MatrixBoard(); - this._turnCalculator = new TurnCalculator(); - this._boardModel = this._mutableBoardModel; + this._turnCalculator = new TurnCalculator(); + this._boardModel = this._mutableBoardModel; + this._turnSelector = new GreedyTurnSelector(); this._root = GameObject.Find("root"); @@ -408,9 +409,12 @@ private void populateLabels() private IBoardState _boardModel ; private ITurnCalculator _turnCalculator ; private MatrixBoard _mutableBoardModel; + private ITurnSelector _turnSelector ; #endregion + private static bool IS_OPPONENT_PLAYER_AI = false; + private const int BOARD_SIZE = 8; private const string CELL_TAG = "FieldCell"; private const string BALL_TAG = "Ball"; diff --git a/Reversi/Assets/ReversiKit/GreedyTurnSelector.cs.meta b/Reversi/Assets/ReversiKit/GreedyTurnSelector.cs.meta new file mode 100644 index 0000000..1da5408 --- /dev/null +++ b/Reversi/Assets/ReversiKit/GreedyTurnSelector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bf5f99d4007834004ba161f0b99bd3cc +timeCreated: 1450531869 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Reversi/Assets/ReversiKit/RandomTurnSelector.cs.meta b/Reversi/Assets/ReversiKit/RandomTurnSelector.cs.meta new file mode 100644 index 0000000..675c555 --- /dev/null +++ b/Reversi/Assets/ReversiKit/RandomTurnSelector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7ea4cc224ee5e4bc6993cb9a7a740c50 +timeCreated: 1450531868 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: