public void FullTriangleTest() { // Add a traingle to a hexagon, then test traingle PartData partData = new PartData(); Part player = new Part { shape = new GameObject(), type = 1 }; Part triangle = new Part { shape = new GameObject(), type = 0 }; AxialCoordinate playerCoord = new AxialCoordinate { x = 0, y = 0 }; AxialCoordinate triangleCoord = new AxialCoordinate { x = -1, y = 0 }; partData.addPart(playerCoord, player); partData.addPart(triangleCoord, triangle); // Get all full neighbours (ie, places to attach objects - there should be // 1 for a triangle) List <AxialCoordinate> neighbours = partData.getFullNeighbors(triangleCoord); // If 1 object attached, pass Assert.True(neighbours.Count == 1); }
public void FullPlayerTest() { // Add a heaxgon to player, then test player PartData partData = new PartData(); Part player = new Part { shape = new GameObject(), type = 1 }; Part hexagon = new Part { shape = new GameObject(), type = 0 }; AxialCoordinate playerCoord = new AxialCoordinate { x = 0, y = 0 }; AxialCoordinate hexCoord = new AxialCoordinate { x = -1, y = 0 }; partData.addPart(playerCoord, player); partData.addPart(hexCoord, hexagon); // Get all attached neighbours List <AxialCoordinate> neighbours = partData.getFullNeighbors(playerCoord); // If 1 attached neighbour, pass Assert.True(neighbours.Count == 1); }