public override void Initialize()
 {
     _buffer.WriteLine("Create Team");
     _buffer.WriteLine();
     _buffer.Seperator();
     _buffer.WriteLine();
 }
Esempio n. 2
0
        public override void Initialize()
        {
            _buffer.WriteLine("Create Player");
            _buffer.WriteLine();
            //_buffer.WriteLine(_menu.ToString());
            _buffer.Seperator();
            _buffer.WriteLine();

            _form = new Form(
                new Question("First Name?", x => Controller.Player.FirstName = x)
                .Required("First Name is required"),

                new Question("Last Name?", x => Controller.Player.LastName = x)
                .Required("Last Name is required"),

                new Question("Birthdate?", x => Controller.Player.BirthDate = DateTime.Parse(x))
                .Date()
                .Required("Age is required"),

                new Question("Number?", x => Controller.Player.Number = int.Parse(x))
                .Number()
                .Required("Number is required"),

                new InputList(
                    "Team?",
                    Controller.Teams.OrderBy(x => x.Name).Select(x => x.Name).ToArray(),
                    x =>
            {
                Controller.Player.Team =
                    Controller.Teams.FirstOrDefault(t => t.Name == x);
            }));
        }
 public override void Initialize()
 {
     base.Initialize();
     _buffer.WriteLine("Player");
     _buffer.WriteLine();
     _buffer.WriteLine(_menu.ToString());
     _buffer.Seperator();
     _buffer.WriteLine();
     _buffer.WriteLine(Controller.Player?.ToString());
 }
Esempio n. 4
0
 public HeaderView()
 {
     _buffer = new Buffer();
     Content = _buffer;
     _buffer.WriteLine("Major Leage Miruken");
     _buffer.WriteLine();
     _menu = new Menu(
         new MenuItem("Teams", ConsoleKey.T, () => Controller.GoToTeams()),
         new MenuItem("Players", ConsoleKey.P, () => Controller.GoToPlayers()));
     _buffer.Write(_menu.ToString());
 }
Esempio n. 5
0
        public override void Initialize()
        {
            _selectList = new SelectList <Team>(
                Controller.Teams,
                team => { Controller.GoToTeam(team); });

            _buffer.WriteLine("Teams");
            _buffer.WriteLine();
            _buffer.WriteLine(_menu.ToString());
            _buffer.Seperator();
            _buffer.WriteLine();
            _buffer.WriteLine(_selectList.ToString());
        }
Esempio n. 6
0
        public override void Initialize()
        {
            _buffer.WriteLine("Edit Team");
            _buffer.WriteLine();
            _buffer.Seperator();
            _buffer.WriteLine();

            _form = new Form(
                new Question(
                    "Team Name:",
                    Controller.Team.Name,
                    x => Controller.Team.Name = x)
                .Required("Team Name is required"),

                new InputList(
                    "Team Color?",
                    Controller.Team.TeamColor.ToString(),
                    Enum.GetNames(typeof(Color)),
                    x =>
            {
                Color color;
                if (Enum.TryParse(x, out color))
                {
                    Controller.Team.TeamColor = color;
                }
            }),

                new Question(
                    "Manager First Name?",
                    Controller.Team.Manager.FirstName,
                    x => Controller.Team.Manager.FirstName = x)
                .Required("Manager First Name is required"),

                new Question(
                    "Manager Last Name?",
                    Controller.Team.Manager.LastName,
                    x => Controller.Team.Manager.LastName = x)
                .Required("Manager Last Name is required"),

                new Question(
                    "Coach First Name?",
                    Controller.Team.Coach.FirstName,
                    x => Controller.Team.Coach.FirstName = x)
                .Required("Coach First Name is required"),

                new Question(
                    "Coach Last Name?",
                    Controller.Team.Coach.LastName,
                    x => Controller.Team.Coach.LastName = x)
                .Required("Coach Last Name is required"));
        }
        public override void Initialize()
        {
            base.Initialize();
            _selectList = new SelectList <Player>(
                Controller.Players,
                player => { Controller.GoToPlayer(player); });

            _buffer.WriteLine("Players");
            _buffer.WriteLine();
            _buffer.WriteLine(_menu.ToString());
            _buffer.Seperator();
            _buffer.WriteLine();
            _buffer.WriteLine(_selectList.ToString());
        }