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);
        }
Пример #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);
     }
 }
Пример #3
0
 public Terrain(NinjaGame game)
     : base(game)
 {
 }
Пример #4
0
 public GameObject(NinjaGame game)
 {
     Game = game;
 }
Пример #5
0
 public Player(NinjaGame game)
     : base(game)
 {
 }