Пример #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;
        }
 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.");
 }
 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.");
 }
 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.");
 }
 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");
 }
 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.");
 }