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
5 class NotImplementedException(Exception): pass
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.'''
14 raise NotImplementedException(function
+ " is not implemented by " + self
.class_name
)
15 raise NotImplementedException("This function is not implemented by " + self
.class_name
)
18 '''Iself.nitializes the user interface.'''
22 '''Invokes the main control loop.'''
25 def map_mode(self
, map):
26 '''Puts the UI in map mode.'''
29 def shop_mode(self
, shop
):
30 '''Puts the UI in 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.'''
45 def mp_tick(self
, character
, amount
):
46 '''Reports a gain in mana.'''
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')