Ejemplo n.º 1
0
        protected override bool giveInner()
        {
            int idx = RewardStorage.GetLastSeqIdxGiven(this);

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

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