game_client_logic_deb 1.8.181 → 1.8.185
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/Kosi-Kaverit-kaverit.js +80 -80
- package/Kosi-Kodein-kodein-di.js +632 -632
- package/Kosi-Kodein-kodein-di.js.map +1 -1
- package/Kotlin-DateTime-library-kotlinx-datetime.js +1534 -1534
- package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -1
- package/Logic_Debertz-core.js +1755 -1600
- package/Logic_Debertz-core.js.map +1 -1
- package/Logic_Debertz-engine.js +12580 -12423
- package/Logic_Debertz-engine.js.map +1 -1
- package/Logic_Debertz-game_client.d.ts +78 -32
- package/Logic_Debertz-game_client.js +4492 -4490
- package/Logic_Debertz-game_client.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +3063 -2305
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlinx-atomicfu.js +25 -25
- package/kotlinx-coroutines-core.js +3708 -2676
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-io-kotlinx-io-core.js +297 -297
- package/kotlinx-io-kotlinx-io-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +2154 -2126
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.js +1512 -1498
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
- package/ktor-ktor-client-content-negotiation.js +703 -5
- package/ktor-ktor-client-content-negotiation.js.map +1 -1
- package/ktor-ktor-client-core.js +7197 -5
- package/ktor-ktor-client-core.js.map +1 -1
- package/ktor-ktor-client-logging.js +1460 -11
- package/ktor-ktor-client-logging.js.map +1 -1
- package/ktor-ktor-events.js +87 -5
- package/ktor-ktor-events.js.map +1 -1
- package/ktor-ktor-http.js +3253 -5
- package/ktor-ktor-http.js.map +1 -1
- package/ktor-ktor-io.js +6455 -5
- package/ktor-ktor-io.js.map +1 -1
- package/ktor-ktor-serialization-kotlinx-json.js +57 -5
- package/ktor-ktor-serialization-kotlinx-json.js.map +1 -1
- package/ktor-ktor-serialization-kotlinx.js +837 -5
- package/ktor-ktor-serialization-kotlinx.js.map +1 -1
- package/ktor-ktor-serialization.js +359 -5
- package/ktor-ktor-serialization.js.map +1 -1
- package/ktor-ktor-utils.js +2645 -5
- package/ktor-ktor-utils.js.map +1 -1
- package/ktor-ktor-websockets.js +456 -5
- package/ktor-ktor-websockets.js.map +1 -1
- package/package.json +1 -1
- package/raspberry-cardgame-lib-core.js +666 -168
- package/raspberry-cardgame-lib-core.js.map +1 -1
- package/raspberry-cardgame-lib-logger.js +107 -106
- package/raspberry-cardgame-lib-logger.js.map +1 -1
- package/raspberry-cardgame-lib-random.js +2492 -139
- package/raspberry-cardgame-lib-random.js.map +1 -1
- package/secure-random-secure-random.js +163 -5
- package/secure-random-secure-random.js.map +1 -1
- package/uuid.js +36 -36
- package/uuid.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (root, factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-serialization-kotlinx-serialization-core.js'], factory);
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-serialization-kotlinx-serialization-core.js', './raspberry-cardgame-lib-random.js', './kotlinx-coroutines-core.js', './Kotlin-DateTime-library-kotlinx-datetime.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'));
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./raspberry-cardgame-lib-random.js'), require('./kotlinx-coroutines-core.js'), require('./Kotlin-DateTime-library-kotlinx-datetime.js'));
|
|
6
6
|
else {
|
|
7
7
|
if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
8
|
throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'raspberry-cardgame-lib-core'.");
|
|
@@ -10,55 +10,81 @@
|
|
|
10
10
|
if (typeof this['kotlinx-serialization-kotlinx-serialization-core'] === 'undefined') {
|
|
11
11
|
throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'kotlinx-serialization-kotlinx-serialization-core' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-core' is loaded prior to 'raspberry-cardgame-lib-core'.");
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
if (typeof this['raspberry-cardgame-lib-random'] === 'undefined') {
|
|
14
|
+
throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'raspberry-cardgame-lib-random' was not found. Please, check whether 'raspberry-cardgame-lib-random' is loaded prior to 'raspberry-cardgame-lib-core'.");
|
|
15
|
+
}
|
|
16
|
+
if (typeof this['kotlinx-coroutines-core'] === 'undefined') {
|
|
17
|
+
throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'raspberry-cardgame-lib-core'.");
|
|
18
|
+
}
|
|
19
|
+
if (typeof this['Kotlin-DateTime-library-kotlinx-datetime'] === 'undefined') {
|
|
20
|
+
throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'Kotlin-DateTime-library-kotlinx-datetime' was not found. Please, check whether 'Kotlin-DateTime-library-kotlinx-datetime' is loaded prior to 'raspberry-cardgame-lib-core'.");
|
|
21
|
+
}
|
|
22
|
+
root['raspberry-cardgame-lib-core'] = factory(typeof this['raspberry-cardgame-lib-core'] === 'undefined' ? {} : this['raspberry-cardgame-lib-core'], this['kotlin-kotlin-stdlib'], this['kotlinx-serialization-kotlinx-serialization-core'], this['raspberry-cardgame-lib-random'], this['kotlinx-coroutines-core'], this['Kotlin-DateTime-library-kotlinx-datetime']);
|
|
14
23
|
}
|
|
15
|
-
}(globalThis, function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core) {
|
|
24
|
+
}(globalThis, function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_io_raspberryapps_cardgame_random, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_org_jetbrains_kotlinx_kotlinx_datetime) {
|
|
16
25
|
'use strict';
|
|
17
26
|
//region block: imports
|
|
18
27
|
var imul = Math.imul;
|
|
19
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
20
|
-
var initMetadataForObject = kotlin_kotlin.$_$.
|
|
21
|
-
var defineProp = kotlin_kotlin.$_$.
|
|
22
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
23
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
24
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
25
|
-
var Comparator = kotlin_kotlin.$_$.
|
|
28
|
+
var protoOf = kotlin_kotlin.$_$.oc;
|
|
29
|
+
var initMetadataForObject = kotlin_kotlin.$_$.sb;
|
|
30
|
+
var defineProp = kotlin_kotlin.$_$.eb;
|
|
31
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.n;
|
|
32
|
+
var Unit_instance = kotlin_kotlin.$_$.l5;
|
|
33
|
+
var THROW_CCE = kotlin_kotlin.$_$.og;
|
|
34
|
+
var Comparator = kotlin_kotlin.$_$.ag;
|
|
26
35
|
var VOID = kotlin_kotlin.$_$.f;
|
|
27
|
-
var take = kotlin_kotlin.$_$.
|
|
28
|
-
var toList = kotlin_kotlin.$_$.
|
|
29
|
-
var takeLast = kotlin_kotlin.$_$.
|
|
30
|
-
var noWhenBranchMatchedException = kotlin_kotlin.$_$.
|
|
31
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
32
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.
|
|
33
|
-
var Enum = kotlin_kotlin.$_$.
|
|
34
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
35
|
-
var createSimpleEnumSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.
|
|
36
|
-
var enumEntries = kotlin_kotlin.$_$.
|
|
37
|
-
var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.
|
|
38
|
-
var lazy = kotlin_kotlin.$_$.
|
|
39
|
-
var SerializerFactory = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.
|
|
40
|
-
var Long = kotlin_kotlin.$_$.
|
|
41
|
-
var initMetadataForInterface = kotlin_kotlin.$_$.
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
36
|
+
var take = kotlin_kotlin.$_$.k9;
|
|
37
|
+
var toList = kotlin_kotlin.$_$.o9;
|
|
38
|
+
var takeLast = kotlin_kotlin.$_$.j9;
|
|
39
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.mh;
|
|
40
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.ob;
|
|
41
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v1;
|
|
42
|
+
var Enum = kotlin_kotlin.$_$.dg;
|
|
43
|
+
var initMetadataForClass = kotlin_kotlin.$_$.nb;
|
|
44
|
+
var createSimpleEnumSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.d2;
|
|
45
|
+
var enumEntries = kotlin_kotlin.$_$.sa;
|
|
46
|
+
var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.k;
|
|
47
|
+
var lazy = kotlin_kotlin.$_$.kh;
|
|
48
|
+
var SerializerFactory = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.b2;
|
|
49
|
+
var Long = kotlin_kotlin.$_$.ig;
|
|
50
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.qb;
|
|
51
|
+
var until = kotlin_kotlin.$_$.ed;
|
|
52
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.o6;
|
|
53
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.m;
|
|
54
|
+
var SecureRandom = kotlin_io_raspberryapps_cardgame_random.$_$.i;
|
|
55
|
+
var CoroutineImpl = kotlin_kotlin.$_$.qa;
|
|
56
|
+
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f1;
|
|
57
|
+
var isInterface = kotlin_kotlin.$_$.bc;
|
|
58
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ca;
|
|
59
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.rb;
|
|
60
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.pb;
|
|
61
|
+
var count = kotlin_kotlin.$_$.f7;
|
|
62
|
+
var System_instance = kotlin_org_jetbrains_kotlinx_kotlinx_datetime.$_$.a;
|
|
63
|
+
var withTimeout = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
|
|
64
|
+
var Companion_getInstance = kotlin_kotlin.$_$.d5;
|
|
65
|
+
var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.g;
|
|
66
|
+
var toDuration = kotlin_kotlin.$_$.vf;
|
|
67
|
+
var addAll = kotlin_kotlin.$_$.c6;
|
|
68
|
+
var Collection = kotlin_kotlin.$_$.n5;
|
|
69
|
+
var toMutableList = kotlin_kotlin.$_$.s9;
|
|
70
|
+
var listOf = kotlin_kotlin.$_$.m8;
|
|
71
|
+
var first = kotlin_kotlin.$_$.r7;
|
|
72
|
+
var sorted = kotlin_kotlin.$_$.h9;
|
|
73
|
+
var asReversed = kotlin_kotlin.$_$.g6;
|
|
74
|
+
var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.c2;
|
|
75
|
+
var first_0 = kotlin_kotlin.$_$.q7;
|
|
76
|
+
var compareValues = kotlin_kotlin.$_$.aa;
|
|
77
|
+
var sortWith = kotlin_kotlin.$_$.f9;
|
|
78
|
+
var lastOrNull = kotlin_kotlin.$_$.g8;
|
|
79
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.w;
|
|
80
|
+
var sortedWith = kotlin_kotlin.$_$.g9;
|
|
81
|
+
var NoSuchElementException_init_$Create$_0 = kotlin_kotlin.$_$.a2;
|
|
82
|
+
var compareTo = kotlin_kotlin.$_$.db;
|
|
83
|
+
var toString = kotlin_kotlin.$_$.sc;
|
|
84
|
+
var dropLast = kotlin_kotlin.$_$.h7;
|
|
85
|
+
var plus = kotlin_kotlin.$_$.v8;
|
|
86
|
+
var minus = kotlin_kotlin.$_$.q8;
|
|
87
|
+
var plus_0 = kotlin_kotlin.$_$.w8;
|
|
62
88
|
//endregion
|
|
63
89
|
//region block: pre-declaration
|
|
64
90
|
initMetadataForObject(CoreConfig, 'CoreConfig');
|
|
@@ -69,30 +95,37 @@
|
|
|
69
95
|
initMetadataForCompanion(Companion_0);
|
|
70
96
|
initMetadataForClass(GameCard, 'GameCard');
|
|
71
97
|
initMetadataForCompanion(Companion_1, VOID, [SerializerFactory]);
|
|
72
|
-
initMetadataForClass(Suit, 'Suit', VOID, Enum, VOID, VOID, VOID, {0:
|
|
98
|
+
initMetadataForClass(Suit, 'Suit', VOID, Enum, VOID, VOID, VOID, {0: Companion_getInstance_2});
|
|
73
99
|
initMetadataForClass(CardsRandomProvider, 'CardsRandomProvider', VOID, Enum);
|
|
74
100
|
function createNewShuffledCardDeck$default(leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion, $super) {
|
|
75
101
|
leftCardIndexForEachSuit = leftCardIndexForEachSuit === VOID ? 0 : leftCardIndexForEachSuit;
|
|
76
102
|
rightCardIndexForEachSuit = rightCardIndexForEachSuit === VOID ? 0 : rightCardIndexForEachSuit;
|
|
77
103
|
timeoutMillis = timeoutMillis === VOID ? new Long(5000, 0) : timeoutMillis;
|
|
78
104
|
provider = provider === VOID ? CardsRandomProvider_CUSTOM_getInstance() : provider;
|
|
79
|
-
return $super === VOID ? this.
|
|
105
|
+
return $super === VOID ? this.w60(leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion) : $super.w60.call(this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion);
|
|
80
106
|
}
|
|
81
107
|
function standardShuffledCards$default(cards, times, $super) {
|
|
82
108
|
times = times === VOID ? 3 : times;
|
|
83
|
-
return $super === VOID ? this.
|
|
109
|
+
return $super === VOID ? this.z60(cards, times) : $super.z60.call(this, cards, times);
|
|
84
110
|
}
|
|
85
111
|
initMetadataForInterface(CardsDealerProvider, 'CardsDealerProvider', VOID, VOID, VOID, [6]);
|
|
112
|
+
initMetadataForCompanion(Companion_2);
|
|
113
|
+
initMetadataForLambda(CardsDealerProviderImpl$getRandomOrgCards$slambda, CoroutineImpl, VOID, [1]);
|
|
114
|
+
initMetadataForCoroutine($createNewShuffledCardDeckCOROUTINE$0, CoroutineImpl);
|
|
115
|
+
initMetadataForCoroutine($getRandomOrgCardsCOROUTINE$1, CoroutineImpl);
|
|
116
|
+
initMetadataForClass(CardsDealerProviderImpl, 'CardsDealerProviderImpl', VOID, VOID, [CardsDealerProvider], [6]);
|
|
117
|
+
initMetadataForCompanion(Companion_3);
|
|
118
|
+
initMetadataForClass(FakeCardsDealerProvider, 'FakeCardsDealerProvider', FakeCardsDealerProvider, VOID, [CardsDealerProvider], [6]);
|
|
86
119
|
function findCardsInRowCombinations$default(cards, supportedCombinations, checkFromIndex, includeCardNames, suit, $super) {
|
|
87
120
|
checkFromIndex = checkFromIndex === VOID ? first(supportedCombinations) : checkFromIndex;
|
|
88
121
|
includeCardNames = includeCardNames === VOID ? null : includeCardNames;
|
|
89
122
|
suit = suit === VOID ? null : suit;
|
|
90
|
-
return $super === VOID ? this.
|
|
123
|
+
return $super === VOID ? this.p63(cards, supportedCombinations, checkFromIndex, includeCardNames, suit) : $super.p63.call(this, cards, supportedCombinations, checkFromIndex, includeCardNames, suit);
|
|
91
124
|
}
|
|
92
125
|
function findSameCardsNumberCombinations$default(cards, cardsCount, includeCardNames, $super) {
|
|
93
126
|
cardsCount = cardsCount === VOID ? 4 : cardsCount;
|
|
94
127
|
includeCardNames = includeCardNames === VOID ? null : includeCardNames;
|
|
95
|
-
return $super === VOID ? this.
|
|
128
|
+
return $super === VOID ? this.r63(cards, cardsCount, includeCardNames) : $super.r63.call(this, cards, cardsCount, includeCardNames);
|
|
96
129
|
}
|
|
97
130
|
initMetadataForInterface(CombinationsCheckerProvider, 'CombinationsCheckerProvider');
|
|
98
131
|
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator]);
|
|
@@ -101,9 +134,9 @@
|
|
|
101
134
|
initMetadataForClass(DealerReducerImpl, 'DealerReducerImpl', VOID, VOID, [DealerReducer]);
|
|
102
135
|
//endregion
|
|
103
136
|
function CoreConfig() {
|
|
104
|
-
this.version = '0.0.
|
|
137
|
+
this.version = '0.0.33';
|
|
105
138
|
}
|
|
106
|
-
protoOf(CoreConfig).
|
|
139
|
+
protoOf(CoreConfig).t2w = function () {
|
|
107
140
|
return this.version;
|
|
108
141
|
};
|
|
109
142
|
var CoreConfig_instance;
|
|
@@ -126,12 +159,12 @@
|
|
|
126
159
|
}
|
|
127
160
|
function CardNumberComparator() {
|
|
128
161
|
}
|
|
129
|
-
protoOf(CardNumberComparator).
|
|
130
|
-
return b.
|
|
162
|
+
protoOf(CardNumberComparator).e60 = function (a, b) {
|
|
163
|
+
return b.g60() - a.g60() | 0;
|
|
131
164
|
};
|
|
132
165
|
protoOf(CardNumberComparator).compare = function (a, b) {
|
|
133
166
|
var tmp = a instanceof GameCard ? a : THROW_CCE();
|
|
134
|
-
return this.
|
|
167
|
+
return this.e60(tmp, b instanceof GameCard ? b : THROW_CCE());
|
|
135
168
|
};
|
|
136
169
|
var CardNumberComparator_instance;
|
|
137
170
|
function CardNumberComparator_getInstance() {
|
|
@@ -139,12 +172,12 @@
|
|
|
139
172
|
}
|
|
140
173
|
function CardIndexComparator() {
|
|
141
174
|
}
|
|
142
|
-
protoOf(CardIndexComparator).
|
|
143
|
-
return a.
|
|
175
|
+
protoOf(CardIndexComparator).e60 = function (a, b) {
|
|
176
|
+
return a.f60_1 - b.f60_1 | 0;
|
|
144
177
|
};
|
|
145
178
|
protoOf(CardIndexComparator).compare = function (a, b) {
|
|
146
179
|
var tmp = a instanceof GameCard ? a : THROW_CCE();
|
|
147
|
-
return this.
|
|
180
|
+
return this.e60(tmp, b instanceof GameCard ? b : THROW_CCE());
|
|
148
181
|
};
|
|
149
182
|
var CardIndexComparator_instance;
|
|
150
183
|
function CardIndexComparator_getInstance() {
|
|
@@ -155,12 +188,12 @@
|
|
|
155
188
|
}
|
|
156
189
|
function distributeCardsBottom(_this__u8e3s4, count) {
|
|
157
190
|
var cardsToDeal = toList(take(_this__u8e3s4, count));
|
|
158
|
-
_this__u8e3s4.
|
|
191
|
+
_this__u8e3s4.z1(cardsToDeal);
|
|
159
192
|
return cardsToDeal;
|
|
160
193
|
}
|
|
161
194
|
function distributeCardsTop(_this__u8e3s4, count) {
|
|
162
195
|
var cardsToDeal = toList(takeLast(_this__u8e3s4, count));
|
|
163
|
-
_this__u8e3s4.
|
|
196
|
+
_this__u8e3s4.z1(cardsToDeal);
|
|
164
197
|
return cardsToDeal;
|
|
165
198
|
}
|
|
166
199
|
function byCardNamePredicate$lambda($types) {
|
|
@@ -175,7 +208,7 @@
|
|
|
175
208
|
var element = indexedObject[inductionVariable];
|
|
176
209
|
inductionVariable = inductionVariable + 1 | 0;
|
|
177
210
|
// Inline function 'io.raspberryapps.card_game.core.data.models.cards.byCardNamePredicate.<anonymous>.<anonymous>' call
|
|
178
|
-
if (p1.
|
|
211
|
+
if (p1.p2().equals(element)) {
|
|
179
212
|
tmp$ret$1 = true;
|
|
180
213
|
break $l$block;
|
|
181
214
|
}
|
|
@@ -201,7 +234,7 @@
|
|
|
201
234
|
var CardName_STUB_instance;
|
|
202
235
|
function getShortName($this) {
|
|
203
236
|
var tmp;
|
|
204
|
-
switch ($this.
|
|
237
|
+
switch ($this.o2_1) {
|
|
205
238
|
case 0:
|
|
206
239
|
tmp = 'A';
|
|
207
240
|
break;
|
|
@@ -272,10 +305,16 @@
|
|
|
272
305
|
}
|
|
273
306
|
function Companion() {
|
|
274
307
|
}
|
|
275
|
-
protoOf(Companion).
|
|
308
|
+
protoOf(Companion).h60 = function (suit, number) {
|
|
309
|
+
return new GameCard(getNumber(Companion_instance_0, getName(Companion_instance_0, number), suit));
|
|
310
|
+
};
|
|
311
|
+
protoOf(Companion).i60 = function (suit, cardNumber) {
|
|
276
312
|
return new GameCard(getNumber(Companion_instance_0, cardNumber, suit));
|
|
277
313
|
};
|
|
278
|
-
protoOf(Companion).
|
|
314
|
+
protoOf(Companion).j60 = function (index) {
|
|
315
|
+
return new GameCard(index);
|
|
316
|
+
};
|
|
317
|
+
protoOf(Companion).k60 = function (position, playerIndex, previousStubCardWithMaxIndex, reverse) {
|
|
279
318
|
var tmp;
|
|
280
319
|
if (previousStubCardWithMaxIndex == null) {
|
|
281
320
|
tmp = null;
|
|
@@ -284,7 +323,7 @@
|
|
|
284
323
|
// Inline function 'kotlin.contracts.contract' call
|
|
285
324
|
var tmp_0;
|
|
286
325
|
// Inline function 'io.raspberryapps.card_game.core.data.models.cards.Companion.createUniqueStub.<anonymous>' call
|
|
287
|
-
if (previousStubCardWithMaxIndex.
|
|
326
|
+
if (previousStubCardWithMaxIndex.l60()) {
|
|
288
327
|
tmp_0 = previousStubCardWithMaxIndex;
|
|
289
328
|
} else {
|
|
290
329
|
tmp_0 = null;
|
|
@@ -292,8 +331,8 @@
|
|
|
292
331
|
tmp = tmp_0;
|
|
293
332
|
}
|
|
294
333
|
var tmp3_safe_receiver = tmp;
|
|
295
|
-
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.
|
|
296
|
-
var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : Companion_instance_0.
|
|
334
|
+
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.f60_1;
|
|
335
|
+
var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : Companion_instance_0.q60(tmp4_safe_receiver, playerIndex, reverse);
|
|
297
336
|
var tmp_1;
|
|
298
337
|
if (tmp5_safe_receiver == null) {
|
|
299
338
|
tmp_1 = null;
|
|
@@ -314,13 +353,13 @@
|
|
|
314
353
|
var index = tmp_2;
|
|
315
354
|
return new GameCard(index);
|
|
316
355
|
};
|
|
317
|
-
protoOf(Companion).
|
|
356
|
+
protoOf(Companion).r60 = function (position, playerIndex, previousStubCardWithMaxIndex, reverse, $super) {
|
|
318
357
|
previousStubCardWithMaxIndex = previousStubCardWithMaxIndex === VOID ? null : previousStubCardWithMaxIndex;
|
|
319
358
|
reverse = reverse === VOID ? false : reverse;
|
|
320
|
-
return $super === VOID ? this.
|
|
359
|
+
return $super === VOID ? this.k60(position, playerIndex, previousStubCardWithMaxIndex, reverse) : $super.k60.call(this, position, playerIndex, previousStubCardWithMaxIndex, reverse);
|
|
321
360
|
};
|
|
322
361
|
var Companion_instance;
|
|
323
|
-
function
|
|
362
|
+
function Companion_getInstance_0() {
|
|
324
363
|
return Companion_instance;
|
|
325
364
|
}
|
|
326
365
|
function getNumber($this, cardNumber, suit) {
|
|
@@ -328,7 +367,7 @@
|
|
|
328
367
|
}
|
|
329
368
|
function getCardNumber($this, number) {
|
|
330
369
|
var tmp;
|
|
331
|
-
switch (number.
|
|
370
|
+
switch (number.o2_1) {
|
|
332
371
|
case 12:
|
|
333
372
|
tmp = 0;
|
|
334
373
|
break;
|
|
@@ -421,7 +460,7 @@
|
|
|
421
460
|
return tmp;
|
|
422
461
|
}
|
|
423
462
|
function _get_isShirt__vd98rp($this) {
|
|
424
|
-
return $this.
|
|
463
|
+
return $this.f60_1 === 52;
|
|
425
464
|
}
|
|
426
465
|
function CardName(name, ordinal) {
|
|
427
466
|
Enum.call(this, name, ordinal);
|
|
@@ -430,12 +469,12 @@
|
|
|
430
469
|
return getShortName(this);
|
|
431
470
|
};
|
|
432
471
|
function Companion_0() {
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
436
|
-
this.
|
|
472
|
+
this.m60_1 = -1;
|
|
473
|
+
this.n60_1 = 13;
|
|
474
|
+
this.o60_1 = 52;
|
|
475
|
+
this.p60_1 = 53;
|
|
437
476
|
}
|
|
438
|
-
protoOf(Companion_0).
|
|
477
|
+
protoOf(Companion_0).q60 = function (_this__u8e3s4, playerIndex, reverse) {
|
|
439
478
|
var tmp;
|
|
440
479
|
if (reverse) {
|
|
441
480
|
tmp = _this__u8e3s4 + (53 + imul(playerIndex, 14) | 0) | 0;
|
|
@@ -445,7 +484,7 @@
|
|
|
445
484
|
return tmp;
|
|
446
485
|
};
|
|
447
486
|
var Companion_instance_0;
|
|
448
|
-
function
|
|
487
|
+
function Companion_getInstance_1() {
|
|
449
488
|
return Companion_instance_0;
|
|
450
489
|
}
|
|
451
490
|
function CardName_ACE_getInstance() {
|
|
@@ -505,59 +544,59 @@
|
|
|
505
544
|
return CardName_STUB_instance;
|
|
506
545
|
}
|
|
507
546
|
function GameCard(index) {
|
|
508
|
-
this.
|
|
547
|
+
this.f60_1 = index;
|
|
509
548
|
}
|
|
510
|
-
protoOf(GameCard).
|
|
549
|
+
protoOf(GameCard).s60 = function () {
|
|
511
550
|
var tmp;
|
|
512
|
-
var containsArg = this.
|
|
551
|
+
var containsArg = this.f60_1;
|
|
513
552
|
if (0 <= containsArg ? containsArg <= 13 : false) {
|
|
514
553
|
tmp = Suit_DIAMOND_getInstance();
|
|
515
554
|
} else {
|
|
516
|
-
if (this.
|
|
555
|
+
if (this.f60_1 <= 26) {
|
|
517
556
|
tmp = Suit_SPADE_getInstance();
|
|
518
557
|
} else {
|
|
519
|
-
if (this.
|
|
558
|
+
if (this.f60_1 <= 39) {
|
|
520
559
|
tmp = Suit_HEART_getInstance();
|
|
521
560
|
} else {
|
|
522
|
-
if (this.
|
|
561
|
+
if (this.f60_1 <= 52) {
|
|
523
562
|
tmp = Suit_CLUB_getInstance();
|
|
524
563
|
} else {
|
|
525
|
-
throw IllegalStateException_init_$Create$('Invalid suitCard in Card.getValue() ' + this.
|
|
564
|
+
throw IllegalStateException_init_$Create$('Invalid suitCard in Card.getValue() ' + this.f60_1);
|
|
526
565
|
}
|
|
527
566
|
}
|
|
528
567
|
}
|
|
529
568
|
}
|
|
530
569
|
return tmp;
|
|
531
570
|
};
|
|
532
|
-
protoOf(GameCard).
|
|
571
|
+
protoOf(GameCard).g60 = function () {
|
|
533
572
|
var tmp;
|
|
534
|
-
if (this.
|
|
573
|
+
if (this.l60()) {
|
|
535
574
|
tmp = -1;
|
|
536
575
|
} else {
|
|
537
|
-
tmp = this.
|
|
576
|
+
tmp = this.f60_1 - imul(13, getIndex(this.s60())) | 0;
|
|
538
577
|
}
|
|
539
578
|
return tmp;
|
|
540
579
|
};
|
|
541
|
-
protoOf(GameCard).
|
|
542
|
-
return this.
|
|
580
|
+
protoOf(GameCard).p2 = function () {
|
|
581
|
+
return this.l60() ? CardName_STUB_getInstance() : getName(Companion_instance_0, this.g60());
|
|
543
582
|
};
|
|
544
|
-
protoOf(GameCard).
|
|
545
|
-
return !_get_isShirt__vd98rp(this) && !this.
|
|
583
|
+
protoOf(GameCard).t60 = function () {
|
|
584
|
+
return !_get_isShirt__vd98rp(this) && !this.l60();
|
|
546
585
|
};
|
|
547
|
-
protoOf(GameCard).
|
|
548
|
-
return this.
|
|
586
|
+
protoOf(GameCard).l60 = function () {
|
|
587
|
+
return this.f60_1 >= 53;
|
|
549
588
|
};
|
|
550
589
|
protoOf(GameCard).toString = function () {
|
|
551
590
|
if (_get_isShirt__vd98rp(this)) {
|
|
552
591
|
return 'GameCard(SHIRT)';
|
|
553
592
|
}
|
|
554
|
-
if (this.
|
|
555
|
-
return 'GameCard(STUB, ' + this.
|
|
593
|
+
if (this.l60()) {
|
|
594
|
+
return 'GameCard(STUB, ' + this.f60_1 + ')';
|
|
556
595
|
}
|
|
557
|
-
return 'GameCard(' + this.
|
|
596
|
+
return 'GameCard(' + this.s60().toString() + this.p2().toString() + ', ' + this.f60_1 + ')';
|
|
558
597
|
};
|
|
559
598
|
protoOf(GameCard).hashCode = function () {
|
|
560
|
-
return this.
|
|
599
|
+
return this.f60_1;
|
|
561
600
|
};
|
|
562
601
|
protoOf(GameCard).equals = function (other) {
|
|
563
602
|
if (this === other)
|
|
@@ -565,12 +604,12 @@
|
|
|
565
604
|
if (!(other instanceof GameCard))
|
|
566
605
|
return false;
|
|
567
606
|
var tmp0_other_with_cast = other instanceof GameCard ? other : THROW_CCE();
|
|
568
|
-
if (!(this.
|
|
607
|
+
if (!(this.f60_1 === tmp0_other_with_cast.f60_1))
|
|
569
608
|
return false;
|
|
570
609
|
return true;
|
|
571
610
|
};
|
|
572
611
|
function _get_$cachedSerializer__te6jhj($this) {
|
|
573
|
-
return $this.
|
|
612
|
+
return $this.u60_1.u();
|
|
574
613
|
}
|
|
575
614
|
function Suit$Companion$_anonymous__cbm2iq() {
|
|
576
615
|
return createSimpleEnumSerializer('io.raspberryapps.card_game.core.data.models.cards.Suit', values());
|
|
@@ -581,7 +620,7 @@
|
|
|
581
620
|
var Suit_CLUB_instance;
|
|
582
621
|
function getSuitEmoji($this) {
|
|
583
622
|
var tmp;
|
|
584
|
-
switch ($this.
|
|
623
|
+
switch ($this.o2_1) {
|
|
585
624
|
case 0:
|
|
586
625
|
tmp = '\u2666\uFE0F';
|
|
587
626
|
break;
|
|
@@ -612,16 +651,16 @@
|
|
|
612
651
|
Companion_instance_1 = this;
|
|
613
652
|
var tmp = this;
|
|
614
653
|
var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
615
|
-
tmp.
|
|
654
|
+
tmp.u60_1 = lazy(tmp_0, Suit$Companion$_anonymous__cbm2iq);
|
|
616
655
|
}
|
|
617
|
-
protoOf(Companion_1).
|
|
656
|
+
protoOf(Companion_1).t4t = function () {
|
|
618
657
|
return _get_$cachedSerializer__te6jhj(this);
|
|
619
658
|
};
|
|
620
|
-
protoOf(Companion_1).
|
|
621
|
-
return this.
|
|
659
|
+
protoOf(Companion_1).w4d = function (typeParamsSerializers) {
|
|
660
|
+
return this.t4t();
|
|
622
661
|
};
|
|
623
662
|
var Companion_instance_1;
|
|
624
|
-
function
|
|
663
|
+
function Companion_getInstance_2() {
|
|
625
664
|
Suit_initEntries();
|
|
626
665
|
if (Companion_instance_1 == null)
|
|
627
666
|
new Companion_1();
|
|
@@ -636,7 +675,7 @@
|
|
|
636
675
|
Suit_SPADE_instance = new Suit('SPADE', 1);
|
|
637
676
|
Suit_HEART_instance = new Suit('HEART', 2);
|
|
638
677
|
Suit_CLUB_instance = new Suit('CLUB', 3);
|
|
639
|
-
|
|
678
|
+
Companion_getInstance_2();
|
|
640
679
|
}
|
|
641
680
|
var $ENTRIES;
|
|
642
681
|
function Suit(name, ordinal) {
|
|
@@ -663,7 +702,7 @@
|
|
|
663
702
|
}
|
|
664
703
|
function getIndex(_this__u8e3s4) {
|
|
665
704
|
var tmp;
|
|
666
|
-
switch (_this__u8e3s4.
|
|
705
|
+
switch (_this__u8e3s4.o2_1) {
|
|
667
706
|
case 0:
|
|
668
707
|
tmp = 0;
|
|
669
708
|
break;
|
|
@@ -684,6 +723,7 @@
|
|
|
684
723
|
}
|
|
685
724
|
var CardsRandomProvider_CUSTOM_instance;
|
|
686
725
|
var CardsRandomProvider_RANDOM_ORG_instance;
|
|
726
|
+
var CardsRandomProvider_RANDOM_ORG_SIGNED_instance;
|
|
687
727
|
var CardsRandomProvider_entriesInitialized;
|
|
688
728
|
function CardsRandomProvider_initEntries() {
|
|
689
729
|
if (CardsRandomProvider_entriesInitialized)
|
|
@@ -691,6 +731,7 @@
|
|
|
691
731
|
CardsRandomProvider_entriesInitialized = true;
|
|
692
732
|
CardsRandomProvider_CUSTOM_instance = new CardsRandomProvider('CUSTOM', 0);
|
|
693
733
|
CardsRandomProvider_RANDOM_ORG_instance = new CardsRandomProvider('RANDOM_ORG', 1);
|
|
734
|
+
CardsRandomProvider_RANDOM_ORG_SIGNED_instance = new CardsRandomProvider('RANDOM_ORG_SIGNED', 2);
|
|
694
735
|
}
|
|
695
736
|
function CardsRandomProvider(name, ordinal) {
|
|
696
737
|
Enum.call(this, name, ordinal);
|
|
@@ -703,13 +744,461 @@
|
|
|
703
744
|
CardsRandomProvider_initEntries();
|
|
704
745
|
return CardsRandomProvider_RANDOM_ORG_instance;
|
|
705
746
|
}
|
|
747
|
+
function CardsRandomProvider_RANDOM_ORG_SIGNED_getInstance() {
|
|
748
|
+
CardsRandomProvider_initEntries();
|
|
749
|
+
return CardsRandomProvider_RANDOM_ORG_SIGNED_instance;
|
|
750
|
+
}
|
|
706
751
|
function CardsDealerProvider() {
|
|
707
752
|
}
|
|
753
|
+
function getCardsRange($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
|
|
754
|
+
return until(leftCardIndexForEachSuit, 13 - rightCardIndexForEachSuit | 0);
|
|
755
|
+
}
|
|
756
|
+
function getRandomOrgCards($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, timeoutMillis, signed, $completion) {
|
|
757
|
+
var tmp = new $getRandomOrgCardsCOROUTINE$1($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, timeoutMillis, signed, $completion);
|
|
758
|
+
tmp.f9_1 = Unit_instance;
|
|
759
|
+
tmp.g9_1 = null;
|
|
760
|
+
return tmp.l9();
|
|
761
|
+
}
|
|
762
|
+
function normalizeCards($this, cards, leftCardIndexForEachSuit) {
|
|
763
|
+
var oneSuitCount = cards.m() / get_entries().m() | 0;
|
|
764
|
+
// Inline function 'kotlin.collections.map' call
|
|
765
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
766
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(cards, 10));
|
|
767
|
+
var tmp0_iterator = cards.j();
|
|
768
|
+
while (tmp0_iterator.k()) {
|
|
769
|
+
var item = tmp0_iterator.l();
|
|
770
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.normalizeCards.<anonymous>' call
|
|
771
|
+
var previousSuitNumber = item / oneSuitCount | 0;
|
|
772
|
+
var cardIndexShift = imul(leftCardIndexForEachSuit, previousSuitNumber + 1 | 0);
|
|
773
|
+
var newIndex = item + cardIndexShift | 0;
|
|
774
|
+
destination.e(newIndex);
|
|
775
|
+
}
|
|
776
|
+
var newIndexes = destination;
|
|
777
|
+
return newIndexes;
|
|
778
|
+
}
|
|
779
|
+
function Companion_2() {
|
|
780
|
+
}
|
|
781
|
+
protoOf(Companion_2).u61 = function (randomPoolProvider, logger) {
|
|
782
|
+
var tmp16_random = new SecureRandom(logger);
|
|
783
|
+
return new CardsDealerProviderImpl(tmp16_random, randomPoolProvider, logger);
|
|
784
|
+
};
|
|
785
|
+
var Companion_instance_2;
|
|
786
|
+
function Companion_getInstance_3() {
|
|
787
|
+
return Companion_instance_2;
|
|
788
|
+
}
|
|
789
|
+
function CardsDealerProviderImpl$getRandomOrgCards$slambda(this$0, $cardsCount, $approximateRoundsCount, $userData, $leftCardIndexForEachSuit, resultContinuation) {
|
|
790
|
+
this.d62_1 = this$0;
|
|
791
|
+
this.e62_1 = $cardsCount;
|
|
792
|
+
this.f62_1 = $approximateRoundsCount;
|
|
793
|
+
this.g62_1 = $userData;
|
|
794
|
+
this.h62_1 = $leftCardIndexForEachSuit;
|
|
795
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
796
|
+
}
|
|
797
|
+
protoOf(CardsDealerProviderImpl$getRandomOrgCards$slambda).l62 = function ($this$withTimeout, $completion) {
|
|
798
|
+
var tmp = this.b1c($this$withTimeout, $completion);
|
|
799
|
+
tmp.f9_1 = Unit_instance;
|
|
800
|
+
tmp.g9_1 = null;
|
|
801
|
+
return tmp.l9();
|
|
802
|
+
};
|
|
803
|
+
protoOf(CardsDealerProviderImpl$getRandomOrgCards$slambda).ga = function (p1, $completion) {
|
|
804
|
+
return this.l62((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
805
|
+
};
|
|
806
|
+
protoOf(CardsDealerProviderImpl$getRandomOrgCards$slambda).l9 = function () {
|
|
807
|
+
var suspendResult = this.f9_1;
|
|
808
|
+
$sm: do
|
|
809
|
+
try {
|
|
810
|
+
var tmp = this.d9_1;
|
|
811
|
+
switch (tmp) {
|
|
812
|
+
case 0:
|
|
813
|
+
this.e9_1 = 2;
|
|
814
|
+
this.j62_1 = this.d62_1.n62_1;
|
|
815
|
+
this.k62_1 = this.e62_1 - 1 | 0;
|
|
816
|
+
this.d9_1 = 1;
|
|
817
|
+
suspendResult = this.j62_1.k5n(this.f62_1, this.g62_1, 0, this.k62_1, this.e62_1, VOID, this);
|
|
818
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
819
|
+
return suspendResult;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
continue $sm;
|
|
823
|
+
case 1:
|
|
824
|
+
var cardDeck = suspendResult;
|
|
825
|
+
this.d62_1.r62_1 = null;
|
|
826
|
+
this.d62_1.s62_1 = 0;
|
|
827
|
+
var tmp14_cards = cardDeck.cards;
|
|
828
|
+
var this_0 = normalizeCards(this.d62_1, tmp14_cards, this.h62_1);
|
|
829
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
830
|
+
var tmp0_iterator = this_0.j();
|
|
831
|
+
while (tmp0_iterator.k()) {
|
|
832
|
+
var item = tmp0_iterator.l();
|
|
833
|
+
destination.e(Companion_instance.j60(item));
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return destination;
|
|
837
|
+
case 2:
|
|
838
|
+
throw this.g9_1;
|
|
839
|
+
}
|
|
840
|
+
} catch ($p) {
|
|
841
|
+
var e = $p;
|
|
842
|
+
if (this.e9_1 === 2) {
|
|
843
|
+
throw e;
|
|
844
|
+
} else {
|
|
845
|
+
this.d9_1 = this.e9_1;
|
|
846
|
+
this.g9_1 = e;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
while (true);
|
|
850
|
+
};
|
|
851
|
+
protoOf(CardsDealerProviderImpl$getRandomOrgCards$slambda).b1c = function ($this$withTimeout, completion) {
|
|
852
|
+
var i = new CardsDealerProviderImpl$getRandomOrgCards$slambda(this.d62_1, this.e62_1, this.f62_1, this.g62_1, this.h62_1, completion);
|
|
853
|
+
i.i62_1 = $this$withTimeout;
|
|
854
|
+
return i;
|
|
855
|
+
};
|
|
856
|
+
function CardsDealerProviderImpl$getRandomOrgCards$slambda_0(this$0, $cardsCount, $approximateRoundsCount, $userData, $leftCardIndexForEachSuit, resultContinuation) {
|
|
857
|
+
var i = new CardsDealerProviderImpl$getRandomOrgCards$slambda(this$0, $cardsCount, $approximateRoundsCount, $userData, $leftCardIndexForEachSuit, resultContinuation);
|
|
858
|
+
var l = function ($this$withTimeout, $completion) {
|
|
859
|
+
return i.l62($this$withTimeout, $completion);
|
|
860
|
+
};
|
|
861
|
+
l.$arity = 1;
|
|
862
|
+
return l;
|
|
863
|
+
}
|
|
864
|
+
function $createNewShuffledCardDeckCOROUTINE$0(_this__u8e3s4, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, resultContinuation) {
|
|
865
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
866
|
+
this.b63_1 = _this__u8e3s4;
|
|
867
|
+
this.c63_1 = leftCardIndexForEachSuit;
|
|
868
|
+
this.d63_1 = rightCardIndexForEachSuit;
|
|
869
|
+
this.e63_1 = approximateRoundCountForGame;
|
|
870
|
+
this.f63_1 = userData;
|
|
871
|
+
this.g63_1 = timeoutMillis;
|
|
872
|
+
this.h63_1 = provider;
|
|
873
|
+
}
|
|
874
|
+
protoOf($createNewShuffledCardDeckCOROUTINE$0).l9 = function () {
|
|
875
|
+
var suspendResult = this.f9_1;
|
|
876
|
+
$sm: do
|
|
877
|
+
try {
|
|
878
|
+
var tmp = this.d9_1;
|
|
879
|
+
switch (tmp) {
|
|
880
|
+
case 0:
|
|
881
|
+
this.e9_1 = 4;
|
|
882
|
+
this.i63_1 = this.h63_1;
|
|
883
|
+
this.j63_1 = this.i63_1.o2_1;
|
|
884
|
+
if (this.j63_1 === 0) {
|
|
885
|
+
var tmp_0 = this;
|
|
886
|
+
var it = this.b63_1.v60(this.c63_1, this.d63_1);
|
|
887
|
+
tmp_0.k63_1 = this.b63_1.a61(it);
|
|
888
|
+
this.d9_1 = 3;
|
|
889
|
+
continue $sm;
|
|
890
|
+
} else {
|
|
891
|
+
if (this.j63_1 === 1) {
|
|
892
|
+
this.d9_1 = 2;
|
|
893
|
+
suspendResult = getRandomOrgCards(this.b63_1, this.c63_1, this.d63_1, this.e63_1, this.f63_1, this.g63_1, false, this);
|
|
894
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
895
|
+
return suspendResult;
|
|
896
|
+
}
|
|
897
|
+
continue $sm;
|
|
898
|
+
} else {
|
|
899
|
+
if (this.j63_1 === 2) {
|
|
900
|
+
this.d9_1 = 1;
|
|
901
|
+
suspendResult = getRandomOrgCards(this.b63_1, this.c63_1, this.d63_1, this.e63_1, this.f63_1, this.g63_1, true, this);
|
|
902
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
903
|
+
return suspendResult;
|
|
904
|
+
}
|
|
905
|
+
continue $sm;
|
|
906
|
+
} else {
|
|
907
|
+
var tmp_1 = this;
|
|
908
|
+
noWhenBranchMatchedException();
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
break;
|
|
914
|
+
case 1:
|
|
915
|
+
this.k63_1 = suspendResult;
|
|
916
|
+
this.d9_1 = 3;
|
|
917
|
+
continue $sm;
|
|
918
|
+
case 2:
|
|
919
|
+
this.k63_1 = suspendResult;
|
|
920
|
+
this.d9_1 = 3;
|
|
921
|
+
continue $sm;
|
|
922
|
+
case 3:
|
|
923
|
+
return this.k63_1;
|
|
924
|
+
case 4:
|
|
925
|
+
throw this.g9_1;
|
|
926
|
+
}
|
|
927
|
+
} catch ($p) {
|
|
928
|
+
var e = $p;
|
|
929
|
+
if (this.e9_1 === 4) {
|
|
930
|
+
throw e;
|
|
931
|
+
} else {
|
|
932
|
+
this.d9_1 = this.e9_1;
|
|
933
|
+
this.g9_1 = e;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
while (true);
|
|
937
|
+
};
|
|
938
|
+
function $getRandomOrgCardsCOROUTINE$1(_this__u8e3s4, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, timeoutMillis, signed, resultContinuation) {
|
|
939
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
940
|
+
this.j61_1 = _this__u8e3s4;
|
|
941
|
+
this.k61_1 = leftCardIndexForEachSuit;
|
|
942
|
+
this.l61_1 = rightCardIndexForEachSuit;
|
|
943
|
+
this.m61_1 = approximateRoundsCount;
|
|
944
|
+
this.n61_1 = userData;
|
|
945
|
+
this.o61_1 = timeoutMillis;
|
|
946
|
+
this.p61_1 = signed;
|
|
947
|
+
}
|
|
948
|
+
protoOf($getRandomOrgCardsCOROUTINE$1).l9 = function () {
|
|
949
|
+
var suspendResult = this.f9_1;
|
|
950
|
+
$sm: do
|
|
951
|
+
try {
|
|
952
|
+
var tmp = this.d9_1;
|
|
953
|
+
switch (tmp) {
|
|
954
|
+
case 0:
|
|
955
|
+
this.e9_1 = 8;
|
|
956
|
+
var tmp_0 = this;
|
|
957
|
+
var sum = 0;
|
|
958
|
+
var tmp0_iterator = get_entries().j();
|
|
959
|
+
while (tmp0_iterator.k()) {
|
|
960
|
+
var element = tmp0_iterator.l();
|
|
961
|
+
var tmp_1 = sum;
|
|
962
|
+
sum = tmp_1 + count(getCardsRange(this.j61_1, this.k61_1, this.l61_1)) | 0;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
tmp_0.q61_1 = sum;
|
|
966
|
+
this.r61_1 = this.j61_1.r62_1;
|
|
967
|
+
if (!(this.r61_1 == null) && this.j61_1.s62_1 >= this.j61_1.p62_1) {
|
|
968
|
+
this.s61_1 = this.r61_1.w5h(this.j61_1.q62_1);
|
|
969
|
+
if (this.s61_1.a5i(System_instance.i52()) > 0) {
|
|
970
|
+
this.j61_1.o62_1.v('CardsDealerProvider', 'createNewShuffledCardDeck cooldown ends in ' + this.s61_1.toString());
|
|
971
|
+
this.d9_1 = 7;
|
|
972
|
+
suspendResult = this.j61_1.x60(this.k61_1, this.l61_1, this.m61_1, this.n61_1, VOID, CardsRandomProvider_CUSTOM_getInstance(), this);
|
|
973
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
974
|
+
return suspendResult;
|
|
975
|
+
}
|
|
976
|
+
continue $sm;
|
|
977
|
+
} else {
|
|
978
|
+
this.d9_1 = 1;
|
|
979
|
+
continue $sm;
|
|
980
|
+
}
|
|
981
|
+
} else {
|
|
982
|
+
this.d9_1 = 2;
|
|
983
|
+
continue $sm;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
case 1:
|
|
987
|
+
this.d9_1 = 2;
|
|
988
|
+
continue $sm;
|
|
989
|
+
case 2:
|
|
990
|
+
this.e9_1 = 4;
|
|
991
|
+
this.d9_1 = 3;
|
|
992
|
+
suspendResult = withTimeout(this.o61_1, CardsDealerProviderImpl$getRandomOrgCards$slambda_0(this.j61_1, this.q61_1, this.m61_1, this.n61_1, this.k61_1, null), this);
|
|
993
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
994
|
+
return suspendResult;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
continue $sm;
|
|
998
|
+
case 3:
|
|
999
|
+
return suspendResult;
|
|
1000
|
+
case 4:
|
|
1001
|
+
this.e9_1 = 8;
|
|
1002
|
+
var tmp_2 = this.g9_1;
|
|
1003
|
+
if (tmp_2 instanceof Error) {
|
|
1004
|
+
this.t61_1 = this.g9_1;
|
|
1005
|
+
this.j61_1.r62_1 = System_instance.i52();
|
|
1006
|
+
var _unary__edvuaz = this.j61_1.s62_1;
|
|
1007
|
+
this.j61_1.s62_1 = _unary__edvuaz + 1 | 0;
|
|
1008
|
+
this.j61_1.o62_1.w('CardsDealerProvider', 'createNewShuffledCardDeck error', this.t61_1);
|
|
1009
|
+
this.d9_1 = 5;
|
|
1010
|
+
continue $sm;
|
|
1011
|
+
} else {
|
|
1012
|
+
throw this.g9_1;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
case 5:
|
|
1016
|
+
this.e9_1 = 8;
|
|
1017
|
+
this.d9_1 = 6;
|
|
1018
|
+
suspendResult = this.j61_1.x60(this.k61_1, this.l61_1, this.m61_1, this.n61_1, VOID, CardsRandomProvider_CUSTOM_getInstance(), this);
|
|
1019
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1020
|
+
return suspendResult;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
continue $sm;
|
|
1024
|
+
case 6:
|
|
1025
|
+
return suspendResult;
|
|
1026
|
+
case 7:
|
|
1027
|
+
return suspendResult;
|
|
1028
|
+
case 8:
|
|
1029
|
+
throw this.g9_1;
|
|
1030
|
+
}
|
|
1031
|
+
} catch ($p) {
|
|
1032
|
+
var e = $p;
|
|
1033
|
+
if (this.e9_1 === 8) {
|
|
1034
|
+
throw e;
|
|
1035
|
+
} else {
|
|
1036
|
+
this.d9_1 = this.e9_1;
|
|
1037
|
+
this.g9_1 = e;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
while (true);
|
|
1041
|
+
};
|
|
1042
|
+
function CardsDealerProviderImpl(random, randomPoolProvider, logger, failedRequestAttempts, failedAttemptCooldown) {
|
|
1043
|
+
failedRequestAttempts = failedRequestAttempts === VOID ? 3 : failedRequestAttempts;
|
|
1044
|
+
var tmp;
|
|
1045
|
+
if (failedAttemptCooldown === VOID) {
|
|
1046
|
+
// Inline function 'kotlin.time.Companion.milliseconds' call
|
|
1047
|
+
Companion_getInstance();
|
|
1048
|
+
var this_0 = new Long(60000, 0);
|
|
1049
|
+
tmp = toDuration(this_0, DurationUnit_MILLISECONDS_getInstance());
|
|
1050
|
+
} else {
|
|
1051
|
+
tmp = failedAttemptCooldown;
|
|
1052
|
+
}
|
|
1053
|
+
failedAttemptCooldown = tmp;
|
|
1054
|
+
this.m62_1 = random;
|
|
1055
|
+
this.n62_1 = randomPoolProvider;
|
|
1056
|
+
this.o62_1 = logger;
|
|
1057
|
+
this.p62_1 = failedRequestAttempts;
|
|
1058
|
+
this.q62_1 = failedAttemptCooldown;
|
|
1059
|
+
this.r62_1 = null;
|
|
1060
|
+
this.s62_1 = 0;
|
|
1061
|
+
}
|
|
1062
|
+
protoOf(CardsDealerProviderImpl).v60 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
|
|
1063
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
1064
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1065
|
+
var this_0 = get_entries();
|
|
1066
|
+
var destination = ArrayList_init_$Create$();
|
|
1067
|
+
var tmp0_iterator = this_0.j();
|
|
1068
|
+
while (tmp0_iterator.k()) {
|
|
1069
|
+
var element = tmp0_iterator.l();
|
|
1070
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.createNewCardDeck.<anonymous>' call
|
|
1071
|
+
// Inline function 'kotlin.collections.map' call
|
|
1072
|
+
var this_1 = getCardsRange(this, leftCardIndexForEachSuit, rightCardIndexForEachSuit);
|
|
1073
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1074
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1075
|
+
var tmp0_iterator_0 = this_1.j();
|
|
1076
|
+
while (tmp0_iterator_0.k()) {
|
|
1077
|
+
var item = tmp0_iterator_0.l();
|
|
1078
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.createNewCardDeck.<anonymous>.<anonymous>' call
|
|
1079
|
+
var tmp$ret$0 = Companion_instance.h60(element, item);
|
|
1080
|
+
destination_0.e(tmp$ret$0);
|
|
1081
|
+
}
|
|
1082
|
+
var list = destination_0;
|
|
1083
|
+
addAll(destination, list);
|
|
1084
|
+
}
|
|
1085
|
+
return destination;
|
|
1086
|
+
};
|
|
1087
|
+
protoOf(CardsDealerProviderImpl).w60 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion) {
|
|
1088
|
+
var tmp = new $createNewShuffledCardDeckCOROUTINE$0(this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion);
|
|
1089
|
+
tmp.f9_1 = Unit_instance;
|
|
1090
|
+
tmp.g9_1 = null;
|
|
1091
|
+
return tmp.l9();
|
|
1092
|
+
};
|
|
1093
|
+
protoOf(CardsDealerProviderImpl).y60 = function (count, cards) {
|
|
1094
|
+
// Inline function 'kotlin.apply' call
|
|
1095
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1096
|
+
var this_0 = ArrayList_init_$Create$();
|
|
1097
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1098
|
+
$l$block: {
|
|
1099
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.getNRandomUniqueCards.<anonymous>' call
|
|
1100
|
+
var _iterator__ex2g4s = cards.j();
|
|
1101
|
+
$l$loop_0: while (_iterator__ex2g4s.k()) {
|
|
1102
|
+
var card = _iterator__ex2g4s.l();
|
|
1103
|
+
if (this_0.m() === count) {
|
|
1104
|
+
break $l$block;
|
|
1105
|
+
}
|
|
1106
|
+
var hasSimilarCard = this_0.s1(card);
|
|
1107
|
+
if (hasSimilarCard) {
|
|
1108
|
+
continue $l$loop_0;
|
|
1109
|
+
}
|
|
1110
|
+
var tmp$ret$2;
|
|
1111
|
+
$l$block_1: {
|
|
1112
|
+
// Inline function 'kotlin.collections.any' call
|
|
1113
|
+
var tmp;
|
|
1114
|
+
if (isInterface(this_0, Collection)) {
|
|
1115
|
+
tmp = this_0.p();
|
|
1116
|
+
} else {
|
|
1117
|
+
tmp = false;
|
|
1118
|
+
}
|
|
1119
|
+
if (tmp) {
|
|
1120
|
+
tmp$ret$2 = false;
|
|
1121
|
+
break $l$block_1;
|
|
1122
|
+
}
|
|
1123
|
+
var tmp0_iterator = this_0.j();
|
|
1124
|
+
while (tmp0_iterator.k()) {
|
|
1125
|
+
var element = tmp0_iterator.l();
|
|
1126
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.getNRandomUniqueCards.<anonymous>.<anonymous>' call
|
|
1127
|
+
if (element.g60() === card.g60()) {
|
|
1128
|
+
tmp$ret$2 = true;
|
|
1129
|
+
break $l$block_1;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
tmp$ret$2 = false;
|
|
1133
|
+
}
|
|
1134
|
+
if (tmp$ret$2) {
|
|
1135
|
+
continue $l$loop_0;
|
|
1136
|
+
}
|
|
1137
|
+
this_0.e(card);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return this_0;
|
|
1141
|
+
};
|
|
1142
|
+
protoOf(CardsDealerProviderImpl).z60 = function (cards, times) {
|
|
1143
|
+
// Inline function 'kotlin.let' call
|
|
1144
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1145
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.standardShuffledCards.<anonymous>' call
|
|
1146
|
+
var shuffled = toMutableList(cards);
|
|
1147
|
+
var inductionVariable = 0;
|
|
1148
|
+
if (inductionVariable < times)
|
|
1149
|
+
do {
|
|
1150
|
+
var i = inductionVariable;
|
|
1151
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1152
|
+
shuffled = this.m62_1.v5q(shuffled);
|
|
1153
|
+
}
|
|
1154
|
+
while (inductionVariable < times);
|
|
1155
|
+
return shuffled;
|
|
1156
|
+
};
|
|
1157
|
+
function Companion_3() {
|
|
1158
|
+
}
|
|
1159
|
+
protoOf(Companion_3).l63 = function () {
|
|
1160
|
+
// Inline function 'kotlin.apply' call
|
|
1161
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1162
|
+
var this_0 = ArrayList_init_$Create$();
|
|
1163
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1164
|
+
// Inline function 'io.raspberryapps.card_game.core.data.providers.cards.Companion.getCards.<anonymous>' call
|
|
1165
|
+
this_0.n(listOf([Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_NINE_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_TEN_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_JACK_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_KING_getInstance())]));
|
|
1166
|
+
this_0.n(listOf([Companion_instance.i60(Suit_CLUB_getInstance(), CardName_JACK_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_ACE_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_NINE_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_TEN_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_JACK_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_EIGHT_getInstance())]));
|
|
1167
|
+
this_0.n(listOf([Companion_instance.i60(Suit_CLUB_getInstance(), CardName_DAME_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_ACE_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_DAME_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_KING_getInstance())]));
|
|
1168
|
+
this_0.n(listOf([Companion_instance.i60(Suit_SPADE_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_TEN_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_TEN_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_JACK_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_DAME_getInstance())]));
|
|
1169
|
+
this_0.n(listOf([Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_ACE_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_KING_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_NINE_getInstance()), Companion_instance.i60(Suit_CLUB_getInstance(), CardName_ACE_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_KING_getInstance()), Companion_instance.i60(Suit_DIAMOND_getInstance(), CardName_DAME_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_NINE_getInstance())]));
|
|
1170
|
+
return this_0;
|
|
1171
|
+
};
|
|
1172
|
+
protoOf(Companion_3).m63 = function () {
|
|
1173
|
+
return listOf([Companion_instance.i60(Suit_CLUB_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_HEART_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.i60(Suit_SPADE_getInstance(), CardName_EIGHT_getInstance())]);
|
|
1174
|
+
};
|
|
1175
|
+
var Companion_instance_3;
|
|
1176
|
+
function Companion_getInstance_4() {
|
|
1177
|
+
return Companion_instance_3;
|
|
1178
|
+
}
|
|
1179
|
+
function FakeCardsDealerProvider(cards, cardsForLot) {
|
|
1180
|
+
cards = cards === VOID ? Companion_instance_3.l63() : cards;
|
|
1181
|
+
cardsForLot = cardsForLot === VOID ? Companion_instance_3.m63() : cardsForLot;
|
|
1182
|
+
this.n63_1 = cards;
|
|
1183
|
+
this.o63_1 = cardsForLot;
|
|
1184
|
+
}
|
|
1185
|
+
protoOf(FakeCardsDealerProvider).v60 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
|
|
1186
|
+
return this.n63_1;
|
|
1187
|
+
};
|
|
1188
|
+
protoOf(FakeCardsDealerProvider).w60 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, timeoutMillis, provider, $completion) {
|
|
1189
|
+
return this.n63_1;
|
|
1190
|
+
};
|
|
1191
|
+
protoOf(FakeCardsDealerProvider).y60 = function (count, cards) {
|
|
1192
|
+
return this.o63_1;
|
|
1193
|
+
};
|
|
1194
|
+
protoOf(FakeCardsDealerProvider).z60 = function (cards, times) {
|
|
1195
|
+
return cards;
|
|
1196
|
+
};
|
|
708
1197
|
function CombinationsCheckerProvider() {
|
|
709
1198
|
}
|
|
710
1199
|
function createCombination($this, cards, supportedCombinations) {
|
|
711
1200
|
var size = cards.m();
|
|
712
|
-
if (supportedCombinations.
|
|
1201
|
+
if (supportedCombinations.s1(size)) {
|
|
713
1202
|
return cards;
|
|
714
1203
|
}
|
|
715
1204
|
var fromLongestCombinations = asReversed(sorted(supportedCombinations));
|
|
@@ -731,25 +1220,25 @@
|
|
|
731
1220
|
return takeLast(cards, longestCombinationSupport);
|
|
732
1221
|
}
|
|
733
1222
|
function sam$kotlin_Comparator$0(function_0) {
|
|
734
|
-
this.
|
|
1223
|
+
this.u63_1 = function_0;
|
|
735
1224
|
}
|
|
736
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
737
|
-
return this.
|
|
1225
|
+
protoOf(sam$kotlin_Comparator$0).jc = function (a, b) {
|
|
1226
|
+
return this.u63_1(a, b);
|
|
738
1227
|
};
|
|
739
1228
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
740
|
-
return this.
|
|
1229
|
+
return this.jc(a, b);
|
|
741
1230
|
};
|
|
742
1231
|
function CombinationsCheckerProviderImpl$createCombinationsFromCardsInRow$lambda(a, b) {
|
|
743
1232
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
744
1233
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
|
|
745
|
-
var tmp = first_0(a).
|
|
1234
|
+
var tmp = first_0(a).f60_1;
|
|
746
1235
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
|
|
747
|
-
var tmp$ret$1 = first_0(b).
|
|
1236
|
+
var tmp$ret$1 = first_0(b).f60_1;
|
|
748
1237
|
return compareValues(tmp, tmp$ret$1);
|
|
749
1238
|
}
|
|
750
1239
|
function CombinationsCheckerProviderImpl() {
|
|
751
1240
|
}
|
|
752
|
-
protoOf(CombinationsCheckerProviderImpl).
|
|
1241
|
+
protoOf(CombinationsCheckerProviderImpl).p63 = function (cards, supportedCombinations, checkFromIndex, includeCardNames, suit) {
|
|
753
1242
|
// Inline function 'kotlin.collections.filter' call
|
|
754
1243
|
// Inline function 'kotlin.apply' call
|
|
755
1244
|
var this_0 = toMutableList(cards);
|
|
@@ -762,7 +1251,7 @@
|
|
|
762
1251
|
while (tmp0_iterator.k()) {
|
|
763
1252
|
var element = tmp0_iterator.l();
|
|
764
1253
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findCardsInRowCombinations.<anonymous>' call
|
|
765
|
-
if (element.
|
|
1254
|
+
if (element.t60()) {
|
|
766
1255
|
destination.e(element);
|
|
767
1256
|
}
|
|
768
1257
|
}
|
|
@@ -779,16 +1268,16 @@
|
|
|
779
1268
|
inductionVariable = inductionVariable + 1 | 0;
|
|
780
1269
|
var previousCard = lastOrNull(combinationCards);
|
|
781
1270
|
var currentCard = sortedByIndexCards.o(i);
|
|
782
|
-
var isNextInRow = !(previousCard == null) && currentCard.
|
|
783
|
-
var passedCardNamesCheck = includeCardNames == null || includeCardNames.
|
|
784
|
-
var passedSuitCheck = suit == null || currentCard.
|
|
1271
|
+
var isNextInRow = !(previousCard == null) && currentCard.f60_1 === (previousCard.f60_1 + 1 | 0) && currentCard.s60().equals(previousCard.s60());
|
|
1272
|
+
var passedCardNamesCheck = includeCardNames == null || includeCardNames.s1(currentCard.p2());
|
|
1273
|
+
var passedSuitCheck = suit == null || currentCard.s60().equals(suit);
|
|
785
1274
|
if (isNextInRow && passedSuitCheck && passedCardNamesCheck) {
|
|
786
1275
|
combinationCards.e(currentCard);
|
|
787
1276
|
} else {
|
|
788
1277
|
if (combinationCards.m() > (checkFromIndex - 1 | 0)) {
|
|
789
|
-
combinations.n(this.
|
|
1278
|
+
combinations.n(this.t63(toMutableList(combinationCards), supportedCombinations));
|
|
790
1279
|
}
|
|
791
|
-
combinationCards.
|
|
1280
|
+
combinationCards.a2();
|
|
792
1281
|
if (passedSuitCheck && passedCardNamesCheck) {
|
|
793
1282
|
combinationCards.e(currentCard);
|
|
794
1283
|
}
|
|
@@ -796,11 +1285,11 @@
|
|
|
796
1285
|
}
|
|
797
1286
|
while (inductionVariable <= last);
|
|
798
1287
|
if (combinationCards.m() > (checkFromIndex - 1 | 0)) {
|
|
799
|
-
combinations.n(this.
|
|
1288
|
+
combinations.n(this.t63(toMutableList(combinationCards), supportedCombinations));
|
|
800
1289
|
}
|
|
801
1290
|
return combinations;
|
|
802
1291
|
};
|
|
803
|
-
protoOf(CombinationsCheckerProviderImpl).
|
|
1292
|
+
protoOf(CombinationsCheckerProviderImpl).r63 = function (cards, cardsCount, includeCardNames) {
|
|
804
1293
|
// Inline function 'kotlin.collections.filter' call
|
|
805
1294
|
// Inline function 'kotlin.collections.filter' call
|
|
806
1295
|
// Inline function 'kotlin.apply' call
|
|
@@ -814,7 +1303,7 @@
|
|
|
814
1303
|
while (tmp0_iterator.k()) {
|
|
815
1304
|
var element = tmp0_iterator.l();
|
|
816
1305
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
|
|
817
|
-
if (element.
|
|
1306
|
+
if (element.t60()) {
|
|
818
1307
|
destination.e(element);
|
|
819
1308
|
}
|
|
820
1309
|
}
|
|
@@ -824,7 +1313,7 @@
|
|
|
824
1313
|
while (tmp0_iterator_0.k()) {
|
|
825
1314
|
var element_0 = tmp0_iterator_0.l();
|
|
826
1315
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
|
|
827
|
-
if (includeCardNames == null || includeCardNames.
|
|
1316
|
+
if (includeCardNames == null || includeCardNames.s1(element_0.p2())) {
|
|
828
1317
|
destination_0.e(element_0);
|
|
829
1318
|
}
|
|
830
1319
|
}
|
|
@@ -837,7 +1326,7 @@
|
|
|
837
1326
|
while (tmp0_iterator_1.k()) {
|
|
838
1327
|
var element_1 = tmp0_iterator_1.l();
|
|
839
1328
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
|
|
840
|
-
var key = element_1.
|
|
1329
|
+
var key = element_1.g60();
|
|
841
1330
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
842
1331
|
var value = destination_1.h2(key);
|
|
843
1332
|
var tmp;
|
|
@@ -859,8 +1348,8 @@
|
|
|
859
1348
|
while (tmp0_iterator_2.k()) {
|
|
860
1349
|
var element_2 = tmp0_iterator_2.l();
|
|
861
1350
|
// Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
|
|
862
|
-
if (element_2.
|
|
863
|
-
destination_2.k2(element_2.
|
|
1351
|
+
if (element_2.u().m() >= cardsCount) {
|
|
1352
|
+
destination_2.k2(element_2.t(), element_2.u());
|
|
864
1353
|
}
|
|
865
1354
|
}
|
|
866
1355
|
var combinations = destination_2.j2();
|
|
@@ -876,7 +1365,7 @@
|
|
|
876
1365
|
}
|
|
877
1366
|
return destination_3;
|
|
878
1367
|
};
|
|
879
|
-
protoOf(CombinationsCheckerProviderImpl).
|
|
1368
|
+
protoOf(CombinationsCheckerProviderImpl).t63 = function (cards, supportedCombinations) {
|
|
880
1369
|
// Inline function 'kotlin.collections.minOf' call
|
|
881
1370
|
var iterator = supportedCombinations.j();
|
|
882
1371
|
if (!iterator.k())
|
|
@@ -897,7 +1386,7 @@
|
|
|
897
1386
|
while (cardsToCheck.m() >= shortestCombinationSupport) {
|
|
898
1387
|
var combinationCards = createCombination(this, cardsToCheck, supportedCombinations);
|
|
899
1388
|
combinations.e(toList(combinationCards));
|
|
900
|
-
cardsToCheck.
|
|
1389
|
+
cardsToCheck.z1(combinationCards);
|
|
901
1390
|
}
|
|
902
1391
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
903
1392
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
@@ -906,28 +1395,28 @@
|
|
|
906
1395
|
return sortedWith(combinations, tmp$ret$4);
|
|
907
1396
|
};
|
|
908
1397
|
function DealerReducerImpl(logger, enableLogs) {
|
|
909
|
-
this.
|
|
910
|
-
this.
|
|
1398
|
+
this.v63_1 = logger;
|
|
1399
|
+
this.w63_1 = enableLogs;
|
|
911
1400
|
}
|
|
912
|
-
protoOf(DealerReducerImpl).
|
|
1401
|
+
protoOf(DealerReducerImpl).x63 = function (cards, cardsToRemove) {
|
|
913
1402
|
var list = cards;
|
|
914
1403
|
var _iterator__ex2g4s = cardsToRemove.j();
|
|
915
1404
|
while (_iterator__ex2g4s.k()) {
|
|
916
1405
|
var gameCard = _iterator__ex2g4s.l();
|
|
917
|
-
list = this.
|
|
1406
|
+
list = this.y63(list, gameCard);
|
|
918
1407
|
}
|
|
919
1408
|
return list;
|
|
920
1409
|
};
|
|
921
|
-
protoOf(DealerReducerImpl).
|
|
1410
|
+
protoOf(DealerReducerImpl).y63 = function (cards, cardToRemove) {
|
|
922
1411
|
var tmp;
|
|
923
|
-
if (!cardToRemove.
|
|
924
|
-
if (this.
|
|
925
|
-
this.
|
|
1412
|
+
if (!cardToRemove.l60() && cards.s1(cardToRemove)) {
|
|
1413
|
+
if (this.w63_1) {
|
|
1414
|
+
this.v63_1.d('Dealer', 'Card removed: ' + cardToRemove.toString() + ', size: ' + (cards.m() - 1 | 0));
|
|
926
1415
|
}
|
|
927
1416
|
tmp = minus(cards, cardToRemove);
|
|
928
1417
|
} else {
|
|
929
|
-
if (this.
|
|
930
|
-
this.
|
|
1418
|
+
if (this.w63_1) {
|
|
1419
|
+
this.v63_1.d('Dealer', 'Card removed as stub: ' + cardToRemove.toString() + ', size: ' + (cards.m() - 1 | 0));
|
|
931
1420
|
}
|
|
932
1421
|
// Inline function 'kotlin.collections.filterNot' call
|
|
933
1422
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
@@ -936,7 +1425,7 @@
|
|
|
936
1425
|
while (tmp0_iterator.k()) {
|
|
937
1426
|
var element = tmp0_iterator.l();
|
|
938
1427
|
// Inline function 'io.raspberryapps.card_game.core.domain.dealer.DealerReducerImpl.removeCard.<anonymous>' call
|
|
939
|
-
if (!element.
|
|
1428
|
+
if (!element.l60()) {
|
|
940
1429
|
destination.e(element);
|
|
941
1430
|
}
|
|
942
1431
|
}
|
|
@@ -948,32 +1437,36 @@
|
|
|
948
1437
|
while (tmp0_iterator_0.k()) {
|
|
949
1438
|
var element_0 = tmp0_iterator_0.l();
|
|
950
1439
|
// Inline function 'io.raspberryapps.card_game.core.domain.dealer.DealerReducerImpl.removeCard.<anonymous>' call
|
|
951
|
-
if (element_0.
|
|
1440
|
+
if (element_0.l60()) {
|
|
952
1441
|
destination_0.e(element_0);
|
|
953
1442
|
}
|
|
954
1443
|
}
|
|
955
1444
|
var stubCards = destination_0;
|
|
956
1445
|
if (stubCards.p()) {
|
|
957
|
-
this.
|
|
1446
|
+
this.v63_1.w('Dealer', "Can't find card to delete for player, " + ('cards:' + toString(cards) + ', ') + ('cardToRemove: ' + cardToRemove.toString()));
|
|
958
1447
|
}
|
|
959
1448
|
tmp = plus(notStubCards, dropLast(stubCards, 1));
|
|
960
1449
|
}
|
|
961
1450
|
return tmp;
|
|
962
1451
|
};
|
|
963
|
-
protoOf(DealerReducerImpl).
|
|
964
|
-
if (this.
|
|
965
|
-
this.
|
|
1452
|
+
protoOf(DealerReducerImpl).z63 = function (cards, cardToAdd) {
|
|
1453
|
+
if (this.w63_1) {
|
|
1454
|
+
this.v63_1.d('Dealer', 'Card added: ' + cardToAdd.toString() + ', size: ' + (cards.m() + 1 | 0));
|
|
966
1455
|
}
|
|
967
|
-
if (cards.
|
|
968
|
-
this.
|
|
1456
|
+
if (cards.s1(cardToAdd)) {
|
|
1457
|
+
this.v63_1.w('Dealer', 'Card already exists for player, ' + ('cards:' + toString(cards) + ', ') + ('cardToAdd: ' + cardToAdd.toString()));
|
|
969
1458
|
}
|
|
970
1459
|
return plus_0(cards, cardToAdd);
|
|
971
1460
|
};
|
|
972
1461
|
function DealerReducer() {
|
|
973
1462
|
}
|
|
974
1463
|
//region block: post-declaration
|
|
975
|
-
protoOf(
|
|
976
|
-
protoOf(
|
|
1464
|
+
protoOf(CardsDealerProviderImpl).x60 = createNewShuffledCardDeck$default;
|
|
1465
|
+
protoOf(CardsDealerProviderImpl).a61 = standardShuffledCards$default;
|
|
1466
|
+
protoOf(FakeCardsDealerProvider).x60 = createNewShuffledCardDeck$default;
|
|
1467
|
+
protoOf(FakeCardsDealerProvider).a61 = standardShuffledCards$default;
|
|
1468
|
+
protoOf(CombinationsCheckerProviderImpl).q63 = findCardsInRowCombinations$default;
|
|
1469
|
+
protoOf(CombinationsCheckerProviderImpl).s63 = findSameCardsNumberCombinations$default;
|
|
977
1470
|
//endregion
|
|
978
1471
|
//region block: init
|
|
979
1472
|
CoreConfig_instance = new CoreConfig();
|
|
@@ -981,6 +1474,8 @@
|
|
|
981
1474
|
CardIndexComparator_instance = new CardIndexComparator();
|
|
982
1475
|
Companion_instance = new Companion();
|
|
983
1476
|
Companion_instance_0 = new Companion_0();
|
|
1477
|
+
Companion_instance_2 = new Companion_2();
|
|
1478
|
+
Companion_instance_3 = new Companion_3();
|
|
984
1479
|
//endregion
|
|
985
1480
|
//region block: exports
|
|
986
1481
|
function $jsExportAll$(_) {
|
|
@@ -1002,22 +1497,25 @@
|
|
|
1002
1497
|
_.$_$.g = CardName_SEVEN_getInstance;
|
|
1003
1498
|
_.$_$.h = CardName_TEN_getInstance;
|
|
1004
1499
|
_.$_$.i = CardsRandomProvider_CUSTOM_getInstance;
|
|
1005
|
-
_.$_$.j =
|
|
1006
|
-
_.$_$.k =
|
|
1007
|
-
_.$_$.l =
|
|
1008
|
-
_.$_$.m =
|
|
1009
|
-
_.$_$.n =
|
|
1010
|
-
_.$_$.o =
|
|
1011
|
-
_.$_$.p =
|
|
1012
|
-
_.$_$.q =
|
|
1013
|
-
_.$_$.r =
|
|
1014
|
-
_.$_$.s =
|
|
1015
|
-
_.$_$.t =
|
|
1016
|
-
_.$_$.u =
|
|
1017
|
-
_.$_$.v =
|
|
1018
|
-
_.$_$.w =
|
|
1019
|
-
_.$_$.x =
|
|
1020
|
-
_.$_$.y =
|
|
1500
|
+
_.$_$.j = CardsRandomProvider_RANDOM_ORG_SIGNED_getInstance;
|
|
1501
|
+
_.$_$.k = CardsRandomProvider_RANDOM_ORG_getInstance;
|
|
1502
|
+
_.$_$.l = CardIndexComparator_instance;
|
|
1503
|
+
_.$_$.m = CardNumberComparator_instance;
|
|
1504
|
+
_.$_$.n = Companion_instance;
|
|
1505
|
+
_.$_$.o = Companion_getInstance_2;
|
|
1506
|
+
_.$_$.p = Companion_instance_2;
|
|
1507
|
+
_.$_$.q = GameCard;
|
|
1508
|
+
_.$_$.r = get_entries;
|
|
1509
|
+
_.$_$.s = values;
|
|
1510
|
+
_.$_$.t = distributeCardsBottom;
|
|
1511
|
+
_.$_$.u = distributeCardsTop;
|
|
1512
|
+
_.$_$.v = filterByCardName;
|
|
1513
|
+
_.$_$.w = CardsDealerProvider;
|
|
1514
|
+
_.$_$.x = FakeCardsDealerProvider;
|
|
1515
|
+
_.$_$.y = CombinationsCheckerProviderImpl;
|
|
1516
|
+
_.$_$.z = CombinationsCheckerProvider;
|
|
1517
|
+
_.$_$.a1 = DealerReducerImpl;
|
|
1518
|
+
_.$_$.b1 = DealerReducer;
|
|
1021
1519
|
//endregion
|
|
1022
1520
|
return _;
|
|
1023
1521
|
}));
|