Esempio n. 1
0
        protected override bool giveInner()
        {
            int idx = RewardStorage.GetLastSeqIdxGiven(mID);

            if (idx >= Rewards.Count)
            {
                return(false);                // all rewards in the sequence were given
            }
            RewardStorage.SetLastSeqIdxGiven(mID, ++idx);
            return(true);
        }
Esempio n. 2
0
        protected override bool takeInner()
        {
            int idx = RewardStorage.GetLastSeqIdxGiven(mID);

            if (idx <= 0)
            {
                return(false);                // all rewards in the sequence were taken
            }
            RewardStorage.SetLastSeqIdxGiven(mID, --idx);
            return(true);
        }
Esempio n. 3
0
 public bool ForceNextRewardToGive(Reward reward)
 {
     for (int i = 0; i < Rewards.Count; i++)
     {
         if (Rewards[i].GetId() == reward.GetId())
         {
             RewardStorage.SetLastSeqIdxGiven(mID, i - 1);
             return(true);
         }
     }
     return(false);
 }