示例#1
0
文件: TicTacToe.cs 项目: edohe/grove
    public void Start()
    {
        CurrentPlayer.Set(Get(DefaultPlayer));

        for (int j = 0; j < 3; ++j)
        {
            for (int i = 0; i < 3; ++i)
            {
                var cell = new Cell()
                {
                    Owner    = new PlayerOutput(),
                    Position = new Vector3(i, j, 0),
                };
                Board.Add(cell);

                cell.Owner.Subscribe(CheckWinner);
            }
        }
    }
示例#2
0
文件: TicTacToe.cs 项目: edohe/grove
 private void CheckWinner()
 {
     Winner.Set(FindWinner());
 }