³ò
^lpOc           @   sO   d  Z  d d k l Z d e f d „  ƒ  YZ e ƒ  Z d e f d „  ƒ  YZ d S(   sj   
$Rev: 626 $
$LastChangedBy: satoon101 $
$LastChangedDate: 2012-03-26 15:17:13 -0400 (Mon, 26 Mar 2012) $
iÿÿÿÿ(   t	   ServerVart   _VariableBackupsc           B   s    e  Z d  Z d „  Z d „  Z RS(   s6   Class used to store variables with their default valuec         C   s?   | |  j o t  t |  ƒ i | ƒ Sn t | ƒ } |  | <| S(   sA   Gets the variable's instance and adds it if not in the dictionary(   t   superR   t   __getitem__t   _RegisteredAddons(   t   selft   variablet   value(    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyR      s    c         C   sI   | |  j o d Sn t  | ƒ i |  | i ƒ t t |  ƒ i | ƒ d S(   s[   Removes the variable from the dictionary,
            and sets it back to the default valueN(   R    t   sett   defaultR   R   t   __delitem__(   R   R   (    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyR
   &   s    (   t   __name__t
   __module__t   __doc__R   R
   (    (    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyR      s   	R   c           B   s    e  Z d  Z d „  Z d „  Z RS(   sQ   Class used to register addons to the
        variable and store its default valuec         C   sB   | |  _  t t | ƒ ƒ } y t | ƒ } Wn n X| |  _ d S(   s]   Stores the variable, its default value,
            and addons that register for the variableN(   R   t   strR    t   floatR	   (   R   R   R   (    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyt   __init__>   s    	c         C   sD   | |  j o d Sn t  t |  ƒ i | ƒ |  p t |  i =n d S(   s|   Unregisters an addon for the variable and removes the
            variable from the dictionary if it is no longer registeredN(   R   R   t   removet   VariableBackupsR   (   R   t   addon(    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyR   Q   s
    (   R   R   R   R   R   (    (    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pyR   :   s   	N(   R   t   esR    t   dictR   R   R   R   (    (    (    sS   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/modules/backups.pys   <module>   s   #	