Ejemplo n.º 1
0
 public Stack(Deck deck, Shuffling shuffling)
 {
     this.shuffling = shuffling;
     foreach (var card in deck.cards)
     {
         card.MoveTo(zone);
     }
 }
Ejemplo n.º 2
0
 public Game(Player corpPlayer, Player runnerPlayer, Shuffling shuffling)
 {
     this.shuffling  = shuffling;
     corp            = CreateCorp(corpPlayer);
     runner          = CreateRunner(runnerPlayer);
     PlayArea        = new Zone("Play area");
     this.checkpoint = new Checkpoint(this);
 }
Ejemplo n.º 3
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     Shuffling ___test = new Shuffling();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
Ejemplo n.º 4
0
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        try {
            Shuffling ___test = new Shuffling();
            ___test.run_test(-1);
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
Ejemplo n.º 5
0
 public ResearchAndDevelopment(Game game, Deck deck, Shuffling shuffling)
 {
     this.game      = game;
     this.shuffling = shuffling;
     Ice            = new IceColumn(game);
     foreach (var card in deck.cards)
     {
         card.MoveTo(Zone);
     }
 }
Ejemplo n.º 6
0
        private void AddShufflingsIfNotExists(Shuffling model)
        {
            if (_context.Shufflings.IgnoreQueryFilters().Any(s => s.Title == model.Title && s.ImageUrl == model.ImageUrl
                                                             ))
            {
                return;
            }

            _context.Shufflings.Add(model);
            _context.SaveChanges();
        }
Ejemplo n.º 7
0
        public void Shuffle_LargeSortedArray_ReturnsUnorderedArray()
        {
            // Arrange
            int[] xs       = new int[] { 4, 8, 2, 7, 1, 0, 2, 6, 3, 9, 2, 0, 1, 6, 3, 8, 2, 8, 5 };
            int[] xsSorted = SelectionSort.Sort(xs);

            // Act
            int[] xsShuffled = Shuffling.Shuffle(xsSorted);

            // Assert
            Assert.IsFalse(Utils.IsSorted(xsShuffled));
        }
Ejemplo n.º 8
0
    public void LevelCreation()
    {
        sectoronlevel = new Transform[(int)gridscale.x, (int)gridscale.y];


        if (transform.Find(fulllevel))
        {
            DestroyImmediate(transform.Find(fulllevel).gameObject);
        }

        thefullloc = new List <locationscd>();
        for (int xaxis = 0; xaxis < gridscale.x; xaxis++)
        {
            for (int yaxis = 0; yaxis < gridscale.y; yaxis++)
            {
                thefullloc.Add(new locationscd(xaxis, yaxis));
            }
        }


        mixedlocations = new Queue <locationscd>(Shuffling.Fisher(thefullloc.ToArray(), index));

        playerspawnpoint = new locationscd((int)gridscale.x / 2, (int)gridscale.y / 2);



        Transform thecompleted = new GameObject(fulllevel).transform;

        thecompleted.parent = transform;

        for (int xaxis = 0; xaxis < gridscale.x; xaxis++)
        {
            for (int yaxis = 0; yaxis < gridscale.y; yaxis++)
            {
                Vector3   SectionLocation = locationtopos(xaxis, yaxis);
                Transform thegridsection  = Instantiate(prefgrid, SectionLocation, Quaternion.Euler(Vector3.right * 90)) as Transform;
                thegridsection.parent       = thecompleted;
                thegridsection.localScale   = Vector3.one * (1 - borders);
                sectoronlevel[xaxis, yaxis] = thegridsection;
            }
        }

        bool[,] hurdlelocations = new bool[(int)gridscale.x, (int)gridscale.y];
        int numberofhurdle = (int)(gridscale.x * gridscale.y * hurdlepercent);
        int howmany        = 0;
        List <locationscd> everyavailable = new List <locationscd> (thefullloc);

        for (int check = 0; check < numberofhurdle; check++)
        {
            randomh = Random.Range(0, 2);
            for (int i = 0; i < 3; i++)
            {
                if (randomh == i)
                {
                    hurdlepref = hurdles[i];
                }
            }
            locationscd rndlocation = atrandomloc();
            hurdlelocations[rndlocation.x, rndlocation.y] = true;
            howmany++;

            if (rndlocation != playerspawnpoint)
            {
                Vector3   hurdleloc = locationtopos(rndlocation.x, rndlocation.y);
                Transform newhurdle = Instantiate(hurdlepref, hurdleloc + Vector3.up * 0.50f, Quaternion.identity) as Transform;
                newhurdle.parent = thecompleted;

                everyavailable.Remove(rndlocation);
            }

            else
            {
                hurdlelocations[rndlocation.x, rndlocation.y] = false;
                howmany--;
            }
        }

        mixedavailablelocations = new Queue <locationscd>(Shuffling.Fisher(everyavailable.ToArray(), index));
    }