³ò
šõÜNc           @   s_   d  Z  d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e ƒ  Z d d k Td	 S(
   sj   
$Rev: 548 $
$LastChangedBy: satoon101 $
$LastChangedDate: 2011-08-01 22:42:23 -0400 (Mon, 01 Aug 2011) $
t
   _FieldMetac           B   s   e  Z d  „  Z RS(   c         C   s‘   xx | D]p } t  | d ƒ oZ t | d ƒ } y | d i | ƒ Wqw t j
 o | | d <qw t j
 o qw Xq q Wt i |  | | | ƒ S(   Nt   _fields(   t   hasattrt   getattrt   updatet   KeyErrort
   ValueErrort   typet   __new__(   t   clst   namet   basest   attrt   baset	   inherited(    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR      s     (   t   __name__t
   __module__R   (    (    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR       s   t   _PlayerMetac           B   s   e  Z e Z d  „  Z RS(   c         C   sƒ   | |  i  j o |  i  | i | ƒ } n | t j o/ x, t | i ƒ  D] } | | | |  ƒ qH Wn t t |  ƒ i | | ƒ d  S(   N(   R   t	   to_pythont	   CALLBACKSt   valuest   superR   t   __setattr__(   t   selfR
   t   valuet   function(    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR      s     (   R   R   R    t   __metaclass__R   (    (    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR      s   t   CustomAttributeCallbacksc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sk   Class designed to store callback functions for custom attributes added
    to GunGame via a subaddon.

    c         O   s-   d |  i  j o t i |  ƒ |  _ n |  i S(   Nt   _the_instance(   t   __dict__t   dictR   R   (   R	   t   pt   k(    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR   /   s    c         C   sZ   t  | ƒ p t d | ƒ ‚ n | |  j o h  |  | <n |  | i h  | | <ƒ d S(   sÛ   Adds a callback to execute when a previously created attribute is
        set via the _BasePlayer class __setitem__ or __setattr__ methods.

        Note:
            Do not raise errors for GunGame attributes.
        s   Callback "%s" is not callable.N(   t   callablet   AttributeErrorR   (   R   t	   attributeR   t   addon(    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyt   add4   s
    c         C   sS   | |  j o d Sn | |  | j o d Sn |  | | =|  | p |  | =n d S(   s	  Removes a callback to execute when a previously created attribute is
        set via the BasePlayer class' __getitem__ or __getattr__ methods.

        Note:
            No exceptions are raised if you attempt to delete a non-existant
            callback.
        N(    (   R   R#   R$   (    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyt   removeE   s    	(   R   R   t   __doc__R   R%   R&   (    (    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pyR   *   s   		iÿÿÿÿ(   t   *N(	   R'   R   R    t   objectR   R   R   R   t   players(    (    (    sY   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/players/__init__.pys   <module>   s
   2	