예제 #1
0
 public VisualCardWrapper(GameObject card)
 {
     CardGO        = card;
     CanBeMoved    = card.GetComponent <CanBeMoved>();
     CanBeDetached = card.GetComponent <CanBeDetached>();
     CanBeInHand   = card.GetComponent <CanBeInHand>();
 }
예제 #2
0
    void Start()
    {
        UpdateTime = 0;
        _card      = CardsGameObjects.DetachHandleWithHand(true);

        _hand        = Hand.CreateHand(true);
        _canbeinhand = _card.AddComponent <CanBeInHand>();

        _hand.Add(_canbeinhand);
    }
예제 #3
0
        /// <summary>
        /// Remove a card from hand.
        /// Will update all remaining cards transforms.
        /// </summary>
        /// <param name="card">Card to be removed.</param>
        public void Remove(CanBeInHand card)
        {
            Cards.Remove(card);
            card.RemovedFromHand();

            for (int i = 0; i < Cards.Count; i++)
            {
                Cards[i].OnIndexChanged(i, Cards.Count);
            }
        }
예제 #4
0
    void Start()
    {
        UpdateTime = 0;
        _card      = CardsGameObjects.OnlyDetachHandle();
        _card.AddComponent <CanBeDetached>();
        _card.AddComponent <CanBeMoved>();
        var owned = _card.AddComponent <CanBeOwned>();

        owned.PlayerOwned = true;

        _hand        = Hand.CreateHand(true);
        _canbeinhand = _card.AddComponent <CanBeInHand>();

        _canbeinhand.AddedToHand(0, 1, _hand);
        IntegrationTest.Assert(_canbeinhand.IsInHand == true);
    }
예제 #5
0
    void Start()
    {
        UpdateTime = 0;
        _card      = CardsGameObjects.OnlyDetachHandle();
        _card.AddComponent <CanBeDetached>();
        _card.AddComponent <CanBeMoved>();
        var owned = _card.AddComponent <CanBeOwned>();

        owned.PlayerOwned = true;

        _hand = _card.AddComponent <CanBeInHand>();
        _card.transform.position = Vector3.zero;
        _card.transform.rotation = Quaternion.identity;

        _hand.OnIndexChanged(1, 2);
    }
예제 #6
0
    void Start()
    {
        UpdateTime = 0;
        _card      = CardsGameObjects.OnlyDetachHandle();
        _card.AddComponent <CanBeDetached>();
        _card.AddComponent <CanBeMoved>();
        var owned = _card.AddComponent <CanBeOwned>();

        owned.PlayerOwned = true;

        _hand = _card.AddComponent <CanBeInHand>();
        _card.transform.position = VisualManager.Instance.HandPositioning.PositionPlayer(0, 1);
        _card.transform.rotation = VisualManager.Instance.HandPositioning.RotationPlayer(0, 1);
        _hand.IsInHand           = true;

        _hand.OnIndexChanged(1, 2);
    }
예제 #7
0
 /// <summary>
 /// Adds a card into the hand but don't move and rotate it.
 /// Does not update already present cards, use PrepareAddingCard for that.
 /// </summary>
 /// <param name="card">Card to be added.</param>
 public void AddWithoutFitting(CanBeInHand card)
 {
     card.AddedToHandWithoutFitting(this);
     Cards.Add(card);
 }
예제 #8
0
 /// <summary>
 /// Adds a card into the hand.
 /// Does not update already present cards, use PrepareAddingCard for that.
 /// Will move and rotate the card to have a correct transform.
 /// </summary>
 /// <param name="card">Card to be added.</param>
 public void Add(CanBeInHand card)
 {
     card.AddedToHand(Cards.Count, Cards.Count + 1, this);
     Cards.Add(card);
 }