Example #1
0
        public CellularAutomata(CircularArray2D <bool> startingGrid)
        {
            CircularArray2D <bool> grid = new CircularArray2D <bool>((bool[, ])startingGrid.Content.Clone());

            CA = new T
            {
                Grid         = grid,
                StartingGrid = startingGrid
            };
        }
Example #2
0
        public override bool Equals(object obj)
        {
            bool equal = true;
            CircularArray2D <T> comparison = (CircularArray2D <T>)obj;

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    if (!Content[x, y].Equals(comparison.Content[x, y]))
                    {
                        equal = false;
                    }
                }
            }

            return(equal);
        }