Package nflgame :: Module game :: Class Play
[frames] | no frames]

Class Play

source code

object --+
         |
        Play

Play represents a single play. It contains a list of all players that participated in the play (including offense, defense and special teams). The play also includes meta information about what down it is, field position, clock time, etc.

Play objects also contain team-level statistics, such as whether the play was a first down, a fourth down failure, etc.

Instance Methods
 
__init__(self, drive, playid, data)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
has_player(self, playerid)
Whether a player with id playerid participated in this play.
source code
 
__str__(self)
str(x)
source code
 
__eq__(self, other)
We use the play description to determine equality because the play description can be changed.
source code
 
__getattr__(self, name) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, drive, playid, data)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 

We use the play description to determine equality because the play description can be changed. (Like when a play is reversed.)