Example #1
0
        public void makeDeal(exchange exchange, int moneyd)
        {
            reRatingCont();
            deal deal = new deal(this, moneyd);

            ContractorDeals.Add(deal);
            exchange.bid(deal);
        }
        static void Main(string[] args)
        {
            exchange temp   = new exchange();
            protocol hendl1 = new protocol();
            audit    hend2  = new audit();

            temp.onPattern += hendl1.prot;
            temp.onPattern += hend2.doaudit;
            temp.onPattern += temp.deal;
            temp.bid("123", 7, 1, true);
            temp.bid("123", 1, 3, false);
            temp.bid("123", 5, 10, false);
            temp.bid("123", 3, 3, true);
            temp.bid("123", 9, 2, true);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Random     r        = new Random(DateTime.Now.Millisecond);
            exchange   exchange = new exchange();
            Contractor cont;

            for (int i = 0; i < 1000; i++)
            {
                cont = Contractor.Contactors("contactor" + i.ToString(), r.Next(0, 10));
                cont.makeDeal(exchange, r.Next(0, 20000));
            }
            for (int i = 0; i < 1000; i++)
            {
                cont = Contractor.Contactors("contactor" + i.ToString(), r.Next(0, 10));
                cont.makeDeal(exchange, r.Next(0, 20000));
            }
            exchange.statistic();

            Console.ReadLine();
        }