コード例 #1
0
        static PlayerBuilder()
        {
            AgeMapper            = ConfigBuilder.GetConfig <AgeMapper>().Get();
            ConstitutionMapper   = ConfigBuilder.GetConfig <ConstitutionMapper>().Get();
            PlayerLevelMapper    = ConfigBuilder.GetConfig <PlayerLevelMapper>().Get();
            PlayerPositionMapper = ConfigBuilder.GetConfig <PlayerPositionMapper>().Get();
            StatsGroupMapper     = ConfigBuilder.GetConfig <StatsGroupMapper>().Get();
            TalentMapper         = ConfigBuilder.GetConfig <TalentMapper>().Get();

            TalentGenerator = new RandomRangesCreator <int>(TalentMapper.Talent, TalentMapper.Percents);
            AgeGenerator    = new RandomRangesCreator <int>(AgeMapper.Age, AgeMapper.Percents);

            HeightTypeCreators = new Dictionary <PlayerPosition, RandomRangesCreator <HeightType> >();
            BodyTypeCreators   = new Dictionary <PlayerPosition, RandomRangesCreator <BodyType> >();

            foreach (var item in PlayerPositionMapper.Items)
            {
                var heightTypes    = typeof(HeightType).ToList <HeightType>();
                var bodyTypes      = typeof(BodyType).ToList <BodyType>();
                var heightPercents = new List <int>();
                var bodyPercents   = new List <int>();
                foreach (var ht in heightTypes)
                {
                    heightPercents.Add(item.HeighTypePercents[ht]);
                }
                foreach (var bt in bodyTypes)
                {
                    bodyPercents.Add(item.BodyTypePercents[bt]);
                }
                HeightTypeCreators.Add(item.PlayerPosition,
                                       new RandomRangesCreator <HeightType>(heightTypes, heightPercents));
                BodyTypeCreators.Add(item.PlayerPosition,
                                     new RandomRangesCreator <BodyType>(bodyTypes, bodyPercents));
            }
        }
コード例 #2
0
 static MatchBuilder()
 {
     LeagueMapper            = ConfigBuilder.GetConfig <LeagueMapper>().Get();
     CupMapper               = ConfigBuilder.GetConfig <CupMapper>().Get();
     MatchTimeIntervalMapper = ConfigBuilder.GetConfig <MatchTimeIntervalMapper>().Get();
 }
コード例 #3
0
 static SquadBuilder()
 {
     FormationMapper = ConfigBuilder.GetConfig <FormationMapper>().Get();
 }
コード例 #4
0
 static ClubBuilder()
 {
     StartPlayerLevelsMapper = ConfigBuilder.GetConfig <StartPlayerLevelsMapper>().Get();
 }