示例#1
0
 private void AddCatsNumber(TextObject obj)
 {
     this.catsNumber = obj as CatsNumber;
 }
        private static void InitializeGamePlayersAndResults(Engine engine)
        {
            Console.Title = "UnstoppableMickey © Team Mickey Mouse";

            // Controlled object
            engine.AddObject(Factory.CreateObject(Factory.ObjectType.Mickey, new Position(16, 15)));

            // Initial moving objects
            engine.AddObject(Factory.CreateObject(Factory.ObjectType.Cat, new Position(2, 2), Position.RandomDirection()));
            engine.AddObject(Factory.CreateObject(Factory.ObjectType.Cat, new Position(2, 39), Position.RandomDirection()));
            engine.AddObject(Factory.CreateObject(Factory.ObjectType.Cat, new Position(29, 2), Position.RandomDirection()));
            engine.AddObject(Factory.CreateObject(Factory.ObjectType.Cat, new Position(29, 39), Position.RandomDirection()));

            // Result objects
            CatsNumber catsNumber = new CatsNumber(new Position(31, 32), "Cats", ConsoleColor.Yellow);
            Points points = new Points(new Position(31, 1), "Points", ConsoleColor.Green);
            engine.AddObject(catsNumber);
            engine.AddObject(points);
        }