Exemplo n.º 1
0
        public static void Main()
        {
            //create a miner
            Miner bob = new Miner(0);

            //create his wife
            MinersWife elsa = new MinersWife(1);

            // create Bar's Fly
            Fly fly = new Fly(2);


            //register them with the entity manager
            EntityManager.Instance.RegisterEntity(bob);
            EntityManager.Instance.RegisterEntity(elsa);
            EntityManager.Instance.RegisterEntity(fly);

            //run Bob and Elsa through a few Update calls
            for (int i = 0; i < 50; i++)
            {
                bob.Update();
                elsa.Update();
                fly.Update();
                MessageDispatcher.Instance.DispatchDelayedMessages();
                System.Threading.Thread.Sleep(500);
            }
        }
Exemplo n.º 2
0
        public static void Main()
        {
            TextWriterTraceListener tr1 = new TextWriterTraceListener(System.Console.Out);

            Debug.Listeners.Add(tr1);

            //create a miner
            Miner bob = new Miner(0);

            //create his wife
            MinersWife elsa = new MinersWife(1);

            //register them with the entity manager
            EntityManager.Instance.RegisterEntity(bob);
            EntityManager.Instance.RegisterEntity(elsa);

            //run Bob and Elsa through a few Update calls
            for (int i = 0; i < 20; i++)
            {
                bob.Update();
                elsa.Update();
                MessageDispatcher.Instance.DispatchDelayedMessages();
                System.Threading.Thread.Sleep(500);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Miner      miner      = new Miner();
            MinersWife minersWife = new MinersWife();

            miner.Wife         = minersWife;
            minersWife.Husband = miner;
            for (int i = 0; i < 40; i++)
            {
                miner.Update();
                minersWife.Update();
                MessageBroker.Instance.DispatchDelayedMessages();
                Thread.Sleep(500);
                Console.WriteLine();
            }
        }