/**
     * Sets a blur to the map to make the map more distributed.
     * This takes an average of the points within the map.
     */
    public Seed BlurMap()
    {
        Seed copy = new Seed(seed.X, seed.Y);

        seed.CopyTo(copy);

        for (int x = 0; x < seed.X; x++)
        {
            for (int y = 0; y < seed.Y; y++)
            {
                SetHeight(x, y, Average3X3(copy, x, y));
            }
        }
        seed.isInstanciated = true;
        return(seed);
    }
Exemple #2
0
        public BitArray Encode(BitArray word)
        {
            BitArray result = new BitArray(word);
            int      size   = word.Length;

            int[] random = new int[seedSize];
            Seed.CopyTo(random, 0);
            for (int i = 0; i < size; i++)
            {
                int r = Math.Abs(random[i]) % size;
                result.Swap(i, r);
            }
            return(result);
        }