@mtgame/core 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/mtgame-core.umd.js +44 -24
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/localization/rugby-game-log-types.js +3 -1
- package/esm2015/models/game.js +9 -11
- package/esm2015/models/rugby-game-config.js +8 -2
- package/esm2015/models/rugby-game-log.js +18 -15
- package/esm2015/models/rugby-game-statistic.js +1 -1
- package/esm2015/models/rugby-game-team-statistic.js +1 -1
- package/esm2015/models/rugby-statistic.js +3 -1
- package/esm2015/models/tournament-team.js +7 -2
- package/esm5/localization/rugby-game-log-types.js +3 -1
- package/esm5/models/game.js +9 -11
- package/esm5/models/rugby-game-config.js +12 -2
- package/esm5/models/rugby-game-log.js +17 -14
- package/esm5/models/rugby-game-statistic.js +1 -1
- package/esm5/models/rugby-game-team-statistic.js +1 -1
- package/esm5/models/rugby-statistic.js +3 -1
- package/esm5/models/tournament-team.js +7 -2
- package/fesm2015/mtgame-core.js +41 -25
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +44 -24
- package/fesm5/mtgame-core.js.map +1 -1
- package/localization/rugby-game-log-types.d.ts +2 -0
- package/models/rugby-game-config.d.ts +1 -0
- package/models/rugby-game-log.d.ts +16 -13
- package/models/rugby-game-statistic.d.ts +2 -1
- package/models/rugby-game-team-statistic.d.ts +2 -1
- package/models/rugby-statistic.d.ts +9 -2
- package/models/tournament-team.d.ts +5 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/mtgame-core.js
CHANGED
|
@@ -1789,6 +1789,16 @@ var RugbyGameConfig = /** @class */ (function (_super) {
|
|
|
1789
1789
|
function RugbyGameConfig() {
|
|
1790
1790
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1791
1791
|
}
|
|
1792
|
+
Object.defineProperty(RugbyGameConfig.prototype, "penaltyPeriod", {
|
|
1793
|
+
get: function () {
|
|
1794
|
+
if (this.overtimeType !== OvertimeTypes.time_and_penalties) {
|
|
1795
|
+
return +this.periodsCount + 1;
|
|
1796
|
+
}
|
|
1797
|
+
return +this.periodsCount + this.overtimePeriods + 1;
|
|
1798
|
+
},
|
|
1799
|
+
enumerable: true,
|
|
1800
|
+
configurable: true
|
|
1801
|
+
});
|
|
1792
1802
|
RugbyGameConfig.toFront = function (data) { };
|
|
1793
1803
|
RugbyGameConfig.toBack = function (data) { };
|
|
1794
1804
|
__decorate([
|
|
@@ -1986,32 +1996,30 @@ var Game = /** @class */ (function (_super) {
|
|
|
1986
1996
|
});
|
|
1987
1997
|
Object.defineProperty(Game.prototype, "isTeamWon", {
|
|
1988
1998
|
get: function () {
|
|
1989
|
-
return
|
|
1999
|
+
return [GameResultTypes.team_won, GameResultTypes.competitor_team_technical_defeat].includes(this.resultType);
|
|
1990
2000
|
},
|
|
1991
2001
|
enumerable: true,
|
|
1992
2002
|
configurable: true
|
|
1993
2003
|
});
|
|
1994
2004
|
Object.defineProperty(Game.prototype, "isCompetitorTeamWon", {
|
|
1995
2005
|
get: function () {
|
|
1996
|
-
return
|
|
2006
|
+
return [GameResultTypes.competitor_team_won, GameResultTypes.team_technical_defeat].includes(this.resultType);
|
|
1997
2007
|
},
|
|
1998
2008
|
enumerable: true,
|
|
1999
2009
|
configurable: true
|
|
2000
2010
|
});
|
|
2001
2011
|
Object.defineProperty(Game.prototype, "teamWinnerId", {
|
|
2002
2012
|
get: function () {
|
|
2003
|
-
if (this.
|
|
2013
|
+
if (!this.isClosed) {
|
|
2004
2014
|
return null;
|
|
2005
2015
|
}
|
|
2006
|
-
if (this.
|
|
2007
|
-
return
|
|
2016
|
+
if (this.isTeamWon) {
|
|
2017
|
+
return this.team.id;
|
|
2008
2018
|
}
|
|
2009
|
-
if (this.
|
|
2010
|
-
return this.
|
|
2011
|
-
}
|
|
2012
|
-
else {
|
|
2013
|
-
return this.teamScore > this.competitorTeamScore ? this.teamId : this.competitorTeamId;
|
|
2019
|
+
if (this.isCompetitorTeamWon) {
|
|
2020
|
+
return this.competitorTeam.id;
|
|
2014
2021
|
}
|
|
2022
|
+
return null;
|
|
2015
2023
|
},
|
|
2016
2024
|
enumerable: true,
|
|
2017
2025
|
configurable: true
|
|
@@ -2338,6 +2346,7 @@ var TournamentTeam = /** @class */ (function (_super) {
|
|
|
2338
2346
|
games_count: 'gamesCount',
|
|
2339
2347
|
won_games_count: 'wonGamesCount',
|
|
2340
2348
|
draw_games_count: 'drawGamesCount',
|
|
2349
|
+
lose_games_count: 'loseGamesCount',
|
|
2341
2350
|
last_games_count: 'lastGamesCount',
|
|
2342
2351
|
last_games_won: 'lastGamesWon',
|
|
2343
2352
|
score_sum: 'scoreSum',
|
|
@@ -2352,7 +2361,11 @@ var TournamentTeam = /** @class */ (function (_super) {
|
|
|
2352
2361
|
lose_normal_time_games_count: 'loseNormalTimeGamesCount',
|
|
2353
2362
|
win_overtime_games_count: 'winOvertimeGamesCount',
|
|
2354
2363
|
lose_overtime_games_count: 'loseOvertimeGamesCount',
|
|
2355
|
-
last_five_games: 'lastFiveGames'
|
|
2364
|
+
last_five_games: 'lastFiveGames',
|
|
2365
|
+
tries_scored: 'triesScored',
|
|
2366
|
+
tries_missed: 'triesMissed',
|
|
2367
|
+
attack_bonuses: 'attackBonuses',
|
|
2368
|
+
defense_bonuses: 'defenseBonuses',
|
|
2356
2369
|
},
|
|
2357
2370
|
relation: {
|
|
2358
2371
|
logo: File,
|
|
@@ -5201,6 +5214,8 @@ var RugbyStatistic = /** @class */ (function (_super) {
|
|
|
5201
5214
|
win_lose: 'winLose',
|
|
5202
5215
|
games_count: 'gamesCount',
|
|
5203
5216
|
won_games_count: 'wonGamesCount',
|
|
5217
|
+
lose_games_count: 'loseGamesCount',
|
|
5218
|
+
draw_games_count: 'drawGamesCount',
|
|
5204
5219
|
newbie: 'newbie',
|
|
5205
5220
|
// User statistic
|
|
5206
5221
|
points: 'points',
|
|
@@ -7130,20 +7145,22 @@ var RugbyGameLogTypes;
|
|
|
7130
7145
|
RugbyGameLogTypes[RugbyGameLogTypes["carries_other_gainline"] = 20] = "carries_other_gainline";
|
|
7131
7146
|
RugbyGameLogTypes[RugbyGameLogTypes["bleeding_injury"] = 21] = "bleeding_injury";
|
|
7132
7147
|
RugbyGameLogTypes[RugbyGameLogTypes["head_injury"] = 22] = "head_injury";
|
|
7148
|
+
RugbyGameLogTypes[RugbyGameLogTypes["end_game_penalty_miss"] = 23] = "end_game_penalty_miss";
|
|
7149
|
+
RugbyGameLogTypes[RugbyGameLogTypes["end_game_penalty_goal"] = 24] = "end_game_penalty_goal";
|
|
7133
7150
|
// team actions
|
|
7134
|
-
RugbyGameLogTypes[RugbyGameLogTypes["timeout"] =
|
|
7135
|
-
RugbyGameLogTypes[RugbyGameLogTypes["scrum_won"] =
|
|
7136
|
-
RugbyGameLogTypes[RugbyGameLogTypes["scrum_lose"] =
|
|
7137
|
-
RugbyGameLogTypes[RugbyGameLogTypes["scrum_won_free"] =
|
|
7138
|
-
RugbyGameLogTypes[RugbyGameLogTypes["lineout_success"] =
|
|
7139
|
-
RugbyGameLogTypes[RugbyGameLogTypes["lineout_loss"] =
|
|
7140
|
-
RugbyGameLogTypes[RugbyGameLogTypes["lineout_steal"] =
|
|
7141
|
-
RugbyGameLogTypes[RugbyGameLogTypes["quick_throw"] =
|
|
7142
|
-
RugbyGameLogTypes[RugbyGameLogTypes["ruck_won"] =
|
|
7143
|
-
RugbyGameLogTypes[RugbyGameLogTypes["ruck_lose"] =
|
|
7144
|
-
RugbyGameLogTypes[RugbyGameLogTypes["maul_won"] =
|
|
7145
|
-
RugbyGameLogTypes[RugbyGameLogTypes["maul_lose"] =
|
|
7146
|
-
RugbyGameLogTypes[RugbyGameLogTypes["team_foul"] =
|
|
7151
|
+
RugbyGameLogTypes[RugbyGameLogTypes["timeout"] = 25] = "timeout";
|
|
7152
|
+
RugbyGameLogTypes[RugbyGameLogTypes["scrum_won"] = 26] = "scrum_won";
|
|
7153
|
+
RugbyGameLogTypes[RugbyGameLogTypes["scrum_lose"] = 27] = "scrum_lose";
|
|
7154
|
+
RugbyGameLogTypes[RugbyGameLogTypes["scrum_won_free"] = 28] = "scrum_won_free";
|
|
7155
|
+
RugbyGameLogTypes[RugbyGameLogTypes["lineout_success"] = 29] = "lineout_success";
|
|
7156
|
+
RugbyGameLogTypes[RugbyGameLogTypes["lineout_loss"] = 30] = "lineout_loss";
|
|
7157
|
+
RugbyGameLogTypes[RugbyGameLogTypes["lineout_steal"] = 31] = "lineout_steal";
|
|
7158
|
+
RugbyGameLogTypes[RugbyGameLogTypes["quick_throw"] = 32] = "quick_throw";
|
|
7159
|
+
RugbyGameLogTypes[RugbyGameLogTypes["ruck_won"] = 33] = "ruck_won";
|
|
7160
|
+
RugbyGameLogTypes[RugbyGameLogTypes["ruck_lose"] = 34] = "ruck_lose";
|
|
7161
|
+
RugbyGameLogTypes[RugbyGameLogTypes["maul_won"] = 35] = "maul_won";
|
|
7162
|
+
RugbyGameLogTypes[RugbyGameLogTypes["maul_lose"] = 36] = "maul_lose";
|
|
7163
|
+
RugbyGameLogTypes[RugbyGameLogTypes["team_foul"] = 37] = "team_foul";
|
|
7147
7164
|
})(RugbyGameLogTypes || (RugbyGameLogTypes = {}));
|
|
7148
7165
|
var RUGBY_GAME_LOG_TYPE_POINTS = (_a$1 = {},
|
|
7149
7166
|
_a$1[RugbyGameLogTypes.penalty_try] = 7,
|
|
@@ -7151,6 +7168,7 @@ var RUGBY_GAME_LOG_TYPE_POINTS = (_a$1 = {},
|
|
|
7151
7168
|
_a$1[RugbyGameLogTypes.conversion_goal] = 2,
|
|
7152
7169
|
_a$1[RugbyGameLogTypes.penalty_goal] = 3,
|
|
7153
7170
|
_a$1[RugbyGameLogTypes.drop_goal] = 3,
|
|
7171
|
+
_a$1[RugbyGameLogTypes.end_game_penalty_goal] = 1,
|
|
7154
7172
|
_a$1);
|
|
7155
7173
|
var RUGBY_TEAM_LOG_TYPES = [
|
|
7156
7174
|
RugbyGameLogTypes.timeout, RugbyGameLogTypes.scrum_won, RugbyGameLogTypes.scrum_lose, RugbyGameLogTypes.scrum_won_free,
|
|
@@ -9158,6 +9176,8 @@ var RugbyGameLogTypeLocalization = (_a$8 = {},
|
|
|
9158
9176
|
_a$8[RugbyGameLogTypes.carries_other_gainline] = 'Прорыв линии',
|
|
9159
9177
|
_a$8[RugbyGameLogTypes.bleeding_injury] = 'Кровоточащая травма',
|
|
9160
9178
|
_a$8[RugbyGameLogTypes.head_injury] = 'Травма головы',
|
|
9179
|
+
_a$8[RugbyGameLogTypes.end_game_penalty_miss] = 'Штрафной промах',
|
|
9180
|
+
_a$8[RugbyGameLogTypes.end_game_penalty_goal] = 'Штрафной гол',
|
|
9161
9181
|
_a$8[RugbyGameLogTypes.timeout] = 'Таймаут',
|
|
9162
9182
|
_a$8[RugbyGameLogTypes.scrum_won] = 'Свахтка выиграна',
|
|
9163
9183
|
_a$8[RugbyGameLogTypes.scrum_lose] = 'Схватка проиграна',
|