import TeamModel from '@/Model/team' ; class StandingModel { private team : TeamModel | string ; private played : number ; private wins : number ; private draws : number ; private losts : number ; private goalsFor : number ; private goalsAgainst : number ; public constructor ( team , played = 0 , wins = 0 , draws = 0 , losts = 0 , goalsFor = 0 , goalsAgainst = 0 ) { this . team = team ; this . played = played ; this . wins = wins ; this . draws = draws ; this . losts = losts ; this . goalsFor = goalsFor ; this . goalsAgainst = goalsAgainst ; } public getTeam ( ) { return this . team ; } public getPlayed ( ) { return this . played ; } public getWins ( ) { return this . wins ; } public getDraws ( ) { return this . draws ; } public getLosts ( ) { return this . losts ; } public getGoalsFor ( ) { return this . goalsFor ; } public getGoalsAgainst ( ) { return this . goalsAgainst ; } public getGoalsDifference ( ) { return this . getGoalsFor ( ) - this . getGoalsAgainst ( ) ; } public getPoints ( ) { return ( this . getWins ( ) * 3 ) + this . getDraws ( ) ; } public addPlayed ( ) { this . played += 1 ; } public addWin ( ) { this . wins += 1 ; } public addDraw ( ) { this . draws += 1 ; } public addLost ( ) { this . losts += 1 ; } public addGoalsFor ( goals ) { if ( goals ) { goals = + this . goalsFor + + goals ; this . goalsFor = goals ; } } public addGoalsAgainst ( goals ) { if ( goals ) { goals = + this . goalsAgainst + + goals ; this . goalsAgainst = goals ; } } } export default StandingModel ;