Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- */
- restricted
- var
- initial
- minimum
- current
- maximum
- New(var/minimum = 0, var/current = 100, var/maximum = 100)
- src.minimum = minimum
- src.maximum = maximum
- src.initial = maximum
- set_current(current)
- proc
- greater_than_percent(perc)
- return current > maximum*(perc/100)
- less_than_percent(perc)
- return current < maximum*(perc/100)
- set_current(number)
- number = max(src.minimum, number)
- number = min(src.maximum, number)
- src.current = number
- set_current_to_max()
- current=maximum
- set_current_to_min()
- current=minimum
- reset()
- set_current(initial)
- decrement()
- decrease(1)
- increment()
- increase(1)
- decrease(number)
- set_current(src.current - number)
- increase(number)
- set_current(src.current + number)
- at_min()
- return src.current == src.minimum
- at_max()
- return src.current == src.maximum
- is_max(number)
- return number == src.maximum
- is_min(number)
- return number == src.minimum
- set_min(number)
- minimum=min(src.maximum, number)
- set_max(number)
- maximum=max(src.minimum, number)
- current()
- return src.current
- maximum()
- return src.maximum
- minimum()
- return src.minimum
- init()
- return src.initial
- //++
- i()
- increment()
- //--
- d()
- decrement()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement