Ejemplo n.º 1
0
        public void Print()
        {
            EncryptedNumber w  = new EncryptedNumber(photo.WidthPx);
            EncryptedNumber h  = new EncryptedNumber(photo.HeightPx);
            int             ww = shutterStockDecodec.GetRealNumber(w);
            int             hh = shutterStockDecodec.GetRealNumber(h);

            System.Console.WriteLine($"{photo.Name} ({ww}x{hh})");
        }
Ejemplo n.º 2
0
        public void Print()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Dello_");
            sb.Append(photo.Name);
            EncryptedNumber w  = new EncryptedNumber(photo.WidthPx);
            EncryptedNumber h  = new EncryptedNumber(photo.HeightPx);
            int             ww = shutterStockDecodec.GetRealNumber(w);
            int             hh = shutterStockDecodec.GetRealNumber(h);

            System.Console.WriteLine($"{sb.ToString()} ({ww}x{hh})");
        }
Ejemplo n.º 3
0
        public void Print()
        {
            string n = photo.Name;

            n = n.Replace('s', 'ś');
            n = n.Replace('c', 'ć');
            EncryptedNumber w  = new EncryptedNumber(photo.WidthPx);
            EncryptedNumber h  = new EncryptedNumber(photo.HeightPx);
            int             ww = shutterStockDecodec.GetRealNumber(w);
            int             hh = shutterStockDecodec.GetRealNumber(h);

            System.Console.WriteLine($"{n} ({ww}x{hh})");
        }
Ejemplo n.º 4
0
        public PolandTrip(BookingIterator booking, TripAdvisorIterator advisor, Random random)
        {
            days = random.Next(1, 5);
            EncryptedNumber num;

            while (advice.Count < 3 * days)
            {
                while (true)
                {
                    if (advisor.HasNext)
                    {
                        TripAdvice a = advisor.GetNext;
                        if (a.Country == "Poland")
                        {
                            advice.Add(a);
                            num             = new EncryptedNumber(a.Price);
                            this.price     += tripAdvisorDecodec.GetRealNumber(num);
                            num             = new EncryptedNumber(a.Rating);
                            this.ratingSum += tripAdvisorDecodec.GetRealNumber(num);
                            break;
                        }
                    }
                    else
                    {
                        advisor.Reset();
                    }
                }
            }

            while (rooms.Count < days)
            {
                while (true)
                {
                    if (booking.HasNext)
                    {
                        ListNode r = booking.GetNext;
                        rooms.Add(r);
                        num             = new EncryptedNumber(r.Price);
                        this.price     += bookingDecodec.GetRealNumber(num);
                        num             = new EncryptedNumber(r.Rating);
                        this.ratingSum += bookingDecodec.GetRealNumber(num);
                        break;
                    }
                    else
                    {
                        booking.Reset();
                    }
                }
            }
        }