Module MyConfigConnector :: Class MY_SingleConfigConnector
[hide private]
[frames] | no frames]

Class MY_SingleConfigConnector

source code

object --+
         |
        MY_SingleConfigConnector

singleton class to parse the config file


Author: Niner

Contact: Admiral.Niner@googlemail.com

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
Boolean
getConfig(self)
checks if file exists and is writable otherwise create it with default values or throw exception when user has wrong privileges
source code
 
setDefault(self)
set input keys to default (awsd) and fills properties with random values
source code
 
setConfig(self)
writes config values to file
source code
 
setControlKeyValue(self, key, value)
fills specific options in category 'keycontrol' with new values (dependent on the players orientation)
source code
Integer
getControlKeyValue(self, key)
returns the value to the given key in the list of user's input keys
source code
 
setPowerUps(self, key, value)
fills specific options in category 'powerups' with new values (collected player properties)
source code
Integer
getPowerUpValue(self, key)
returns the value to the given key in the list of user's powerups
source code
 
setMerch(self, merch_name)
fills specific options in category 'collecteditems' with new values (collected player merchandise)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(self, *args, **kargs) source code
Class Variables [hide private]
object __instance = None
private class variable to check if singleteon is initilized
Instance Variables [hide private]
List collectionList
a list of the collected merhcandise objects
List keyList
a list of the ascii values for the specific keystrokes
Boolean loaded
True if config file was loaded and set
List powerupsList
a list of the number of collected powerups
Boolean ram
True if config file is not writable
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(self, *args, **kargs)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

getConfig(self)

source code 

checks if file exists and is writable otherwise create it with default values or throw exception when user has wrong privileges

Returns: Boolean
True if config was loaded, otherwise False

setControlKeyValue(self, key, value)

source code 

fills specific options in category 'keycontrol' with new values (dependent on the players orientation)

Parameters:
  • key (String) - represents the key in the in the control key section of the config file
  • value (Integer) - the value of the given key

getControlKeyValue(self, key)

source code 

returns the value to the given key in the list of user's input keys

key = String

Parameters:
  • key (String) - the key out of the control key section
Returns: Integer
returns the value of the given key

setPowerUps(self, key, value)

source code 

fills specific options in category 'powerups' with new values (collected player properties)

Parameters:
  • key (String) - represents the key in the in the powerups section of the config file
  • value (Integer) - the value of the the given key

getPowerUpValue(self, key)

source code 

returns the value to the given key in the list of user's powerups

Parameters:
  • key (String) - the name of the powerup
Returns: Integer
returns the number of the given key

setMerch(self, merch_name)

source code 

fills specific options in category 'collecteditems' with new values (collected player merchandise)

Parameters:
  • merch_name (String) - the name of the merchandise object