raspberry_games_engine_helpers 1.8.432 → 1.8.434

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.
@@ -380,7 +380,7 @@
380
380
  function addFormatStructureForTime(structure) {
381
381
  this.i1c(structure);
382
382
  }
383
- initMetadataForInterface(AbstractWithDateTimeBuilder, 'AbstractWithDateTimeBuilder', VOID, VOID, [AbstractWithDateBuilder, AbstractWithTimeBuilder, WithTime, WithDate]);
383
+ initMetadataForInterface(AbstractWithDateTimeBuilder, 'AbstractWithDateTimeBuilder', VOID, VOID, [AbstractWithDateBuilder, AbstractWithTimeBuilder, WithDate, WithTime]);
384
384
  initMetadataForClass(Builder_0, 'Builder', VOID, VOID, [AbstractDateTimeFormatBuilder, AbstractWithDateTimeBuilder]);
385
385
  initMetadataForClass(LocalDateTimeFormat, 'LocalDateTimeFormat', VOID, AbstractDateTimeFormat);
386
386
  function set_fractionOfSecond(value) {
@@ -229,7 +229,7 @@
229
229
  initMetadataForClass(LoggerOutputDataDto, 'LoggerOutputDataDto', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_10});
230
230
  //endregion
231
231
  function GameEngineConfig() {
232
- this.version = '1.8.432';
232
+ this.version = '1.8.434';
233
233
  }
234
234
  protoOf(GameEngineConfig).l17 = function () {
235
235
  return this.version;
@@ -2907,7 +2907,6 @@ export declare namespace games.jass.logic.redux.actions.mechanic {
2907
2907
  }
2908
2908
  }
2909
2909
  export declare interface GameHelper {
2910
- getBotRatingRange(league: Nullable<string>): Array<number>;
2911
2910
  filterLivePlayers(store: com.logic.redux.store.definitions.Store<any/* games.jass.logic.redux.AppState */>, playerIds: Array<string>, includeBots?: boolean): Array<string>;
2912
2911
  filterLiveDuringGamePlayers(store: com.logic.redux.store.definitions.Store<any/* games.jass.logic.redux.AppState */>, playerIds: Array<string>, includeBots?: boolean): Array<string>;
2913
2912
  filterBotPlayers(store: com.logic.redux.store.definitions.Store<any/* games.jass.logic.redux.AppState */>, playerIds: Array<string>): Array<string>;
@@ -2963,6 +2962,8 @@ export declare interface ParserHelper {
2963
2962
  };
2964
2963
  }
2965
2964
  export declare interface RatingHelper {
2965
+ getBotRatingRange(league: Nullable<string>): models.BotRatingRange;
2966
+ mapToLeague(name: string): games.jass.logic.data.models.leagues.League;
2966
2967
  isValidRatingForLeague(league: games.jass.logic.data.models.leagues.League, rating: number): boolean;
2967
2968
  mapRatingToLeague(rating: number): games.jass.logic.data.models.leagues.League;
2968
2969
  getLeaguesConfig(): games.jass.logic.data.models.leagues.LeaguesConfig;
@@ -2984,4 +2985,19 @@ export declare namespace di {
2984
2985
  const constructor: abstract new () => EngineHelpersFactory;
2985
2986
  }
2986
2987
  }
2988
+ export declare namespace models {
2989
+ class BotRatingRange {
2990
+ constructor(min: number, max: number);
2991
+ get min(): number;
2992
+ get max(): number;
2993
+ copy(min?: number, max?: number): models.BotRatingRange;
2994
+ toString(): string;
2995
+ hashCode(): number;
2996
+ equals(other: Nullable<any>): boolean;
2997
+ }
2998
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
2999
+ namespace BotRatingRange.$metadata$ {
3000
+ const constructor: abstract new () => BotRatingRange;
3001
+ }
3002
+ }
2987
3003
  export as namespace io_raspberryapps_game_engine_engine;
@@ -224,10 +224,9 @@
224
224
  var waitForExpectantAnimation = kotlin_io_raspberryapps_game_engine_core.$_$.a1;
