|
From: <rga...@us...> - 2002-11-04 21:29:15
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv19874
Modified Files:
ScoringConfig.xsl
Log Message:
Fixed issues with own goals meaning that a player was credited for scoring it and the wrong teams defenders were deducted points for conceeding. (bug 630445)
Index: ScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/ScoringConfig.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ScoringConfig.xsl 4 Nov 2002 12:17:36 -0000 1.4
--- ScoringConfig.xsl 4 Nov 2002 21:29:12 -0000 1.5
***************
*** 37,40 ****
--- 37,41 ----
<!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
<xsl:call-template name="goalsConceeded" />
+ <xsl:call-template name="ownGoalsConceeded" />
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
***************
*** 397,401 ****
</xsl:variable>
! <xsl:for-each
select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
--- 398,491 ----
</xsl:variable>
! <xsl:call-template name="deductDefenderPoints">
! <xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
! </xsl:with-param>
! <xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
! </xsl:with-param>
! <xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
! </xsl:with-param>
! <xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
! </xsl:with-param>
! </xsl:call-template>
! </xsl:for-each>
! </xsl:template>
!
! <!-- =========================================================================== -->
! <!-- FIXME: The goalsconceeded and ownGoalsConceeded templates are very similar -->
! <!-- We should refactor to extract common functionality, only the setting -->
! <!-- of the initial parameters needs to be different -->
! <!-- =========================================================================== -->
!
! <!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
! <xsl:template name="ownGoalsConceeded">
! <xsl:for-each select="//event[type='ownGoal']">
! <xsl:variable name="goalMinutes">
! <xsl:value-of select="normalTimeMinutes" />
! </xsl:variable>
!
! <xsl:variable name="conceedingTeamID">
! <xsl:call-template name="getPlayerTeam">
! <xsl:with-param name="playerFullName">
! <xsl:value-of select="player" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:variable name="conceedingTeam">
! <xsl:call-template name="getTeamName">
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:variable name="scoringTeam">
! <xsl:choose>
! <xsl:when test="//event[type='result']/homeTeam = $conceedingTeam">
! <xsl:value-of select="//event[type='result']/awayTeam" />
! </xsl:when>
!
! <xsl:otherwise>
! <xsl:value-of select="//event[type='result']/homeTeam" />
! </xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
!
! <xsl:variable name="scoringTeamID">
! <xsl:call-template name="getTeamID">
! <xsl:with-param name="commonName">
! <xsl:value-of select="$scoringTeam" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:call-template name="deductDefenderPoints">
! <xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
! </xsl:with-param>
! <xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
! </xsl:with-param>
! <xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
! </xsl:with-param>
! <xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
! </xsl:with-param>
! </xsl:call-template>
! </xsl:for-each>
! </xsl:template>
!
! <!-- Deduct points from defenders and goalkeepers who have conceeded a goal -->
! <xsl:template name="deductDefenderPoints">
! <xsl:param name="goalMinutes"/>
! <xsl:param name="scoringTeam"/>
! <xsl:param name="conceedingTeam"/>
! <xsl:param name="conceedingTeamID"/>
! <xsl:for-each
select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
***************
*** 558,564 ****
</xsl:choose>
</xsl:for-each>
! </xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
--- 648,653 ----
</xsl:choose>
</xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
|