Esempio n. 1
0
        static void Main(string[] args)
        {
            _tracer = new Tracer();
            MainExample first = new MainExample(_tracer);

            first.Execution();
            ExtraExample second = new ExtraExample(_tracer);

            second.Life();

            Thread deathThread = new Thread(first.Death);

            deathThread.Start();
            Thread breatheThread = new Thread(second.Breathe);

            breatheThread.Start();

            deathThread.Join();
            breatheThread.Join();

            first.Death();
            second.Eat();

            TraceResult result = _tracer.GetTraceResult();

            OutputResults(result);
        }
Esempio n. 2
0
 public MainExample(ITracer tracer)
 {
     _tracer = tracer;
     _extra  = new ExtraExample(tracer);
     rand    = new Random();
 }