225
225
  var isArray = kotlin_kotlin.$_$.n9;
226
226
  var mapOfObject = kotlin_io_raspberryapps_game_engine_core.$_$.h1;
227
- var Default_getInstance = kotlin_kotlin.$_$.m3;
228
- var numberToInt = kotlin_kotlin.$_$.ba;
229
227
  var getPlayer = kotlin_io_raspberryapps_game_engine_core.$_$.g;
230
228
  var GameUserInfo = kotlin_io_raspberryapps_game_engine_core.$_$.b;
229
+ var Default_getInstance = kotlin_kotlin.$_$.m3;
231
230
  var d = kotlin_io_raspberryapps_cardgame_logger.$_$.h;
232
231
  var generateMsg = kotlin_io_raspberryapps_cardgame_logger.$_$.b;
233
232
  var e = kotlin_io_raspberryapps_cardgame_logger.$_$.i;
@@ -236,6 +235,7 @@
236
235
  var w = kotlin_io_raspberryapps_cardgame_logger.$_$.l;
237
236
  var LoggerOutput = kotlin_io_raspberryapps_cardgame_logger.$_$.a;
238
237
  var KtList = kotlin_kotlin.$_$.h4;
238
+ var numberToInt = kotlin_kotlin.$_$.ba;
239
239
  var RaspberryLogger = kotlin_io_raspberryapps_cardgame_logger.$_$.g;
240
240
  var KProperty1 = kotlin_kotlin.$_$.va;
241
241
  var getPropertyCallableRef = kotlin_kotlin.$_$.e9;
@@ -904,6 +904,7 @@
904
904
  initMetadataForInterface(RatingHelper, 'RatingHelper');
905
905
  initMetadataForClass(RatingHelperImpl, 'RatingHelperImpl', VOID, VOID, [RatingHelper]);
906
906
  initMetadataForClass(EngineHelpersFactory, 'EngineHelpersFactory', EngineHelpersFactory);
907
+ initMetadataForClass(BotRatingRange, 'BotRatingRange');
907
908
  //endregion
908
909
  function GameStoreContract() {
909
910
  }
@@ -37213,24 +37214,6 @@
37213
37214
  function GameHelperImpl(logger) {
37214
37215
  this.p45_1 = logger;
37215
37216
  }
37216
- protoOf(GameHelperImpl).getBotRatingRange = function (league) {
37217
- var tmp;
37218
- if (league == null) {
37219
- tmp = Default_getInstance().yd() ? League_BEGINNER_getInstance() : League_ROOKIE_getInstance();
37220
- } else {
37221
- tmp = this.mapToLeague(league);
37222
- }
37223
- var targetLeague = tmp;
37224
- var defaultConfig = Companion_instance_9.defaultConfig();
37225
- var minRating = targetLeague.getMinRating();
37226
- var maxRating = targetLeague.getMaxRating(defaultConfig.maxUserRating);
37227
- var factor = 0.3;
37228
- var botMaxRating = numberToInt(minRating + (maxRating - minRating | 0) * factor);
37229
- // Inline function 'kotlin.arrayOf' call
37230
- // Inline function 'kotlin.js.unsafeCast' call
37231
- // Inline function 'kotlin.js.asDynamic' call
37232
- return [minRating, botMaxRating];
37233
- };
37234
37217
  protoOf(GameHelperImpl).m45 = function (store, playerIds, includeBots) {
37235
37218
  var state = store.state;
37236
37219
  var tmp;
@@ -38173,6 +38156,27 @@
38173
38156
  this.h46_1 = json;
38174
38157
  this.i46_1 = userRatingInteractor;
38175
38158
  }
