Exemplo n.º 1
0
        /// <summary>
        /// This is not meant to be used during gameplay to get a new level, use LevelManager for that
        /// </summary>
        /// <param name="unsolved"></param>
        /// <returns></returns>
        public Puzzle GetRandomPuzzle()
        {
            if (!initialized)
            {
                Debug.LogWarning("Asked for puzzle on non initialized Level");
                return(new Puzzle());
            }

            int index = random.Next(InitialConfigs.Count());

            return(new Puzzle(this, InitialConfigs[index]));
        }
Exemplo n.º 2
0
        public List <Puzzle> GetRandomPuzzles(int n)
        {
            if (!initialized)
            {
                Debug.LogWarning("Asked for puzzle on non initialized Level");
                return(new List <Puzzle>());
            }

            return(InitialConfigs.Select(cc => new Puzzle(this, cc))
                   .OrderBy(item => rnd.Next())
                   .Take(n)
                   .ToList());
        }