예제 #1
0
파일: Tester.cs 프로젝트: perl-easj/OOProg
        public void Run()
        {
            // Create a test animal
            IAnimal anAnimal = null; // ...so this should be changed, of course :-)

            // In each iteration, the Animal should
            // 1) Act in a way that depends on its current state.
            // 2) Possibly change its state.
            for (int i = 0; i < 10; i++)
            {
                anAnimal.Act();
                anAnimal.CurrentState = GenerateAnimalState();
            }
        }