Beispiel #1
0
        private List <Point> Update()
        {
            for (var i = 0; i < 64; i++)
            {
                var point = ConvertPoint(i);
                switch (Othello.Board[point.x, point.y])
                {
                case -1:
                    DiscDataList[i].DiscCondition = DiscCondition.Black;
                    break;

                case 1:
                    DiscDataList[i].DiscCondition = DiscCondition.White;
                    break;

                case 0:
                    DiscDataList[i].DiscCondition = DiscCondition.Void;
                    break;
                }
            }
            var points = Othello.GetPossiblePoints(Othello.Turn);

            switch (Othello.Turn)
            {
            case -1:
                foreach (var point in points)
                {
                    DiscDataList[ConvertInt(point)].DiscCondition = DiscCondition.AbleBlack;
                }
                break;

            case 1:
                foreach (var point in points)
                {
                    DiscDataList[ConvertInt(point)].DiscCondition = DiscCondition.AbleWhite;
                }
                break;
            }
            BlackNumberText = Othello.GetDiscNumber(-1).ToString();
            WhiteNumberText = Othello.GetDiscNumber(1).ToString();
            return(points);
        }