Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ISpace ts = new SequentialSpace(new EntityFactory());

            TerminalInfo.Initialize(80, 24);
            Game pongGame = new Game(ts);

            pongGame.AddPlayer(new AIPlayer(1, "AI1", ts));
            pongGame.AddPlayer(new AIPlayer(2, "AI2", ts));
            pongGame.Run();
            Console.ReadKey();
            pongGame.Stop();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            SpaceRepository repository = new SpaceRepository();

            repository.AddGate("tcp://127.0.0.1:123?KEEP");
            repository.AddSpace("lifeforms", new SequentialSpace(new EntityFactory()));
            TerminalInfo.Initialize(80, 24);
            Game lifeforms = new Game(repository.GetSpace("lifeforms"));

            lifeforms.Run();
            Console.ReadKey();
            lifeforms.Stop();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ISpace ts = new SequentialSpace(new EntityFactory());

            TerminalInfo.Initialize(80, 24);
            Game lifeforms = new Game(ts);

            lifeforms.AddLifeform(3, 100, 25);
            lifeforms.AddLifeform(5, 150, 25);
            lifeforms.AddLifeform(7, 90, 25);
            lifeforms.AddLifeform(11, 200, 25);
            lifeforms.AddLifeform(13, 130, 25);
            lifeforms.Run();
            Console.ReadKey();
            lifeforms.Stop();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            RemoteSpace remotespace = new RemoteSpace("tcp://127.0.0.1:123/lifeforms?KEEP", new EntityFactory());

            TerminalInfo.Initialize(80, 24);
            Game lifeforms = new Game(remotespace);

            lifeforms.AddLifeform(3);
            lifeforms.AddLifeform(5);
            lifeforms.AddLifeform(7);
            lifeforms.AddLifeform(11);
            lifeforms.AddLifeform(13);
            lifeforms.Run();
            Console.ReadKey();
            lifeforms.Stop();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Please specify player id [1|2]");
                Console.Read();
                return;
            }
            int playerId = int.Parse(args[0]);

            RemoteSpace remotespace = new RemoteSpace("tcp://127.0.0.1:123/pong?KEEP", new EntityFactory());

            TerminalInfo.Initialize(80, 24);
            Game pongGame = new Game(remotespace);

            pongGame.SetPlayer(playerId, "AI" + playerId);
            pongGame.Run();
            Console.ReadKey();
            pongGame.Stop();
        }