Beispiel #1
0
        public void Add()
        {
            var addMap   = new List <Cell>();
            var addWorld = new CellWorld();

            var r = new Random();

            for (var i = 0; i < 1000; i++)
            {
                var x = r.Next(1000);
                var y = r.Next(1000);
                var n = new Cell {
                    X = x, Y = y
                };
                if (addMap.Contains(n) || _world[x, y])
                {
                    continue;
                }
                addMap.Add(n);
                addWorld[x, y] = true;
            }

            _world = _world.Add(addWorld);

            foreach (var position in _testMap)
            {
                Assert.IsTrue(_world[position.X, position.Y]);
            }
            foreach (var position in addMap)
            {
                Assert.IsTrue(_world[position.X, position.Y]);
            }
        }