コード例 #1
0
        public void Construct(PieceData pieceData)
        {
            this.pieceData = pieceData;
            text.text      = pieceData.Text;
            GridItemMover gridItemMover = GetComponent <GridItemMover>();

            gridItemMover.SetupRownAndColumn(pieceData.PlaceInGrid, 0, 0);
        }
コード例 #2
0
        public void SetupGridItemMoverRowAndColumn()
        {
            int           row           = 1;
            int           column        = 2;
            GridItemMover gridItemMover = CreateGridItemMover();

            gridItemMover.SetupRownAndColumn(0, row, column);

            Assert.AreEqual(row, gridItemMover.Row);
            Assert.AreEqual(column, gridItemMover.Column);
        }
コード例 #3
0
        private void CreateGridItemToPlaceRowAndColumn(int place, int column, int row)
        {
            GameObject girdItemObject = gridItemFactory.Create();

            girdItemObject.name = row + "x" + column;
            GridItemMover gridItemMover = girdItemObject.GetComponent <GridItemMover>();

            gridItemMover.Position = positioningStrategy.GetGridItemPositionByRowAndColum(row, column);
            gridItemMover.SetupRownAndColumn(place, row, column);
            GridItemObjects.Add(girdItemObject);
        }
コード例 #4
0
        public void PieceCreation()
        {
            int initialGridItemRow   = 1;
            int initialGridItemColum = 2;

            GridItemMover gridItemMover = CreateGridItemMover();

            gridItemMover.SetupRownAndColumn(0, initialGridItemRow, initialGridItemColum);
            PieceImplementation piece = new PieceImplementation(gridItemMover);

            Assert.AreEqual(initialGridItemRow, piece.Row);
            Assert.AreEqual(initialGridItemColum, piece.Column);
        }