Queem.Core.History.DeltaChange.HasItems C# (CSharp) Method

HasItems() public method

public HasItems ( ) : bool
return bool
        public bool HasItems()
        {
            return this.lastIndex >= 0;
        }

Usage 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;
                }
            }
        }
All Usage Examples Of Queem.Core.History.DeltaChange::HasItems