Exemple #1
0
        public Coordinate GetEmptyPosition()
        {
            Coordinate newPos;

            do
            {
                newPos = GlobalRand.GeneratePosition(Configuration.FieldSize);
            } while (GetCellOnPosition(newPos) != null);

            return(newPos);
        }
Exemple #2
0
        public static List <List <int> > Load()
        {
            var gen = new List <List <int> >();

            for (var i = 0; i < Configuration.LiveCellCount; i++)
            {
                gen.Add(GlobalRand.RandomList(Configuration.GenCount, Configuration.GenMaxValue));
            }

            return(gen);
        }
Exemple #3
0
        public static List <IGenericCell> GenerateNewCells(IEnumerable <List <int> > jsonData)
        {
            var cellsList = new List <IGenericCell>();

            foreach (List <int> commandList in jsonData)
            {
                List <int> newList = commandList.Select(v => GlobalRand.Next(64)).ToList();
                cellsList.Add(new GenericCell(new CellBrain(newList)));
            }

            return(cellsList);
        }