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); }
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); }
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); }