Exemplo n.º 1
0
        public override bool Equals(object other)
        {
            if (!(other is Digit))
            {
                return(false);
            }

            Digit that = (Digit)other;

            return(this.digit == that.digit);
        }
        private Digit Scale(Digit digit, Scaling scaling)
        {
            if (digit == null)
            {
                throw new ArgumentNullException(nameof(digit));
            }
            if (scaling == null)
            {
                throw new ArgumentNullException(nameof(scaling));
            }

            if (scaling.HasNone())
            {
                return(digit);
            }

            List <Line> scaled = new List <Line>();

            bool oddLine = true;

            foreach (Line line in digit.Lines())
            {
                Line scaledLine = line.ScaleHorizontal(repeater, scaling);
                if (oddLine)
                {
                    scaled.Add(scaledLine);
                }
                else
                {
                    scaled.AddRange(repeater.Repeat(scaledLine, scaling));
                }
                oddLine = !oddLine;
            }

            return(digit.Scale(scaled));
        }