示例#1
0
        public FMDraft.Library.Entities.Team ToData()
        {
            var team = new Library.Entities.Team()
            {
                Name            = Name,
                BackgroundColor = BackgroundColor,
                ForegroundColor = ForegroundColor,
                DraftOrder      = DraftOrder,
                City            = City,
                DraftCards      = DraftCards.Select(x => x.ToData()),
                Stadium         = new Stadium()
                {
                    Attendances = StadiumAttendances,
                    Name        = StadiumName
                }
            };

            if (HumanControlled)
            {
                team.ManagerMode = ManagerMode.Player;
            }
            else
            {
                team.ManagerMode = ManagerMode.CPU;

                if (Manager != null)
                {
                    team.Manager = new Library.Entities.Manager()
                    {
                        ID       = Manager.ID,
                        FullName = Manager.Name
                    };
                }
            }

            return(team);
        }
 public IEnumerable <DraftCard> ToData()
 {
     return(DraftCards.Select(vm => vm.ToData()));
 }