Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public Stats(int intelligence, int wisdom, int dexterity, int strength, int constitution, int agility, int luck, int charisma, INotificiationService notificiationService, IRandomiser randomiser)
 {
     Intelligence         = intelligence;
     Wisdom               = wisdom;
     Dexterity            = dexterity;
     Strength             = strength;
     Constitution         = constitution;
     Agility              = agility;
     Luck                 = luck;
     Charisma             = charisma;
     NotificiationService = notificiationService;
     Randomiser           = randomiser;
     ValidateAndThrowExceptionIfErrors();
 }