HasItems() public method

public HasItems ( ) : bool
return bool
Example #1
0
        public void AnimateCancelMove(DeltaChange dc, Move move)
        {
            this.OnMoveAnimationPreview();
            this.SetupAnimationCount(move);

            var figureDiedItems = dc.Filter((ch) =>
                (ch.Action == MoveAction.Deletion) &&
                (ch.FigureColor != this.viewModel.CurrentPlayerColor) &&
                (ch.Square == move.To));

            Queem.Core.Figure figureDied = Queem.Core.Figure.Nobody;
            if (figureDiedItems.Count() > 0)
                figureDied = figureDiedItems.First().FigureType;

            while (dc.HasItems())
            {
                var change = dc.PopLast();

                switch (change.Action)
                {
                    case MoveAction.Move:
                        this.InnerAnimateMove(new Move(change.AdditionalSquare, change.Square), figureDied);
                        break;

                    case MoveAction.Creation:
                        break;

                    case MoveAction.Deletion:
                        if (move.To != change.Square)
                            this.viewModel.UpdateFigure(change.Square,
                                change.FigureType, change.FigureColor);
                        break;
                }
            }
        }
Example #2
0
        public void AnimateMove(DeltaChange dc, Move move)
        {
            this.OnMoveAnimationPreview();
            this.SetupAnimationCount(move);

            while (dc.HasItems())
            {
                var change = dc.PopLast();

                switch(change.Action)
                {
                    case MoveAction.Move:
                        this.InnerAnimateMove(new Move(change.Square, change.AdditionalSquare), Queem.Core.Figure.Nobody);
                        break;

                    case MoveAction.Deletion:
                        if (change.Square != move.To)
                            // if not equal - passing capture
                            this.viewModel.RemoveFigure(change.Square);
                        break;

                    case MoveAction.Creation:
                        this.viewModel.UpdateFigure(change.Square,
                            change.FigureType, change.FigureColor);
                        break;
                }
            }
        }