示例#1
0
        public void AddAlteration(RollType rollType, IHasTurn hasTurn, IRollDataAlteration alteration)
        {
            RollDictID rollDictID = new RollDictID(hasTurn, rollType);

            if (!RollAlterationDict.ContainsKey(rollDictID))
            {
                RollAlterationDict[rollDictID] = new List <IRollDataAlteration>();
            }

            RollAlterationDict[rollDictID].Add(alteration);
        }
示例#2
0
        public void Roll(RollType rollType, IHasTurn hasTurn, IRollData rollData)
        {
            RollDictID rollDictID = new RollDictID(hasTurn, rollType);

            if (RollAlterationDict.ContainsKey(rollDictID))
            {
                foreach (IRollDataAlteration rollDataAlteration in RollAlterationDict[rollDictID])
                {
                    rollDataAlteration.Alter(rollData);
                }
            }

            int rollInt = MyAdvantageRoller.Roll(rollData.MyAdvantageSetter);

            rollData.SetRoll(rollInt);
        }