예제 #1
0
    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;
    }
예제 #2
0
    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);
    }
예제 #3
0
 void Awake()
 {
     singleton = this;
 }