Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            Vector2 numTiles = new Vector2(80, 80);
            Vector2 tileSize = new Vector2(5, 5);
            nodes = new List<Panel>();
            tileTypes = new List<TileType>();
            tileTypes.Add(TileType.Walkable);
            tileTypes.Add(TileType.Blocked);
            tileTypes.Add(TileType.Start);
            tileTypes.Add(TileType.Goal);

            Panel panel;
            for (int y = 0; y < numTiles.Y; y++)
            {
                for (int x = 0; x < numTiles.X; x++)
                {
                    panel = new Panel();
                    panel.MouseDown += panel33_MouseDown;
                    panel.BorderStyle = BorderStyle.FixedSingle;
                    this.Controls.Add(panel);
                    nodes.Add(panel);
                }
            }
            tileMap = new TileMap(new Vector2(250, 250), numTiles, tileSize, nodes);

            findPathBtn.Enabled = false;
        }
Ejemplo n.º 2
0
 public void ClearPathTest()
 {
     Vector2 position = null; // TODO: Initialize to an appropriate value
     Vector2 numTiles = null; // TODO: Initialize to an appropriate value
     Vector2 tileSize = null; // TODO: Initialize to an appropriate value
     IList<Panel> panels = null; // TODO: Initialize to an appropriate value
     TileMap target = new TileMap(position, numTiles, tileSize, panels); // TODO: Initialize to an appropriate value
     target.ClearPath();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 3
0
 public void GetTileFromPanelTest()
 {
     Vector2 position = null; // TODO: Initialize to an appropriate value
     Vector2 numTiles = null; // TODO: Initialize to an appropriate value
     Vector2 tileSize = null; // TODO: Initialize to an appropriate value
     IList<Panel> panels = null; // TODO: Initialize to an appropriate value
     TileMap target = new TileMap(position, numTiles, tileSize, panels); // TODO: Initialize to an appropriate value
     Panel panel = null; // TODO: Initialize to an appropriate value
     Tile expected = null; // TODO: Initialize to an appropriate value
     Tile actual;
     actual = target.GetTileFromPanel(panel);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 4
0
 public void TilesTest()
 {
     Vector2 position = null; // TODO: Initialize to an appropriate value
     Vector2 numTiles = null; // TODO: Initialize to an appropriate value
     Vector2 tileSize = null; // TODO: Initialize to an appropriate value
     IList<Panel> panels = null; // TODO: Initialize to an appropriate value
     TileMap target = new TileMap(position, numTiles, tileSize, panels); // TODO: Initialize to an appropriate value
     IList<Tile> actual;
     actual = target.Tiles;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 5
0
 public void TileMapConstructorTest()
 {
     Vector2 position = null; // TODO: Initialize to an appropriate value
     Vector2 numTiles = null; // TODO: Initialize to an appropriate value
     Vector2 tileSize = null; // TODO: Initialize to an appropriate value
     IList<Panel> panels = null; // TODO: Initialize to an appropriate value
     TileMap target = new TileMap(position, numTiles, tileSize, panels);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 6
0
 public void GetWalkableNeighborsTest1()
 {
     Vector2 position = null; // TODO: Initialize to an appropriate value
     Vector2 numTiles = null; // TODO: Initialize to an appropriate value
     Vector2 tileSize = null; // TODO: Initialize to an appropriate value
     IList<Panel> panels = null; // TODO: Initialize to an appropriate value
     TileMap target = new TileMap(position, numTiles, tileSize, panels); // TODO: Initialize to an appropriate value
     Tile tile = null; // TODO: Initialize to an appropriate value
     List<Tile> expected = null; // TODO: Initialize to an appropriate value
     List<Tile> actual;
     actual = target.GetWalkableNeighbors(tile);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }