コード例 #1
0
 public void ShuffleLibrary_OrderedLibrary_LibraryOrderReversed()
 {
     SelectableLinkedList<GameCard> cards = new SelectableLinkedList<GameCard>();
     for (int i = 0; i < 10; i++)
         cards.AddLast(new MockCardWithData(i + 1));
     GameLibrary lib = new GameLibrary();
     lib.Add(cards);
     lib.Shuffle(_ => 0);
     List<GameCard> newLib = lib.TakeCards(10);
     for (int i = 0; i < newLib.Count; i++)
     {
         Assert.IsTrue(((MockCardWithData)newLib[i]).data == 10 - i);
     }
 }
コード例 #2
0
        void Start()
        {
            UnityEngine.Object.DontDestroyOnLoad(this);

            var p1lib = new GameLibrary();
            Player p = new Player(p1lib,new Hand(), new ManaStorage(), new GameLevelRewards(Mana.Arcane));
            var cards1 = CreatePlayer1Deck();
            p1lib.Add(cards1);
            p1lib.Shuffle();
            p.Name = "player 1";
            this.mainPlayer = p;
            this.AddPlayer(p);

            var p2lib = new GameLibrary();
            p = new Player(p2lib, new Hand(), new ManaStorage(), new GameLevelRewards(Mana.Fury));
            var cards2 = CreatePlayer2Deck();
            p2lib.Add(cards2);
            p2lib.Shuffle();
            p.Name = "player 2";
            this.AddPlayer(p);
        }