Exemplo n.º 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;
    }
Exemplo n.º 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);
    }
Exemplo n.º 3
0
 void Awake()
 {
     singleton = this;
 }