/// <summary> /// Sizes the game piece back to its original size. /// </summary> public void ShrinkToNormalSize() { double baseScale = .9; double endScale = baseScale + lastEnlargeAmount; if (emptyModelShown && pieceType == PieceType.Empty) { GamePieceVisual.AnimateScale(this.emptyAnimatedScale, endScale, baseScale); GamePieceVisual.AnimateHighlight(this.EmptyPieceMaterialAnimatableBrush, BaseEmptyPieceOpacity + .1, BaseEmptyPieceOpacity); } else if (xModelShown && pieceType == PieceType.X) { GamePieceVisual.AnimateScale(this.xAnimatedScale, endScale, baseScale); GamePieceVisual.AnimateHighlight(this.XPieceMaterialAnimatableBrush, 1, BasePlacedPieceOpacity); } else if (oModelShown && pieceType == PieceType.O) { GamePieceVisual.AnimateScale(this.oAnimatedScale, endScale, baseScale); GamePieceVisual.AnimateHighlight(this.OPieceMaterialAnimatableBrush, 1, BasePlacedPieceOpacity); } this.enlarged = false; }
/// <summary> /// Makes the game piece bigger by a specified amount. /// </summary> /// <param name="amount">A value of 1.00 will result in no change. 0.50 will result in a 50% /// decrease in size. 2.00 will result in a 200% increase in size.</param> public void Enlarge(double amount) { double baseScale = .9; double endScale = baseScale + amount; this.lastEnlargeAmount = amount; if (emptyModelShown && pieceType == PieceType.Empty) { GamePieceVisual.AnimateScale(this.emptyAnimatedScale, baseScale, endScale); GamePieceVisual.AnimateHighlight(this.EmptyPieceMaterialAnimatableBrush, BaseEmptyPieceOpacity, BaseEmptyPieceOpacity + .1); } else if (xModelShown && pieceType == PieceType.X) { GamePieceVisual.AnimateScale(this.xAnimatedScale, baseScale, endScale); GamePieceVisual.AnimateHighlight(this.XPieceMaterialAnimatableBrush, BasePlacedPieceOpacity, 1); } else if (oModelShown && pieceType == PieceType.O) { GamePieceVisual.AnimateScale(this.oAnimatedScale, baseScale, endScale); GamePieceVisual.AnimateHighlight(this.OPieceMaterialAnimatableBrush, BasePlacedPieceOpacity, 1); } this.enlarged = true; }