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