basic_tiles is now a part of the mod.
[realism.git] / ui / ui.py
blobbe39f482758dbcc2c83faeedfd541e9180721ce5
1 # This file is part of Realism, which is Copyright FunnyMan3595 (Charlie Nolan)
2 # and licensed under the GNU GPL v3. For more details, see LICENSE in the main
3 # Realism directory.
5 class NotImplementedException(Exception): pass
7 class UI(object):
8 '''The generic user interface.'''
9 class_name = "Generic UI"
11 def ni(self, function = None):
12 '''Throws a "not implemented" exception. If function name is provided, it is included in the exception.'''
13 if function:
14 raise NotImplementedException(function + " is not implemented by " + self.class_name)
15 raise NotImplementedException("This function is not implemented by " + self.class_name)
17 def __init__(self):
18 '''Iself.nitializes the user interface.'''
19 self.ni('__init__')
21 def main_loop(self):
22 '''Invokes the main control loop.'''
23 self.ni('main_loop')
25 def map_mode(self, map):
26 '''Puts the UI in map mode.'''
27 self.ni('map_mode')
29 def shop_mode(self, shop):
30 '''Puts the UI in shop mode.'''
31 self.ni('shop_mode')
33 def battle_mode(self, battle):
34 '''Puts the UI in battle mode.'''
35 self.ni('battle_mode')
37 def conversation_mode(self, conversation):
38 '''Puts the UI in conversation mode.'''
39 self.ni('conversation_mode')
41 def hp_tick(self, character, amount):
42 '''Reports a gain in health.'''
43 self.ni('hp_tick')
45 def mp_tick(self, character, amount):
46 '''Reports a gain in mana.'''
47 self.ni('mp_tick')
49 def gained_ability_level(self, character, ability):
50 '''Reports an ability level gain.'''
51 self.ni('gained_ability_level')
53 def gained_level(self, character):
54 '''Reports a level gain.'''
55 self.ni('gained_level')