当前位置: 首页>>代码示例>>C#>>正文


C# RepositoryFactory.GetPassing方法代码示例

本文整理汇总了C#中RepositoryFactory.GetPassing方法的典型用法代码示例。如果您正苦于以下问题:C# RepositoryFactory.GetPassing方法的具体用法?C# RepositoryFactory.GetPassing怎么用?C# RepositoryFactory.GetPassing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RepositoryFactory的用法示例。


在下文中一共展示了RepositoryFactory.GetPassing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddSkillsToProfile

        private void AddSkillsToProfile(
         PlayerProfile playerProfile,
         ProfileSkillPriority goalkeeping,
         ProfileSkillPriority defending,
         ProfileSkillPriority passing,
         ProfileSkillPriority speed,
         ProfileSkillPriority shooting,
         ProfileSkillPriority heading,
         ProfileSkillPriority tactics,
         ProfileSkillPriority fitness,
         ProfileSkillPriority talent,
         ProfileSkillPriority technique,
         ProfileSkillPriority form,
         ProfileSkillPriority confidence)
        {
            playerProfile.PlayerProfileSkills = new List<PlayerProfileSkill>();

             // Note: in the order the skills are added here also causes the order of skills for the player.

             using (var playerSkillRepository = new RepositoryFactory().CreatePlayerSkillRepository())
             {
            // Add Goalkeeping skill.
            var playerSkill = playerSkillRepository.GetGoalkeeping();
            var profileSkill = new PlayerProfileSkill(playerSkill, goalkeeping);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Defending skill.
            playerSkill = playerSkillRepository.GetDefending();
            profileSkill = new PlayerProfileSkill(playerSkill, defending);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Passing skill.
            playerSkill = playerSkillRepository.GetPassing();
            profileSkill = new PlayerProfileSkill(playerSkill, passing);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Speed skill.
            playerSkill = playerSkillRepository.GetSpeed();
            profileSkill = new PlayerProfileSkill(playerSkill, speed);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Technique skill.
            playerSkill = playerSkillRepository.GetTechnique();
            profileSkill = new PlayerProfileSkill(playerSkill, technique);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Shooting skill.
            playerSkill = playerSkillRepository.GetShooting();
            profileSkill = new PlayerProfileSkill(playerSkill, shooting);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Heading skill.
            playerSkill = playerSkillRepository.GetHeading();
            profileSkill = new PlayerProfileSkill(playerSkill, heading);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Tactics skill.
            playerSkill = playerSkillRepository.GetTactics();
            profileSkill = new PlayerProfileSkill(playerSkill, tactics);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Talent skill.
            playerSkill = playerSkillRepository.GetTalent();
            profileSkill = new PlayerProfileSkill(playerSkill, talent);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Fitness skill.
            playerSkill = playerSkillRepository.GetFitness();
            profileSkill = new PlayerProfileSkill(playerSkill, fitness);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Form skill.
            playerSkill = playerSkillRepository.GetForm();
            profileSkill = new PlayerProfileSkill(playerSkill, form);
            playerProfile.PlayerProfileSkills.Add(profileSkill);

            // Add Confidence skill.
            playerSkill = playerSkillRepository.GetConfidence();
            profileSkill = new PlayerProfileSkill(playerSkill, confidence);
            playerProfile.PlayerProfileSkills.Add(profileSkill);
             }
        }
开发者ID:bouwe77,项目名称:fmg,代码行数:82,代码来源:InMemoryData.cs


注:本文中的RepositoryFactory.GetPassing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。