public void TranslateRowTest() { var mapSettings = new Installer.Settings.MapSettings(); mapSettings.rows = 8; mapSettings.columns = 10; var boardTranslator = new BoardTranslator(mapSettings); Assert.AreEqual(2, boardTranslator.translateRow(6)); Assert.AreEqual(-4, boardTranslator.translateRow(0)); }
private void SetupBoard() { for (int x = 0; x < columns; x++) { for (int y = 0; y < rows; y++) { GameObject grassObject = Instantiate(tiles.grassTile, new Vector3(translator.translateRow(x), translator.translateColumn(y), 0f), Quaternion.identity) as GameObject; grassObject.isStatic = true; grassObject.transform.SetParent(boardHolder); } } }
public GameObject SetupOrigin(OriginNode origin) { Direction direction = StringToDirection(origin.direction); Coordinate coords = origin.coords; return(Instantiate(tiles.cfcTile, new Vector3(translator.translateRow(coords.x), translator.translateColumn(coords.y), 0f), Quaternion.Euler(0, 0, (float)direction)) as GameObject); }