Ejemplo n.º 1
0
        private IDerivation ExpandInternal(int aMin, int aMax, DerivationContext aContext)
        {
            ListDerivation lList = new ListDerivation(true, aContext);

            int rest = 0;

            if (aMax != int.MaxValue)
            {
                rest = mRnd.Next(aMax - aMin + 1);
            }
            for (int i = 0; i < aMin + rest; i++)
            {
                lList.Add(Phrase.Expand(aContext));
            }
            //есил 5..* генерим, пока не выпадет орел :)
            if (aMax == int.MaxValue)
            {
                while (mRnd.Next(2) >= 1)
                {
                    lList.Add(Phrase.Expand(aContext));
                }
            }
            return(lList);
        }