# Path: settings.py
# CLIENT_UPDATE_FREQ = MSPERSEC/CLIENT_NETWORK_FPS
# 
# CLIENT_NETWORK_FPS = 10


import time
from settings import CLIENT_UPDATE_FREQ, CLIENT_NETWORK_FPS
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# ##### END AGPL LICENSE BLOCK #####

from __future__ import division

'''BaseTickServer
A server that should be overridden to provide a server with its own internal loop.
'''



class BaseTickServer(object):
    '''This is a class that should be subclassed and tick() defined to do something
    every "tick".'''

    def __init__(self):
        self.tick_freq_multiplier = 1

    def tick(self):
        '''Do things every tick. Should be overridden.'''
        pass

    def start(self):
        self.current_tick = 0

# Path: settings.py
# CLIENT_UPDATE_FREQ = MSPERSEC/CLIENT_NETWORK_FPS
# 
# CLIENT_NETWORK_FPS = 10


# Path: basetickserver.py
import time
from settings import CLIENT_UPDATE_FREQ, CLIENT_NETWORK_FPS

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# ##### END AGPL LICENSE BLOCK #####

from __future__ import division

'''BaseTickServer
A server that should be overridden to provide a server with its own internal loop.
'''



class BaseTickServer(object):
    '''This is a class that should be subclassed and tick() defined to do something
    every "tick".'''

    def __init__(self):
        self.tick_freq_multiplier = 1

    def tick(self):
        '''Do things every tick. Should be overridden.'''
        pass

    def start(self):
        self.current_tick = 0

        skip_ticks = CLIENT_UPDATE_FREQ