public void AssignVolumeTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren DynamicRangeChunkVolume parentVolume = null; // TODO: Passenden Wert initialisieren target.AssignVolume(parentVolume); Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden."); }
public DynamicRangeChunkVolume(GraphicsDevice device, GameDataProvider provider) { chunkWishList = new HashSet<WorldPosition>(); this.provider = provider; volume = new Chunk[16, 16, 16]; vertexBuffers = new CDictionary<Chunk, VBuffer7>(); this.device = device; this.effect = Static.Effect; MiniMap = new Texture2D(Static.Device, 64, 64); MiniMapBuffer = new Color[64 * 64]; MiniMapLayer = new Layer(MiniMap, 1, 0.7f, LayerDock.Far, LayerDock.Far, () => { return true; } ); MiniMapLayer.Push(new LayerCell { SourceTexture = new Rectangle(0, 0, 64, 64), DestinationScreen = new Rectangle(-270, -270, 256, 256) }); redrawWorker = new Timer(doRedraw); redrawWorker.Change(50, 50); hoverBoxMesh = HelpfulStuff.getCube(0.51f, GraphicsHelper.TextureCoord(36)); }
public void DeserializeTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren BinaryReader reader = null; // TODO: Passenden Wert initialisieren target.Deserialize(reader); Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden."); }
public DynamicRangeChunkVolume(GraphicsDevice device, GameDataProvider provider) { chunkWishList = new HashSet<WorldPosition>(); this.provider = provider; volume = new Chunk[16, 16, 16]; vertexBuffers = new CDictionary<Chunk, VBuffer7>(); this.device = device; this.effect = Static.Effect; }
public void InsertChunk(Chunk c) { uint indexX = coordToIndex(c.X); uint indexY = coordToIndex(c.Y); uint indexZ = coordToIndex(c.Z); if (volume[indexX, indexY, indexZ] != null && !WorldPosition.Same(volume[indexX, indexY, indexZ].Position, c.Position)) return; c.AssignVolume(this); vertexBuffers.Add(volume[indexX, indexY, indexZ] = c, null); RedrawWithSurrounding(indexX, indexY, indexZ); }
public DynamicRangeChunkVolume(GraphicsDevice device, GameDataProvider provider) { chunkWishList = new HashSet<WorldPosition>(); this.provider = provider; volume = new Chunk[16, 16, 16]; vertexBuffers = new CDictionary<Chunk, VBuffer7>(); this.device = device; this.effect = Static.Effect; MiniMap = new Texture2D(Static.Device, 64, 64); MiniMapBuffer = new Color[64 * 64]; MiniMapLayer = new Layer(MiniMap, 1, 0.7f, LayerDock.Far, LayerDock.Far, () => true); MiniMapLayer.Push(new LayerCell { SourceTexture = new Rectangle(0, 0, 64, 64), DestinationScreen = new Rectangle(-270, -270, 256, 256) }); }
void FreeVertexBuffers(Chunk vol) { //if (vertexBuffers.ContainsKey(vol) && vertexBuffers[vol] != null) // vertexBuffers[vol].Dispose(); }
public void UpdatePosition() { chunkX = coordToChunkCoord(x); chunkY = coordToChunkCoord(y); chunkZ = coordToChunkCoord(z); UpdateMinimap(); Chunk old; for (uint zz = unchecked((uint)-3); zz != 4; zz++) for (uint xx = unchecked((uint)-3); xx != 4; xx++) for (uint yy = unchecked((uint)-3); yy != 4; yy++) { old = volume[coordToIndex(chunkX + 16 * xx), coordToIndex(chunkY + 16 * yy), coordToIndex(chunkZ + 16 * zz)]; if (old == null || old.X != chunkX + 16 * xx || old.Y != chunkY + 16 * yy || old.Z != chunkZ + 16 * zz) { if (old != null) { lock (vertexBuffers) { FreeVertexBuffers(old); vertexBuffers.Remove(old); } provider.UnregisterChunk(old.Position); } var wp = new WorldPosition { X = chunkX + 16 * xx, Y = chunkY + 16 * yy, Z = chunkZ + 16 * zz }; volume[coordToIndex(chunkX + 16 * xx), coordToIndex(chunkY + 16 * yy), coordToIndex(chunkZ + 16 * zz)] = new Chunk { Value = 0, Data = null, Position = wp }; //int dist = Math.Abs((int)zz) + Math.Abs((int)yy) + Math.Abs((int)xx); lock (chunkWishList) chunkWishList.Add(wp); } } }
void FreeVertexBuffers(Chunk vol) { return; if (vertexBuffers.ContainsKey(vol) && vertexBuffers[vol] != null) foreach (var vb in vertexBuffers[vol]) if (vb != null) vb.Dispose(); }
OctTree(Chunk c) { chunk = c; }
public void OptimizeTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren target.Optimize(); Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden."); }
public void GetTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren uint x = 0; // TODO: Passenden Wert initialisieren uint y = 0; // TODO: Passenden Wert initialisieren uint z = 0; // TODO: Passenden Wert initialisieren uint expected = 0; // TODO: Passenden Wert initialisieren uint actual; actual = target.Get(x, y, z); Assert.AreEqual(expected, actual); Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode."); }
public OctTree() { chunk = new Chunk(); }
public void ChunkConstructorTest() { Chunk target = new Chunk(); Assert.Inconclusive("TODO: Code zum Überprüfen des Ziels implementieren"); }
public void SetTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren uint x = 0; // TODO: Passenden Wert initialisieren uint y = 0; // TODO: Passenden Wert initialisieren uint z = 0; // TODO: Passenden Wert initialisieren uint value = 0; // TODO: Passenden Wert initialisieren target.Set(x, y, z, value); Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden."); }
public void ZTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren uint actual; actual = target.Z; Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode."); }
public void ToStringTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren string expected = string.Empty; // TODO: Passenden Wert initialisieren string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode."); }
public void ToDrawTest() { Chunk target = new Chunk(); // TODO: Passenden Wert initialisieren GraphicsDevice dev = null; // TODO: Passenden Wert initialisieren VertexBuffer[] expected = null; // TODO: Passenden Wert initialisieren VertexBuffer[] actual; actual = target.ToDraw(dev); Assert.AreEqual(expected, actual); Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode."); }