@@ -2,7 +2,7 @@ import { MatchWithId, Match } from '../types/Match'
22import { Player } from '../types/Player'
33import { MatchDescription } from '../types/MatchDescription'
44import * as moment from 'moment'
5- import { UserRow } from '../types/Database'
5+ import { UserRow , MatchRow } from '../types/Database'
66
77const NOW_MOMENT = moment ( '2020-03-25 10:00:00' )
88export const NOW = NOW_MOMENT . toDate ( )
@@ -25,21 +25,22 @@ export const FOOSBALL_GAME = {
2525 ...FOOSBALL_DATA ,
2626}
2727
28- export const FOOSBALL_MATCH_ROW = {
28+ export const FOOSBALL_MATCH_ROW : MatchRow = {
2929 Id : '2' ,
30- Team1Player1Id : '1' ,
31- Team1Player1Rating : ' 1001' ,
32- Team1Player2Id : '2' ,
33- Team1Player2Rating : ' 1002' ,
34- Team2Player1Id : '3' ,
35- Team2Player1Rating : ' 1003' ,
36- Team2Player2Id : '4' ,
37- Team2Player2Rating : ' 1004' ,
30+ Team1Player1Id : 1 ,
31+ Team1Player1Rating : 1001 ,
32+ Team1Player2Id : 2 ,
33+ Team1Player2Rating : 1002 ,
34+ Team2Player1Id : 3 ,
35+ Team2Player1Rating : 1003 ,
36+ Team2Player2Id : 4 ,
37+ Team2Player2Rating : 1004 ,
3838 Date : NOW ,
39- WinningTeamRatingChange : '16' ,
40- LosingTeamRatingChange : '-16' ,
41- Team1Won : 'true' ,
42- GameId : '1' ,
39+ WinningTeamRatingChange : 16 ,
40+ LosingTeamRatingChange : - 16 ,
41+ Team1Score : 1 ,
42+ Team2Score : 0 ,
43+ GameId : 1 ,
4344}
4445
4546export const FOOSBALL_MATCH_DESCRIPTION : MatchDescription = {
@@ -48,15 +49,15 @@ export const FOOSBALL_MATCH_DESCRIPTION: MatchDescription = {
4849 team1Won : true ,
4950}
5051
51- export const FOOSBALL_MATCH_WITH_ID : MatchWithId = {
52- id : 2 ,
53- team1 : [ { id : 1 , matchRating : 1001 } , { id : 2 , matchRating : 1002 } ] ,
54- team2 : [ { id : 3 , matchRating : 1003 } , { id : 4 , matchRating : 1004 } ] ,
55- team1Won : true ,
56- date : NOW ,
57- winningTeamRatingChange : 16 ,
58- losingTeamRatingChange : - 16 ,
59- }
52+ export const FOOSBALL_MATCH_WITH_ID = new MatchWithId (
53+ 2 ,
54+ [ { id : 1 , matchRating : 1001 } , { id : 2 , matchRating : 1002 } ] ,
55+ [ { id : 3 , matchRating : 1003 } , { id : 4 , matchRating : 1004 } ] ,
56+ true ,
57+ NOW ,
58+ 16 ,
59+ - 16 ,
60+ )
6061
6162export const TONDA_PLAYER_ROW = {
6263 Id : '3' ,
@@ -106,15 +107,15 @@ export const PETR_PLAYER: Player = {
106107 initialRating : 1200 ,
107108}
108109
109- export const FOOSBALL_MATCH : Match = {
110- team1 : [ TONDA_PLAYER ] ,
111- team2 : [ RADEK_PLAYER , PETR_PLAYER ] ,
112- team1Won : true ,
113- date : FOOSBALL_MATCH_ROW . Date ,
114- winningTeamRatingChange : 16 ,
115- losingTeamRatingChange : - 16 ,
116- gameId : 1 ,
117- }
110+ export const FOOSBALL_MATCH = new Match (
111+ [ TONDA_PLAYER ] ,
112+ [ RADEK_PLAYER , PETR_PLAYER ] ,
113+ { team1Score : 1 , team2Score : 0 } ,
114+ FOOSBALL_MATCH_ROW . Date ,
115+ 16 ,
116+ - 16 ,
117+ 1 ,
118+ )
118119
119120export const TONDA_USER_ROW : UserRow = {
120121 Id : 4 ,
0 commit comments