示例#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);
 }