Ejemplo n.º 1
0
        public Reward GetLastGivenReward()
        {
            int idx = RewardStorage.GetLastSeqIdxGiven(mID);

            if (idx < 0)
            {
                return(null);
            }
            return(Rewards[idx]);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
 public bool HasMoreToGive()
 {
     return(RewardStorage.GetLastSeqIdxGiven(mID) < Rewards.Count);
 }