class Event:
    """this is a superclass for any events that might be generated by an
    object and sent to the EventManager"""
    def __init__(self):
                self.name = "Generic Event"

#  ___________________________View events________________________________

class ViewEvent(Event):
    """this is a superclass for any event  heard it by the view"""
    type = "ViewEvent"
        #--------------------------------------    

class AddSpriteEvent(ViewEvent):
    """this event is launched on creature generation to view for render one sprite"""
    def __init__(self, group):
        self.name = "AddSpriteEvent"
        self.group = group
        #--------------------------------------    

class SetSurfaceEvent(ViewEvent):
    """this event is launched on Backgrownd surface generation for render the
        background"""
    def __init__(self, array):
        self.name = "SetSurfaceEvent"
        self.array= array
        #--------------------------------------    

class UpdateSpriteEvent(ViewEvent):
    """this event is launched to update a creature to view for update the sprite image"""
    def __init__(self, group):
        self.name = "UpdateSpriteEvent"
        self.group =group
        #--------------------------------------    

class UpdateSurfaceEvent(ViewEvent):
    """this event is launched to update a creature to the view for update the
        bckground sourface image"""
    def __init__(self, array, group):
        self.name = "UpdateSurfaceEvent"
        self.array = array
        self.group = group
        #--------------------------------------
        
class UpdateSpriteGroupEvent(ViewEvent):
    """this event is launched to update a creature to the view for update the
        bckground sourface image"""
    def __init__(self,  group):
        self.name = "UpdateSpriteGroupEvent"
        self.group = group
        #--------------------------------------    
    
        
#   _________________________Model events ______________________________

class ModelEvent(Event):
    """this is a superclass for any event  heard it by the model"""
    type = "ModelEvent"
        #--------------------------------------    

class SetCreatureEvent(ModelEvent):
    """this event is launched on creature generation"""
    def __init__(self,xpos, ypos):
        self.name = "SetCreatureEvent"
        self.xpos = xpos
        self.ypos  = ypos
        
        #--------------------------------------
        
class UpdateCreturesGroupEvent(ModelEvent):
    """this event is launched to update a creature"""
    def __init__(self):
        self.name = "UpdateCreturesGroupEvent"
        #--------------------------------------
        
        
class RemoveCreatureEvent(ModelEvent):
    """this event is launched on creature remotion"""
    def __init__(self, CreatureId):
        self.name = "RemoveCreatureEvent"
        self.id = CreatureId
        #--------------------------------------
        
class UpdateCreatureEvent(ModelEvent):
    """this event is launched to update a creature"""
    def __init__(self, name):
        self.name = "UpdateCreatureEvent"
        self.creatureName = name 
        #--------------------------------------
        
class SetBackgroundEvent(ModelEvent):
    """this event is launched on Background generation"""
    def __init__(self, width, heigth):
        self.name = "SetBackgroundEvent"
        self.width = width
        self. heigth  =  heigth
        #--------------------------------------
class UpdateBackgroundEvent(ModelEvent):
    """this event is launched on Background generation"""
    def __init__(self):
        self.name = "UpdateBackgroundEvent"
        #--------------------------------------

#   ________________________________Controller events_________________________

class ControllerlEvent(Event):
    """this is a superclass for any event  heard it by the Controller"""
    type = "ControllerlEvent"
        #--------------------------------------

class IterationComplete(ControllerlEvent):
    """this event is raised when the model finish some calculus and whant
    to hear the user """
    def __init__(self):
        self.name = "IterationComplete"
    
