Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lua_class = {}
- --function to create new class
- function lua_class:new(o)
- o = o or {}
- setmetatable(o, self)
- self.__index = self
- return o
- end
- -- constructor
- function timer_class:new(name, length)
- local o = {}
- o.name = name or "timer"
- o.enabled = false
- o.paused = false
- o.timer = nil
- o.t_length = (length or 60) * 1000
- o.t_started = 0
- o.t_ended = 0
- o.t_paused = 0
- o.t_restarted = 0
- o.t_remaining = 0
- o.h_duration = history_class:new(o.name, 10)
- return class.new(self, o)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement