public void TranslateColumnTest()
        {
            var mapSettings = new Installer.Settings.MapSettings();

            mapSettings.rows    = 10;
            mapSettings.columns = 8;
            var boardTranslator = new BoardTranslator(mapSettings);

            Assert.AreEqual(2, boardTranslator.translateToSceneColumn(6));
            Assert.AreEqual(-4, boardTranslator.translateToSceneColumn(0));
        }
Пример #2
0
        public void Setup()
        {
            _container = new DiContainer();
            var mapSettings = new Installer.Settings.MapSettings();

            mapSettings.columns = 0;
            mapSettings.rows    = 0;
            var translatorMock = new BoardTranslator(mapSettings);

            var roadTilesMock = new Installer.Settings.RoadTiles();

            roadTilesMock.cfcTile          = new GameObject("CFC");
            roadTilesMock.deadEndRoadTile  = new GameObject("DeadEnd");
            roadTilesMock.turnRoadTile     = new GameObject("Turn");
            roadTilesMock.straightRoadTile = new GameObject("Straight");
            roadTilesMock.crossRoadTile    = new GameObject("CrossRoad");
            roadTilesMock.tJunctionTile    = new GameObject("TJunction");

            _container.BindInstance(translatorMock);
            _container.BindInstance(roadTilesMock);
            _container.Bind <RoadDrawer>().ToSingleGameObject();
        }
Пример #3
0
 public BoardTranslator(Installer.Settings.MapSettings mapDimensions)
 {
     this.mapDimensions = mapDimensions;
     halfRows           = mapDimensions.rows / 2f;
     halfColumns        = mapDimensions.columns / 2f;
 }