Exemplo n.º 1
0
        public void Move()
        {
            bool hidden = false;

            while (!hidden)
            {
                if (myLocation is IHatAußentür)
                {
                    IHatAußentür locationWithDoor = myLocation as IHatAußentür;
                    if (random.Next(2) == 1)
                    {
                        myLocation = locationWithDoor.TürOrt;
                    }
                }

                int rand = random.Next(myLocation.Ausgänge.Length);
                myLocation = myLocation.Ausgänge[rand];

                if (myLocation is IHidingPlace)
                {
                    hidden = true;
                }
            }
        }
Exemplo n.º 2
0
        private void durchTürGehen_Click(object sender, EventArgs e)
        {
            IHatAußentür mitTür = aktuellerOrt as IHatAußentür;

            ZuOrtGehen(mitTür.TürOrt);
        }