Ejemplo n.º 1
0
 public Factor copy(Factor copyFactor)
 {
     copyFactor=(Factor)base.copy(copyFactor);
     if (copyFactor == null)
         copyFactor = new Factor();
     copyFactor.itsConstant_Den = this.itsConstant_Den;
     copyFactor.ItsConstantNum = this.ItsConstantNum;
     copyFactor.itsNumOfDice = this.itsNumOfDice;
     copyFactor.DiceType = this.DiceType;
     copyFactor.is_constant = this.is_constant;
     return copyFactor;
 }
Ejemplo n.º 2
0
 public Check(charProperty fProperty, charProperty sProperty, Factor factor)
 {
     this.FirstProperty = fProperty;
     this.SecondProperty = sProperty;
     this.ItsFactor = factor;
 }
Ejemplo n.º 3
0
 public Check()
 {
     firstProperty = new charProperty();
     secondProperty = new charProperty();
     itsFactor = new Factor();
 }
Ejemplo n.º 4
0
 public Bonus(Factor factor, charProperty property)
 {
     ItsFactor = factor;
     ItsProperty = property;
 }
Ejemplo n.º 5
0
        protected double calculateFactor(Factor fac,bool updateFeedback)
        {
            if (isInitialized())
            {
                Random rand = new Random();
                double value = 0, constantPart = 0;
                int roll = 0;

                //Used to determine whether property will be increased or decreased
                int addSubtract =fac.getNumOfDice()<0?-1:1;

                if (updateFeedback)
                    myFeedbackController.RollsStart(fac.getNumOfDice(), fac.getDiceType());
                for (int i = 0; i < (fac.getNumOfDice() * addSubtract); i++)
                {
                    roll = addSubtract * rand.Next(fac.getDiceType());
                    if(updateFeedback)
                        MyFeedbackController.RollOutcome(roll);
                    value += roll;
                }

                constantPart=fac.ItsConstantNum / fac.getDenominator();
                if(updateFeedback)
                    MyFeedbackController.constantOutcome(constantPart);
                value +=constantPart ;

                if(updateFeedback)
                    MyFeedbackController.FactorOutcome(value);
                return value;
            }
            else
                return 0;
        }