# Path: nhlscrapi/games/events.py
# class Event(object):
# class ShotAttempt(Event):
# class Shot(ShotAttempt):
# class Goal(Shot):
# class Miss(ShotAttempt):
# class Block(ShotAttempt):
# class Hit(Event):
# class FaceOff(Event):
# class Stoppage(Event):
# class PeriodEnd(Stoppage):
# class GameEnd(Stoppage):
# class ShootOutEnd(Stoppage):
# class Penalty(Event):
# class Turnover(Event):
#     class TOType:
# class Takeaway(Turnover):
# class Giveaway(Turnover):
# class ShootOutAtt(Event):
# class ShootOutGoal(ShootOutAtt):
# class EventFactory(object):
#     def __init__(self, event_type = EventType.Event, desc = ""):
#     def __init__(self, event_type = EventType.ShotAttempt):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, event_type=EventType.Stoppage):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, to_type = TOType.Takeaway):
#     def turnover_type(self):
#     def turnover_type(self, value):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, event_type = EventType.ShootOutAtt):
#     def __init__(self):
# def _get_class_hierarchy(base):
#     def Create(event_type):
# 
# Path: nhlscrapi/games/events.py
# class EventFactory(object):
#     """
#     Factory for creating event objects corresponding to the different types of plays (events) in RTSS play by play data.
#     Constructor selected based upon the event enum :py:class:`.EventType.Events` passed.
#     """
#     
#     event_list = _get_class_hierarchy(Event)
#     """List of available events loaded dynamically by following the subclass structure of :py:class:`.Event`."""
#     
#     @staticmethod
#     def Create(event_type):
#         """
#         Factory method creates objects derived from :py:class`.Event` with class name matching the :py:class`.EventType`.
#         
#         :param event_type: number for type of event
#         :returns: constructed event corresponding to ``event_type``
#         :rtype: :py:class:`.Event`
#         """
#         if event_type in EventType.Name:
#             # unknown event type gets base class
#             if EventType.Name[event_type] == Event.__name__:
#                 return Event()
#             else:
#                 # instantiate Event subclass with same name as EventType name
#                 return [t for t in EventFactory.event_list if t.__name__ == EventType.Name[event_type]][0]()
#         else:
#             raise TypeError("EventFactory.Create: Invalid EventType")
# 
# Path: nhlscrapi/games/playbyplay.py
# class Play(object):
# class PlayByPlay(RepScrWrap):
#     def __init__(self,
#             play_num=0, period=0, strength=Strength.Even, time={ "min": 20, "sec": 0 },
#             vis_on_ice = { }, home_on_ice = { }, event=None):
#     def __init__(self, game_key, cum_stats = {}, init_cs_teams=True):
#     def plays(self):
#     def compute_stats(self):
#     def __process(self, play, d, meth):
#     def __init_cs_teams(self):


from abc import ABCMeta, abstractmethod
from nhlscrapi.games import events as EV
from nhlscrapi.games.events import EventFactory as EF
from nhlscrapi.games.playbyplay import Strength as St
                new_tally = {
                    'period': play.period,
                    'time': play.time,
                    team: 1,
                    'play': play
                }
      
            self.tally.append(new_tally)
      
        return new_tally
      

class ShotEventTallyBase(TeamIncrementor):
    """Base class for all shot attempt based events"""
    def __init__(self, count_play):
        super(ShotEventTallyBase, self).__init__(
            get_team=lambda play: play.event.shooter['team'],
            count_play=count_play
        )
            
      
class ShotCt(ShotEventTallyBase):
    """
    Tallies shots on goal for each team. Increments if
    
      * the play event inherits from :py:class:`.Shot`
    
    """
    def __init__(self):
        super(ShotCt, self).__init__(

# Path: nhlscrapi/games/events.py
# class Event(object):
# class ShotAttempt(Event):
# class Shot(ShotAttempt):
# class Goal(Shot):
# class Miss(ShotAttempt):
# class Block(ShotAttempt):
# class Hit(Event):
# class FaceOff(Event):
# class Stoppage(Event):
# class PeriodEnd(Stoppage):
# class GameEnd(Stoppage):
# class ShootOutEnd(Stoppage):
# class Penalty(Event):
# class Turnover(Event):
#     class TOType:
# class Takeaway(Turnover):
# class Giveaway(Turnover):
# class ShootOutAtt(Event):
# class ShootOutGoal(ShootOutAtt):
# class EventFactory(object):
#     def __init__(self, event_type = EventType.Event, desc = ""):
#     def __init__(self, event_type = EventType.ShotAttempt):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, event_type=EventType.Stoppage):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, to_type = TOType.Takeaway):
#     def turnover_type(self):
#     def turnover_type(self, value):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, event_type = EventType.ShootOutAtt):
#     def __init__(self):
# def _get_class_hierarchy(base):
#     def Create(event_type):
# 
# Path: nhlscrapi/games/events.py
# class EventFactory(object):
#     """
#     Factory for creating event objects corresponding to the different types of plays (events) in RTSS play by play data.
#     Constructor selected based upon the event enum :py:class:`.EventType.Events` passed.
#     """
#     
#     event_list = _get_class_hierarchy(Event)
#     """List of available events loaded dynamically by following the subclass structure of :py:class:`.Event`."""
#     
#     @staticmethod
#     def Create(event_type):
#         """
#         Factory method creates objects derived from :py:class`.Event` with class name matching the :py:class`.EventType`.
#         
#         :param event_type: number for type of event
#         :returns: constructed event corresponding to ``event_type``
#         :rtype: :py:class:`.Event`
#         """
#         if event_type in EventType.Name:
#             # unknown event type gets base class
#             if EventType.Name[event_type] == Event.__name__:
#                 return Event()
#             else:
#                 # instantiate Event subclass with same name as EventType name
#                 return [t for t in EventFactory.event_list if t.__name__ == EventType.Name[event_type]][0]()
#         else:
#             raise TypeError("EventFactory.Create: Invalid EventType")
# 
# Path: nhlscrapi/games/playbyplay.py
# class Play(object):
# class PlayByPlay(RepScrWrap):
#     def __init__(self,
#             play_num=0, period=0, strength=Strength.Even, time={ "min": 20, "sec": 0 },
#             vis_on_ice = { }, home_on_ice = { }, event=None):
#     def __init__(self, game_key, cum_stats = {}, init_cs_teams=True):
#     def plays(self):
#     def compute_stats(self):
#     def __process(self, play, d, meth):
#     def __init_cs_teams(self):


# Path: nhlscrapi/games/cumstats.py
from abc import ABCMeta, abstractmethod
from nhlscrapi.games import events as EV
from nhlscrapi.games.events import EventFactory as EF
from nhlscrapi.games.playbyplay import Strength as St

                new_tally = {
                    'period': play.period,
                    'time': play.time,
                    team: 1,
                    'play': play
                }
      
            self.tally.append(new_tally)
      
        return new_tally
      

class ShotEventTallyBase(TeamIncrementor):
    """Base class for all shot attempt based events"""
    def __init__(self, count_play):
        super(ShotEventTallyBase, self).__init__(
            get_team=lambda play: play.event.shooter['team'],
            count_play=count_play
        )
            
      
class ShotCt(ShotEventTallyBase):
    """
    Tallies shots on goal for each team. Increments if
    
      * the play event inherits from :py:class:`.Shot`
    
    """
    def __init__(self):
        super(ShotCt, self).__init__(

            count_play=lambda play: isinstance(play.event, EV.Shot)