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


C# Dice类代码示例

本文整理汇总了C#中Dice的典型用法代码示例。如果您正苦于以下问题:C# Dice类的具体用法?C# Dice怎么用?C# Dice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AssignmentSkills

        internal override void AssignmentSkills(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    character.Skills.Increase("Mechanic");
                    return;
                case 2:
                    character.Skills.Increase(dice.Choose(SpecialtiesFor("Drive")));
                    return;
                case 3:
                    character.Skills.Increase(dice.Choose(SpecialtiesFor("Flyer")));
                    return;
                case 4:
                    character.Skills.Increase("Recon");
                    return;
                case 5:
                    character.Skills.Increase("Heavy Weapons", "Vehicle");

                    return;
                case 6:
                    character.Skills.Increase("Electronics", "Sensors");
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:25,代码来源:Army.Cavalry.cs

示例2: Category

 public Category(string title, IRule rule, Turn turn, Dice dice)
 {
     Title = title;
     _rule = rule;
     _turn = turn;
     _dice = dice;
 }
开发者ID:Gryff,项目名称:yahtzee-kata,代码行数:7,代码来源:Category.cs

示例3: TitleTable

 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 1:
             return;
         case 2:
             careerHistory.Title = "Settler";
             character.Skills.Add("Survival", 1);
             return;
         case 3:
             return;
         case 4:
             careerHistory.Title = "Explorer";
             character.Skills.Add("Navigation", 1);
             return;
         case 5:
             return;
         case 6:
             {
                 var skillList = new SkillTemplateCollection(SpecialtiesFor("Gun Combat"));
                 skillList.RemoveOverlap(character.Skills, 1);
                 if (skillList.Count > 0)
                     character.Skills.Add(dice.Choose(skillList), 1);
             }
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:28,代码来源:Citizen.Colonist.cs

示例4: TitleTable

 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 1:
             return;
         case 2:
             careerHistory.Title = "Technician";
             {
                 var skillList = new SkillTemplateCollection(SpecialtiesFor("Profession"));
                 skillList.RemoveOverlap(character.Skills, 1);
                 if (skillList.Count > 0)
                     character.Skills.Add(dice.Choose(skillList), 1);
             }
             return;
         case 3:
             return;
         case 4:
             careerHistory.Title = "Craftsman";
             character.Skills.Add("Mechanic", 1);
             return;
         case 5:
             return;
         case 6:
             careerHistory.Title = "Master Technician";
             {
                 var skillList = new SkillTemplateCollection(SpecialtiesFor("Engineer"));
                 skillList.RemoveOverlap(character.Skills, 1);
                 if (skillList.Count > 0)
                     character.Skills.Add(dice.Choose(skillList), 1);
             }
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:34,代码来源:Citizen.Worker.cs

示例5: Awake

 private void Awake()
 {
     List<Teleporter> teleporters = new List<Teleporter>() { new Teleporter(2, 12), new Teleporter(8, 3) };
     int finalPosition = 100;
     Dice dice = new Dice();
     board = new Board(dice, teleporters, finalPosition);
 }
开发者ID:juanesmp,项目名称:TDD-SnakeAndLadder,代码行数:7,代码来源:UI.cs

示例6: TitleTable

 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 0:
             careerHistory.Title = "Assistant";
             return;
         case 1:
             careerHistory.Title = "Clerk";
             character.Skills.Add("Admin", 1);
             return;
         case 2:
             careerHistory.Title = "Supervisor";
             return;
         case 3:
             careerHistory.Title = "Manager";
             character.Skills.Add("Advocate", 1);
             return;
         case 4:
             careerHistory.Title = "Chief";
             return;
         case 5:
             careerHistory.Title = "Director";
             character.Skills.Add("Leadership", 1);
             return;
         case 6:
             careerHistory.Title = "Minister";
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:30,代码来源:Noble.Administrator.cs

示例7: TitleTable

 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 0:
             careerHistory.Title = "Wastrel";
             return;
         case 1:
             return;
         case 2:
             careerHistory.Title = "Ingrate";
             character.Skills.Add("Carouse", 1);
             return;
         case 3:
             return;
         case 4:
             careerHistory.Title = "Black Sheep";
             character.Skills.Add("Persuade", 1);
             return;
         case 5:
             return;
         case 6:
             careerHistory.Title = "Scoundrel";
             character.Skills.Add("Jack-of-all-Trades", 1);
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:27,代码来源:Noble.Dilettante.cs

示例8: SetUp

 public void SetUp()
 {
     _turn = Substitute.For<Turn>();
     _dice = Substitute.For<Dice>();
     _onesRule = Substitute.For<IRule>();
     _category = new Category("Ones", _onesRule, _turn, _dice);
 }
开发者ID:Gryff,项目名称:yahtzee-kata,代码行数:7,代码来源:CategoryShould.cs

示例9: Game

 public Game(GameBoard gameBoard, Dice dice)
 {
     this.gameBoard = gameBoard;
     this.dice = dice;
     this.players = new List<Player>();
     this.shuffler = new Shuffler<Player>();
 }
开发者ID:kawillia,项目名称:MonopolyKata,代码行数:7,代码来源:Game.cs

示例10: TitleTable

 /// <summary>
 /// Titles the table.
 /// </summary>
 /// <param name="character">The character.</param>
 /// <param name="careerHistory">The career history.</param>
 /// <param name="dice">The dice.</param>
 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 0:
             return;
         case 1:
             careerHistory.Title = "Freelancer";
             character.Skills.Add("Electronics", "Comms", 1);
             return;
         case 2:
             careerHistory.Title = "Staff Writer";
             character.Skills.Add("Investigate", 1);
             return;
         case 3:
             return;
         case 4:
             careerHistory.Title = "Correspondent";
             character.Skills.Add("Persuade", 1);
             return;
         case 5:
             return;
         case 6:
             careerHistory.Title = "Senior Correspondent";
             character.SocialStanding += 1;
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:34,代码来源:Entertainer.Journalist.cs

示例11: TitleTable

 internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
 {
     switch (careerHistory.Rank)
     {
         case 0:
             return;
         case 1:
             character.Skills.Add("Persuade", 1);
             return;
         case 2:
             return;
         case 3:
             var skillList = new SkillTemplateCollection();
             skillList.AddRange(SpecialtiesFor("Gun Combat"));
             skillList.AddRange(SpecialtiesFor("Melee"));
             skillList.RemoveOverlap(character.Skills, 1);
             if (skillList.Count > 0)
                 character.Skills.Add(dice.Choose(skillList), 1);
             return;
         case 4:
             return;
         case 5:
             character.Skills.Add("Streetwise", 1);
             return;
         case 6:
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:28,代码来源:Rogue.Enforcer.cs

示例12: AssignmentSkills

 internal override void AssignmentSkills(Character character, Dice dice)
 {
     switch (dice.D(6))
     {
         case 1:
             {
                 var skillList = new SkillTemplateCollection();
                 skillList.Add("Art", "Holography");
                 skillList.Add("Art", "Write");
                 character.Skills.Increase(dice.Choose(skillList));
             }
             return;
         case 2:
             character.Skills.Increase(dice.Choose(SpecialtiesFor("Electronics")));
             return;
         case 3:
             character.Skills.Increase(dice.Choose(SpecialtiesFor("Drive")));
             return;
         case 4:
             character.Skills.Increase("Investigate");
             return;
         case 5:
             character.Skills.Increase("Recon");
             return;
         case 6:
             character.Skills.Increase("Streetwise");
             return;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:29,代码来源:Entertainer.Journalist.cs

示例13: BasicTrainingSkills

        internal override void BasicTrainingSkills(Character character, Dice dice, bool all)
        {
            var roll = dice.D(6);

            if (all || roll == 1)
            {
                if (all)
                {
                    character.Skills.AddRange(SpecialtiesFor("Drive"));
                    character.Skills.Add("Vacc Suit");
                }
                else
                {
                    var skillList = new SkillTemplateCollection();
                    skillList.AddRange(SpecialtiesFor("Drive"));
                    skillList.Add("Vacc Suit");
                    skillList.RemoveOverlap(character.Skills, 0);
                    if (skillList.Count > 0)
                        character.Skills.Add(dice.Choose(skillList));
                }
            }

            if (all || roll == 2)
                character.Skills.AddRange(SpecialtiesFor("Athletics"));
            if (all || roll == 3)
                character.Skills.AddRange(SpecialtiesFor("Gun Combat"));
            if (all || roll == 4)
                character.Skills.Add("Recon");
            if (all || roll == 5)
                character.Skills.AddRange(SpecialtiesFor("Melee"));
            if (all || roll == 6)
                character.Skills.AddRange(SpecialtiesFor("Heavy Weapons"));
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:33,代码来源:Army.cs

示例14: calcEccentricity

        public static void calcEccentricity(Dice ourDice, Star s)
        {
            int modifiers = 0; //reset the thing.

            if (OptionCont.lessStellarEccent)
            {
                //now we generate eccentricities
                if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 10; //Very Close
                if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 6; //Close
                if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
            }
            else
            {
                if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 6; //Very Close
                if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 4; //Close
                if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
            }

            int roll = ourDice.gurpsRoll(modifiers);
            Star.generateEccentricity(roll, s);

            if (OptionCont.forceVeryLowStellarEccent)
            {
                if (s.orbitalEccent > .2) s.orbitalEccent = .1;
                if (s.orbitalEccent > .1 && s.orbitalEccent < .2) s.orbitalEccent = .05;

            }
        }
开发者ID:KoihimeNakamura,项目名称:CelestialNavigation,代码行数:28,代码来源:libStarGen.cs

示例15: TitleTable

        internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
        {
            switch (careerHistory.Rank)
            {
                case 0:
                    return;
                case 1:
                    careerHistory.Title = "Agent";
                    character.Skills.Add("Deception", 1);
                    return;
                case 2:
                    careerHistory.Title = "Field Agent";
                    character.Skills.Add("Investigate", 1);
                    return;
                case 3:
                    return;
                case 4:
                    careerHistory.Title = "Special Agent";
                    var skillList = new SkillTemplateCollection(SpecialtiesFor("Gun Combat"));
                    skillList.RemoveOverlap(character.Skills, 1);
                    if (skillList.Count > 0)
                        character.Skills.Add(dice.Choose(skillList), 1);

                    return;
                case 5:
                    careerHistory.Title = "Assistant Director";
                    return;
                case 6:
                    careerHistory.Title = "Director";
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:32,代码来源:Agent.Intelligence.cs


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