Exemplo n.º 1
0
 private void DistributeEp( string unitCode, decimal points, decimal multiplier, GameStats game, bool bHome )
 {
     if ( bOutputPlayerEP )
     {
         var teamCode = ( bHome ) ? game.HomeTeam : game.AwayTeam;
         var ep = points*multiplier;
     #if DEBUG
         Utility.Announce(
             string.Format( "Distributing {0:##.##} points to the {1} unit from game {2}",
             ep, unitCode, game.Code ) );
     #endif
         var ds = Utility.TflWs.GetLineup( teamCode, game.Season, game.Week );
         //  For each player in the game in the particular unit tally points
         if ( ds.Tables[ 0 ].Rows.Count > 0 )
         {
             var dt = ds.Tables[ "lineup" ];
             foreach ( DataRow dr in dt.Rows )
             {
                 var playerId = dr[ "PLAYERID" ].ToString();
                 var startVal = dr[ "START" ].ToString();
                 var starter = ( startVal == "True" ) ? true : false;
                 var p = new NFLPlayer( playerId );
                 if ( p.IsInUnit( unitCode ) )
                     TallyEp( playerId, ep, starter );
             }
         }
     }
 }