Exemplo n.º 1
0
        public void UpdatePhysicalTileData()
        {
            Tile tile = new PhysicalTile(1, _pool);

            AttachEvents(tile);

            byte[] data = new byte[16 * 16 * 4];
            for (int i = 0; i < data.Length; i++)
            {
                data[i] = (byte)(i % 255);
            }

            tile.TextureModified += (s, e) =>
            {
                byte[] comp = _pool.GetTileTextureData(1);
                Assert.AreEqual(data.Length, comp.Length);
                for (int i = 0; i < comp.Length; i++)
                {
                    Assert.AreEqual(data[i], comp[i]);
                }
            };

            tile.Update(data);

            Assert.AreEqual(EventFlags.Modified | EventFlags.TextureModified, _eventsFired);
        }