public AIPlayer(PlayerColor playerColor) { this.playerColor = playerColor; uciAdapter = new UCIAdapter(Application.dataPath + RELATIVE_ENGINE_PATH); uciAdapter.EngineMovedEvent += OnEngineMoved; uciAdapter.Start(); while (!uciAdapter.IsReady) { } UCIThreadAdapter uciThreadAdapter = UCIThreadAdapter.GetInstance(); uciThreadAdapter.playerActedEvent += OnPlayerAct; }
private void OnEngineMoved(Cell from, Cell to) { PlayerAct playerAct = new PlayerAct() { Act = PlayerAct.ActType.Move, From = from, To = to, PlayerColor = playerColor }; UCIThreadAdapter uciThreadAdapter = UCIThreadAdapter.GetInstance(); uciThreadAdapter.SetPlayerAct(playerAct); }
void Awake() { singleton = this; }