예제 #1
0
 public bool IsNextLowNumber(CardController other) => (int)Number == (int)other.Number - 1;
예제 #2
0
 public bool IsNextHighNumber(CardController other) => (int)Number == (int)other.Number + 1;
예제 #3
0
 public bool SameColor(CardController other) => Color == other.Color;
예제 #4
0
 public bool DifferentColor(CardController other) => !SameColor(other);
예제 #5
0
 public bool ValidDropPositionFor(CardController card) =>
 card.Seed == _seed &&
 !card.IsAPile() && (
     (!HasCards && card.Number == Number.A) ||
     (HasCards && TopCard.IsNextLowNumber(card))
     );
예제 #6
0
 public SolitaireMove(CardController cardToMove, IDragDropOrigin origin, IDragDropDestination destination)
 {
     _movedCard   = cardToMove;
     _origin      = origin;
     _destination = destination;
 }
예제 #7
0
 protected void Unlink(CardController card) => card.Stack = null;
예제 #8
0
 public void Drop(CardController card)
 {
     card.DropTo(_transform.position + _pileOffset);
     AttachNext(card.Pile);
     card.Stack = null;
 }
예제 #9
0
 protected virtual void OnTake(CardController card) => Unlink(card);
예제 #10
0
 protected void Link(CardController card) => card.Stack = this;
예제 #11
0
 protected virtual void OnPut(CardController card)
 {
     card.PlaceTo(NextStackPosition);
     Link(card);
 }
예제 #12
0
 public virtual void Put(CardController card) => _stack.Put(card);
예제 #13
0
 public void UndoDrop(CardController card) => DetachNext();
예제 #14
0
 public CardAnimator(CardController card, float movementAnimationTime = 0.2f, float rotationAnimationTime = 0.2f)
 {
     _card = card.transform;
     _movementAnimationTime = movementAnimationTime;
     _rotationAnimationTime = rotationAnimationTime;
 }
예제 #15
0
 public void UndoDrop(CardController card) => Take();
예제 #16
0
 private void Awake()
 {
     _tranform = transform;
     _card     = GetComponent <CardController>();
     _cam      = Camera.main;
 }
예제 #17
0
 public bool ValidDropPositionFor(CardController card) =>
 Card.Stack?.GetType() != typeof(TalonStack) &&
 !Next &&
 Card.IsFacingUp &&
 Card.DifferentColor(card) &&
 Card.IsNextHighNumber(card);