38159
+ protoOf(RatingHelperImpl).getBotRatingRange = function (league) {
38160
+ var tmp;
38161
+ if (league == null) {
38162
+ tmp = Default_getInstance().yd() ? League_BEGINNER_getInstance() : League_ROOKIE_getInstance();
38163
+ } else {
38164
+ tmp = this.mapToLeague(league);
38165
+ }
38166
+ var targetLeague = tmp;
38167
+ var defaultConfig = Companion_instance_9.defaultConfig();
38168
+ var minRating = targetLeague.getMinRating();
38169
+ var maxRating = targetLeague.getMaxRating(defaultConfig.maxUserRating);
38170
+ var factor = 0.3;
38171
+ var botMaxRating = numberToInt(minRating + (maxRating - minRating | 0) * factor);
38172
+ return new BotRatingRange(minRating, botMaxRating);
38173
+ };
38174
+ protoOf(RatingHelperImpl).mapToLeague = function (name) {
38175
+ // Inline function 'kotlin.text.uppercase' call
38176
+ // Inline function 'kotlin.js.asDynamic' call
38177
+ var tmp$ret$1 = name.toUpperCase();
38178
+ return valueOf_0(tmp$ret$1);
38179
+ };
38176
38180
  protoOf(RatingHelperImpl).isValidRatingForLeague = function (league, rating) {
38177
38181
  return this.i46_1.v40(league, rating);
38178
38182
  };
@@ -38482,6 +38486,49 @@
38482
38486
  getPropertyCallableRef('gameResources', 1, tmp, EngineHelpersFactory$_get_gameResources_$ref_kynd2o_0(), null);
38483
38487
  return tmp0.v1();
38484
38488
  };
38489
+ function BotRatingRange(min, max) {
38490
+ this.min = min;
38491
+ this.max = max;
38492
+ }
38493
+ protoOf(BotRatingRange).u46 = function () {
38494
+ return this.min;
38495
+ };
38496
+ protoOf(BotRatingRange).v46 = function () {
38497
+ return this.max;
38498
+ };
38499
+ protoOf(BotRatingRange).sc = function () {
38500
+ return this.min;
38501
+ };
38502
+ protoOf(BotRatingRange).tc = function () {
38503
+ return this.max;
38504
+ };
38505
+ protoOf(BotRatingRange).w46 = function (min, max) {
38506
+ return new BotRatingRange(min, max);
38507
+ };
38508
+ protoOf(BotRatingRange).copy = function (min, max, $super) {
38509
+ min = min === VOID ? this.min : min;
38510
+ max = max === VOID ? this.max : max;
38511
+ return $super === VOID ? this.w46(min, max) : $super.w46.call(this, min, max);
38512
+ };
38513
+ protoOf(BotRatingRange).toString = function () {
38514
+ return 'BotRatingRange(min=' + this.min + ', max=' + this.max + ')';
38515
+ };
38516
+ protoOf(BotRatingRange).hashCode = function () {
38517
+ var result = this.min;
38518
+ result = imul(result, 31) + this.max | 0;
38519
+ return result;
38520
+ };
38521
+ protoOf(BotRatingRange).equals = function (other) {
38522
+ if (this === other)
38523
+ return true;
38524
+ if (!(other instanceof BotRatingRange))
38525
+ return false;
38526
+ if (!(this.min === other.min))
38527
+ return false;
38528
+ if (!(this.max === other.max))
38529
+ return false;
38530
+ return true;
38531
+ };
38485
38532
  //region block: post-declaration
38486
38533
  defineProp(protoOf(GameLifecycleState), 'isActive', protoOf(GameLifecycleState).k2g);
38487
38534
  defineProp(protoOf(GameLifecycleState), 'isFinishing', protoOf(GameLifecycleState).l2g);
@@ -40038,6 +40085,8 @@
40038
40085
  defineProp(_, 'WARN', get_WARN, VOID, true);
40039
40086
  var $di = _.di || (_.di = {});
40040
40087
  $di.EngineHelpersFactory = EngineHelpersFactory;
40088
+ var $models = _.models || (_.models = {});
40089
+ $models.BotRatingRange = BotRatingRange;
40041
40090
  }
40042
40091
  $jsExportAll$(_);
40043
40092
  kotlin_kotlin.$jsExportAll$(_);