AnimalBehavior.Tester.Run C# (CSharp) Метод

Run() публичный Метод

public Run ( ) : void
Результат void
        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();
            }
        }

Usage Example

Пример #1
0
        static void Main(string[] args)
        {
            Tester aTester = new Tester();

            aTester.Run();

            Wait();
        }