private static void Main()
        {
            input = new StandardInput();
            IKeyReader keyReader = new InputArrowKeyReader(input);

            output  = new StandardOutput();
            players = new Dictionary <char, IPlayer>();

            string p1name = input.ReadLine();

            players.Add(p1name[0], CreatePlayer(p1name));

            string p2name = input.ReadLine();

            players.Add(p2name[0], CreatePlayer(p2name));

            int[] dimensions = input.ReadLine().Split().Select(int.Parse).ToArray();
            int   rows       = dimensions[0];
            int   cols       = dimensions[1];

            IGrid <IInteractable, IPlayer> grid = new NinjaGrid <IInteractable, IPlayer>(rows, cols);

            PopulateGrid(rows, cols, grid);

            IGame game = new NinjaGame(players[p1name[0]], players[p2name[0]], grid, keyReader);

            game.Start();

            PrintWinner(game.Winner);
        }
Exemplo n.º 2
0
 public void DebugDraw(SpriteBatch spriteBatch, NinjaGame game, Vector2 position)
 {
     for (int index = 0; index < VertexList.Count; index++)
     {
         spriteBatch.DrawString(game.DebugFont, VertexList[index].ToString(),
             position + 50 * index * Vector2.UnitY,
             Color.Orange);
     }
 }
Exemplo n.º 3
0
 public Terrain(NinjaGame game)
     : base(game)
 {
 }
Exemplo n.º 4
0
 public GameObject(NinjaGame game)
 {
     Game = game;
 }
Exemplo n.º 5
0
 public Player(NinjaGame game)
     : base(game)
 {
 }