Beispiel #1
0
        public void PushStep(GoStep step)
        {
            GoPoint        point       = OnAddChess(step.Coord, step.Type);
            List <GoCoord> removedList = OnCheckCapture(point);

            step.SetRemovedList(removedList);
            steps_.Push(step);
            OnChessChanged();
        }
Beispiel #2
0
        public bool PopStep()
        {
            GoStep  step  = steps_.Pop();
            GoPoint point = GetPoint(step.Coord);

            OnRemoveChess(point);
            if (step.Removed.Count != 0)
            {
                GoPointType removedType = GoPointType.EMPTY;
                if (step.Type == GoPointType.BLACK)
                {
                    removedType = GoPointType.WHITE;
                }
                else if (step.Type == GoPointType.WHITE)
                {
                    removedType = GoPointType.BLACK;
                }
                foreach (GoCoord item in step.Removed)
                {
                    SetupPoint(item, removedType);
                }
            }
            return(false);
        }