Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //history = list<int>
- int Attribute::getValue()
- {
- if (changed > 0)
- {
- for (int idx = history.length() - changed; idx < history.length() - 1; ++idx)
- {
- value += history.at(idx);
- }
- changed = 0;
- }
- return value;
- }
- int Attribute::getValue() const
- {
- if (changed > 0)
- {
- int cvalue = value;
- for (int idx = history.length() - changed; idx < history.length() - 1; ++idx)
- {
- cvalue += history.at(idx);
- }
- return cvalue;
- }
- return value;
- }
- void Attribute::setValue(int value)
- {
- history.append(value);
- ++changed;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement