Example #1
0
        public ICard CreateCardPrototype(ICard card, IRandomNumbersGenerator randomNumbersGenerator)
        {
            var rowNumber    = gameDataSetting.GetCardData().GetRowNumber();
            var columnNumber = gameDataSetting.GetCardData().GetColumnNumber();
            var fillerCard   = new DataFiller(card);

            for (int i = 0; i < columnNumber; i++)
            {
                var numbers = randomNumbersGenerator.GenerateDistinctRandomNumbers(columnRangeGetter.GetRangeForColumn(i), rowNumber);
                fillerCard.FillData(numbers, i);
            }

            return(card);
        }
        public ICard InjectSpace(ICard card, IGameConfiguration gameDataSetting)
        {
            var rowNumber      = gameDataSetting.GetCardData().GetRowNumber();
            var columnNumber   = gameDataSetting.GetCardData().GetColumnNumber();
            var spacesInjector = new CardSpaceFiller(card);

            for (int i = 0; i < rowNumber; i++)
            {
                var columnPositions = generator.GenerateDistinctRandomNumbers(new Range(1, columnNumber), 4);
                spacesInjector.FillData(columnPositions, i);
            }

            return(card);
        }
Example #3
0
        public ICard InjectSpace(ICard card, IGameConfiguration gameDataSetting)
        {
            var columnNumber = gameDataSetting.GetCardData().GetColumnNumber();
            var rowNumber    = gameDataSetting.GetCardData().GetRowNumber();

            decimal columnDivision = columnNumber / 2;
            decimal rowDivision    = rowNumber / 2;

            var middleColumn = Math.Floor(columnDivision);
            var middleRow    = Math.Floor(rowDivision);
            var cardBoard    = card.GetCardBoard();

            cardBoard[decimal.ToInt32(middleColumn), decimal.ToInt32(middleRow)].SetVelueOfCell(" * ");

            return(card);
        }