예제 #1
0
        public override Matchspace Generate()
        {
            int        count = 0;
            Matchspace space = Matchspace.Create(spaceSize);

            do
            {
                count++;
                Randomize(space);
                space.Step();
            } while (!EquilibriumFinder.Search(space));
            Debug.Log("Iterations until solution found: " + count);
            return(space);
        }
예제 #2
0
        public override Matchspace Generate()
        {
            Matchspace space = Matchspace.Create(spaceSize);

            for (int x = 0; x < space.width; x++)
            {
                for (int y = 0; y < space.height; y++)
                {
                    for (int z = 0; z < space.depth; z++)
                    {
                        space.grid[x, y, z].type = (x + y + z) % types;
                    }
                }
            }
            return(space);
        }
예제 #3
0
        public override Matchspace Generate()
        {
            Vector3Int size  = new Vector3Int(typeMap.width, typeMap.height, typeMap.depth);
            Matchspace space = Matchspace.Create(size);

            int[,,] types = typeMap.GetTypes();
            for (int x = 0; x < space.width; x++)
            {
                for (int y = 0; y < space.height; y++)
                {
                    for (int z = 0; z < space.depth; z++)
                    {
                        space.grid[x, y, z].type = types[x, y, z];
                    }
                }
            }
            space.Step();
            return(space);
        }