コード例 #1
0
        public void TestMovingCared()
        {
            Monopoly.Monopoly m = new Monopoly.Monopoly();

            MovingCard card   = new MovingCard("Chance", "MOVE", "failed movement", null);
            Player     player = new Player("Tom");

            card.ExecuteInstruction(player);
            Assert.AreEqual(0, player.getLocation());

            m.loadProperties();
            card.Destination = "KKKK";
            card.ExecuteInstruction(player);
            Assert.AreEqual(0, player.getLocation());

            card.Steps       = 0;
            card.Destination = "Ohakune Carrot";

            player.setLocation(6);
            card.ExecuteInstruction(player);
            Assert.AreEqual(1, player.getLocation());

            card.Steps = 2;
            card.ExecuteInstruction(player);
            Assert.AreEqual(3, player.getLocation());
        }
コード例 #2
0
ファイル: CardMover.cs プロジェクト: dave95b/Memo
    private void CreateMovingCards()
    {
        Card[] cards     = GetComponentsInChildren <Card>();
        int    cardCount = cards.Length;

        movingCards = new MovingCard[cardCount];

        for (int i = 0; i < cardCount; i++)
        {
            movingCards[i] = new MovingCard(cards[i].transform);
        }
    }
コード例 #3
0
ファイル: Deck.cs プロジェクト: TakFog/ggj2018
 // Use this for initialization
 void Awake()
 {
     Instance     = this;
     movingScript = movingCard.GetComponent <MovingCard>();
     audio        = GetComponent <AudioSource>();
 }
コード例 #4
0
ファイル: Shelf.cs プロジェクト: TakFog/ggj2018
 void Awake()
 {
     audio    = GetComponent <AudioSource>();
     moving   = GetComponent <MovingCard>();
     Instance = this;
 }
コード例 #5
0
ファイル: CardMover.cs プロジェクト: dave95b/Memo
    public void ReflectCard(Transform cardTransform, Vector3 collisionNormal)
    {
        MovingCard card = movingCards.First(c => c.Transform == cardTransform);

        card.MovementVector = Vector3.Reflect(card.MovementVector, collisionNormal);
    }