Example #1
0
        protected override void Display()
        {
            var redName  = red.GetAttribute <NameAttribute>().Name;
            var blueName = blue.GetAttribute <NameAttribute>().Name;

            Console.ForegroundColor = ConsoleColor.White;
            WriteCenteredText("=====COMPETITION SETTINGS=====");
            NewLine();

            Console.ForegroundColor = ConsoleColor.Red;
            WriteText(redName);

            Console.ForegroundColor = ConsoleColor.Green;
            WriteCenteredText("VS.");

            Console.ForegroundColor = ConsoleColor.Blue;
            AlignToCoord(Width - blueName.Length - 1, CurrentY);
            WriteText(blueName);
            NewLine();

            Console.ForegroundColor = ConsoleColor.White;
            WriteCenteredText("Review the available settings for this matchup.");
            NewLine(2);
            layout.Display();
        }
Example #2
0
        protected override void Display()
        {
            Console.ForegroundColor = ConsoleColor.White;
            WriteCenteredText("=====COMPETITION RESULTS=====");
            NewLine(2);

            WriteCenteredText(string.Format("{0}                 vs.               {1}", competition.Players.First(), competition.Players.Last()));
            NewLine();
            WriteCenteredText(string.Format("{0} wins                                   {1} wins", competition.Players.First().Wins, competition.Players.Last().Wins));

            NewLine();

            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.BackgroundColor = ConsoleColor.White;
            WriteCenteredText("POST SUMMARY");
            NewLine();
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.White;

            WriteCenteredText(string.Format("{0} total games played", competition.NumberOfRounds));
            NewLine();

            var shotBots = new List <int>();
            var hitBots  = new List <int>();

            shotBots.AddRange(new int[] { 0, 0 });
            hitBots.AddRange(new int[] { 0, 0 });
            Event lastEvent = null;

            foreach (var ev in competition.Events)
            {
                var shotEvent = ev as PlayerShotEvent;
                var hitEvent  = ev as ShipHitEvent;
                if (shotEvent != null)
                {
                    shotBots[shotEvent.Player.ID]++;
                }
                else if (hitEvent != null)
                {
                    hitBots[hitEvent.Ship.Owner.ID]++;
                }
                lastEvent = ev;
            }
            for (int i = 0; i < 2; i++)
            {
                shotBots[i] /= competition.NumberOfRounds;
                hitBots[i]  /= competition.NumberOfRounds;
            }
            WriteCenteredText(string.Format("{0}     shots on average     {1}", shotBots[0], shotBots[1]));
            NewLine();
            WriteCenteredText(string.Format("{0}     hits on average      {1}", hitBots[0], hitBots[1]));
            NewLine();
            WriteCenteredText(string.Format("{0}     misses on average    {1}", shotBots[0] - hitBots[0], shotBots[1] - hitBots[1]));
            NewLine(2);
            buttonLayout.Display();
        }
Example #3
0
 protected override void Display()
 {
     Console.ForegroundColor = ConsoleColor.Red;
     WriteCenteredText("Version: 0.81  Date: Jan 24, 2015");
     NewLine();
     Console.ForegroundColor = ConsoleColor.Gray;
     WriteCenteredText("=====MAIN MENU=====");
     NewLine(2);
     WriteCenteredText("This is the MBC Main Menu.");
     NewLine();
     WriteCenteredText("Use the arrow keys to navigate menus.");
     NewLine(2);
     menuLayout.Display();
 }
Example #4
0
 protected override void Display()
 {
     WriteCenteredText("=====BOT SELECTION=====");
     NewLine(2);
     WriteCenteredText("Select two controllers from the list below.");
     NewLine();
     Console.ForegroundColor = ConsoleColor.Red;
     WriteText("Red Controller:");
     AlignToCoord(Width - "Blue Controller:".Length, CurrentY);
     Console.ForegroundColor = ConsoleColor.Blue;
     WriteText("Blue Controller:");
     redList.Display();
     blueList.Display();
     buttonConfirmLayout.Display();
 }
        protected override void Display()
        {
            Console.ForegroundColor = ConsoleColor.White;
            WriteCenteredText("=====CONFIGURATION MANAGER=====");
            NewLine(2);

            if (error != null)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                WriteCenteredText("There was an error while setting the value for " + error);
            }
            else
            {
                WriteCenteredText("Review and modify configuration associations to determine application behaviour.");
            }
            Console.ForegroundColor = ConsoleColor.White;
            NewLine();
            leftLayout.Display();
            rightLayout.Display();
            centerLayout.Display();
        }