コード例 #1
0
        private void PerformAging()
        {
            var roll = dice.roll(2) - Careers.Select(c => c.TermsServed).Sum();

            if (roll <= 0)
            {
                switch (roll)
                {
                case 0:
                    ReduceOnePhysicalCharacteristic(1);
                    break;

                case -1:
                    ReduceOnePhysicalCharacteristic(1);
                    ReduceOnePhysicalCharacteristic(1);
                    break;

                case -2:
                    ReduceOnePhysicalCharacteristic(1);
                    ReduceOnePhysicalCharacteristic(1);
                    ReduceOnePhysicalCharacteristic(1);
                    break;

                case -3:
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(1);
                    ReduceOnePhysicalCharacteristic(1);
                    break;

                case -4:
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(1);
                    break;

                case -5:
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(2);
                    break;

                case -6:
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOnePhysicalCharacteristic(2);
                    ReduceOneMentalCharacteristic(1);
                    break;
                }
            }
        }
コード例 #2
0
        public IEnumerable <SelectListItem> CareerList()
        {
            yield return(new SelectListItem()
            {
                Text = "(Random)", Value = "", Selected = true
            });

            foreach (var career in Careers.Select(c => c.Career).Distinct().OrderBy(s => s))
            {
                yield return new SelectListItem()
                       {
                           Text = career, Value = career
                       }
            }
            ;
        }