コード例 #1
0
ファイル: Stats.cs プロジェクト: Staphill/ZLand
        public Stats(INotificiationService notificiationService, IRandomiser randomiser)
        {
            NotificiationService = notificiationService;
            Randomiser           = randomiser;
            notificiationService.Notify("Generating stats for actor");
            var statsPool = Randomiser.RandomInt(100, 160);

            notificiationService.Notify(string.Format("StatsPool: {0}", statsPool));
            var randomStats = randomiser.RandomIntArray(1, 20, statsPool, 8);

            Intelligence = randomStats[0];
            notificiationService.Notify(string.Format("Intelligence: {0}", Intelligence));
            Wisdom = randomStats[1];
            notificiationService.Notify(string.Format("Wisdom: {0}", Wisdom));
            Strength = randomStats[2];
            notificiationService.Notify(string.Format("Strength: {0}", Strength));
            Dexterity = randomStats[3];
            notificiationService.Notify(string.Format("Dexterity: {0}", Dexterity));
            Constitution = randomStats[4];
            notificiationService.Notify(string.Format("Constitution: {0}", Constitution));
            Agility = randomStats[5];
            notificiationService.Notify(string.Format("Agility: {0}", Agility));
            Luck = randomStats[6];
            notificiationService.Notify(string.Format("Luck: {0}", Luck));
            Charisma = randomStats[7];
            notificiationService.Notify(string.Format("Charisma: {0}", Charisma));
            ValidateAndThrowExceptionIfErrors();
        }