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