-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathevent.mapper.dart
5004 lines (4218 loc) · 159 KB
/
event.mapper.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member
// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter
part of 'event.dart';
class WorldEventMapper extends ClassMapperBase<WorldEvent> {
WorldEventMapper._();
static WorldEventMapper? _instance;
static WorldEventMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = WorldEventMapper._());
PlayableWorldEventMapper.ensureInitialized();
ClientWorldEventMapper.ensureInitialized();
HybridWorldEventMapper.ensureInitialized();
LocalWorldEventMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'WorldEvent';
@override
final MappableFields<WorldEvent> fields = const {};
static WorldEvent _instantiate(DecodingData data) {
throw MapperException.missingSubclass(
'WorldEvent', 'type', '${data.value['type']}');
}
@override
final Function instantiate = _instantiate;
static WorldEvent fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<WorldEvent>(map);
}
static WorldEvent fromJson(String json) {
return ensureInitialized().decodeJson<WorldEvent>(json);
}
}
mixin WorldEventMappable {
String toJson();
Map<String, dynamic> toMap();
WorldEventCopyWith<WorldEvent, WorldEvent, WorldEvent> get copyWith;
}
abstract class WorldEventCopyWith<$R, $In extends WorldEvent, $Out>
implements ClassCopyWith<$R, $In, $Out> {
$R call();
WorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class PlayableWorldEventMapper extends SubClassMapperBase<PlayableWorldEvent> {
PlayableWorldEventMapper._();
static PlayableWorldEventMapper? _instance;
static PlayableWorldEventMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = PlayableWorldEventMapper._());
WorldEventMapper.ensureInitialized().addSubMapper(_instance!);
ServerWorldEventMapper.ensureInitialized();
LocalWorldEventMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'PlayableWorldEvent';
@override
final MappableFields<PlayableWorldEvent> fields = const {};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'PlayableWorldEvent';
@override
late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized();
static PlayableWorldEvent _instantiate(DecodingData data) {
throw MapperException.missingSubclass(
'PlayableWorldEvent', 'type', '${data.value['type']}');
}
@override
final Function instantiate = _instantiate;
static PlayableWorldEvent fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<PlayableWorldEvent>(map);
}
static PlayableWorldEvent fromJson(String json) {
return ensureInitialized().decodeJson<PlayableWorldEvent>(json);
}
}
mixin PlayableWorldEventMappable {
String toJson();
Map<String, dynamic> toMap();
PlayableWorldEventCopyWith<PlayableWorldEvent, PlayableWorldEvent,
PlayableWorldEvent> get copyWith;
}
abstract class PlayableWorldEventCopyWith<$R, $In extends PlayableWorldEvent,
$Out> implements WorldEventCopyWith<$R, $In, $Out> {
@override
$R call();
PlayableWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t);
}
class ServerWorldEventMapper extends SubClassMapperBase<ServerWorldEvent> {
ServerWorldEventMapper._();
static ServerWorldEventMapper? _instance;
static ServerWorldEventMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = ServerWorldEventMapper._());
PlayableWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
WorldInitializedMapper.ensureInitialized();
TeamJoinedMapper.ensureInitialized();
TeamLeftMapper.ensureInitialized();
ObjectsChangedMapper.ensureInitialized();
CellShuffledMapper.ensureInitialized();
MessageSentMapper.ensureInitialized();
BoardTilesSpawnedMapper.ensureInitialized();
BoardTilesChangedMapper.ensureInitialized();
DialogOpenedMapper.ensureInitialized();
DialogsClosedMapper.ensureInitialized();
ImagesUpdatedMapper.ensureInitialized();
HybridWorldEventMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'ServerWorldEvent';
@override
final MappableFields<ServerWorldEvent> fields = const {};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'ServerWorldEvent';
@override
late final ClassMapperBase superMapper =
PlayableWorldEventMapper.ensureInitialized();
static ServerWorldEvent _instantiate(DecodingData data) {
throw MapperException.missingSubclass(
'ServerWorldEvent', 'type', '${data.value['type']}');
}
@override
final Function instantiate = _instantiate;
static ServerWorldEvent fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<ServerWorldEvent>(map);
}
static ServerWorldEvent fromJson(String json) {
return ensureInitialized().decodeJson<ServerWorldEvent>(json);
}
}
mixin ServerWorldEventMappable {
String toJson();
Map<String, dynamic> toMap();
ServerWorldEventCopyWith<ServerWorldEvent, ServerWorldEvent, ServerWorldEvent>
get copyWith;
}
abstract class ServerWorldEventCopyWith<$R, $In extends ServerWorldEvent, $Out>
implements PlayableWorldEventCopyWith<$R, $In, $Out> {
@override
$R call();
ServerWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t);
}
class WorldInitializedMapper extends SubClassMapperBase<WorldInitialized> {
WorldInitializedMapper._();
static WorldInitializedMapper? _instance;
static WorldInitializedMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = WorldInitializedMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
GameTableMapper.ensureInitialized();
GameInfoMapper.ensureInitialized();
SignatureMetadataMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'WorldInitialized';
static GameTable? _$table(WorldInitialized v) => v.table;
static const Field<WorldInitialized, GameTable> _f$table =
Field('table', _$table, opt: true);
static GameInfo? _$info(WorldInitialized v) => v.info;
static const Field<WorldInitialized, GameInfo> _f$info =
Field('info', _$info, opt: true);
static Map<String, Set<int>>? _$teamMembers(WorldInitialized v) =>
v.teamMembers;
static const Field<WorldInitialized, Map<String, Set<int>>> _f$teamMembers =
Field('teamMembers', _$teamMembers, opt: true);
static int? _$id(WorldInitialized v) => v.id;
static const Field<WorldInitialized, int> _f$id =
Field('id', _$id, opt: true);
static List<SignatureMetadata>? _$packsSignature(WorldInitialized v) =>
v.packsSignature;
static const Field<WorldInitialized, List<SignatureMetadata>>
_f$packsSignature = Field('packsSignature', _$packsSignature, opt: true);
static bool _$clearUserInterface(WorldInitialized v) => v.clearUserInterface;
static const Field<WorldInitialized, bool> _f$clearUserInterface =
Field('clearUserInterface', _$clearUserInterface, opt: true, def: false);
@override
final MappableFields<WorldInitialized> fields = const {
#table: _f$table,
#info: _f$info,
#teamMembers: _f$teamMembers,
#id: _f$id,
#packsSignature: _f$packsSignature,
#clearUserInterface: _f$clearUserInterface,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'WorldInitialized';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static WorldInitialized _instantiate(DecodingData data) {
return WorldInitialized(
table: data.dec(_f$table),
info: data.dec(_f$info),
teamMembers: data.dec(_f$teamMembers),
id: data.dec(_f$id),
packsSignature: data.dec(_f$packsSignature),
clearUserInterface: data.dec(_f$clearUserInterface));
}
@override
final Function instantiate = _instantiate;
static WorldInitialized fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<WorldInitialized>(map);
}
static WorldInitialized fromJson(String json) {
return ensureInitialized().decodeJson<WorldInitialized>(json);
}
}
mixin WorldInitializedMappable {
String toJson() {
return WorldInitializedMapper.ensureInitialized()
.encodeJson<WorldInitialized>(this as WorldInitialized);
}
Map<String, dynamic> toMap() {
return WorldInitializedMapper.ensureInitialized()
.encodeMap<WorldInitialized>(this as WorldInitialized);
}
WorldInitializedCopyWith<WorldInitialized, WorldInitialized, WorldInitialized>
get copyWith => _WorldInitializedCopyWithImpl(
this as WorldInitialized, $identity, $identity);
@override
String toString() {
return WorldInitializedMapper.ensureInitialized()
.stringifyValue(this as WorldInitialized);
}
@override
bool operator ==(Object other) {
return WorldInitializedMapper.ensureInitialized()
.equalsValue(this as WorldInitialized, other);
}
@override
int get hashCode {
return WorldInitializedMapper.ensureInitialized()
.hashValue(this as WorldInitialized);
}
}
extension WorldInitializedValueCopy<$R, $Out>
on ObjectCopyWith<$R, WorldInitialized, $Out> {
WorldInitializedCopyWith<$R, WorldInitialized, $Out>
get $asWorldInitialized =>
$base.as((v, t, t2) => _WorldInitializedCopyWithImpl(v, t, t2));
}
abstract class WorldInitializedCopyWith<$R, $In extends WorldInitialized, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
GameTableCopyWith<$R, GameTable, GameTable>? get table;
GameInfoCopyWith<$R, GameInfo, GameInfo>? get info;
MapCopyWith<$R, String, Set<int>, ObjectCopyWith<$R, Set<int>, Set<int>>>?
get teamMembers;
ListCopyWith<$R, SignatureMetadata,
SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata>>?
get packsSignature;
@override
$R call(
{GameTable? table,
GameInfo? info,
Map<String, Set<int>>? teamMembers,
int? id,
List<SignatureMetadata>? packsSignature,
bool? clearUserInterface});
WorldInitializedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t);
}
class _WorldInitializedCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, WorldInitialized, $Out>
implements WorldInitializedCopyWith<$R, WorldInitialized, $Out> {
_WorldInitializedCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<WorldInitialized> $mapper =
WorldInitializedMapper.ensureInitialized();
@override
GameTableCopyWith<$R, GameTable, GameTable>? get table =>
$value.table?.copyWith.$chain((v) => call(table: v));
@override
GameInfoCopyWith<$R, GameInfo, GameInfo>? get info =>
$value.info?.copyWith.$chain((v) => call(info: v));
@override
MapCopyWith<$R, String, Set<int>, ObjectCopyWith<$R, Set<int>, Set<int>>>?
get teamMembers => $value.teamMembers != null
? MapCopyWith(
$value.teamMembers!,
(v, t) => ObjectCopyWith(v, $identity, t),
(v) => call(teamMembers: v))
: null;
@override
ListCopyWith<$R, SignatureMetadata,
SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata>>?
get packsSignature => $value.packsSignature != null
? ListCopyWith($value.packsSignature!, (v, t) => v.copyWith.$chain(t),
(v) => call(packsSignature: v))
: null;
@override
$R call(
{Object? table = $none,
Object? info = $none,
Object? teamMembers = $none,
Object? id = $none,
Object? packsSignature = $none,
bool? clearUserInterface}) =>
$apply(FieldCopyWithData({
if (table != $none) #table: table,
if (info != $none) #info: info,
if (teamMembers != $none) #teamMembers: teamMembers,
if (id != $none) #id: id,
if (packsSignature != $none) #packsSignature: packsSignature,
if (clearUserInterface != null) #clearUserInterface: clearUserInterface
}));
@override
WorldInitialized $make(CopyWithData data) => WorldInitialized(
table: data.get(#table, or: $value.table),
info: data.get(#info, or: $value.info),
teamMembers: data.get(#teamMembers, or: $value.teamMembers),
id: data.get(#id, or: $value.id),
packsSignature: data.get(#packsSignature, or: $value.packsSignature),
clearUserInterface:
data.get(#clearUserInterface, or: $value.clearUserInterface));
@override
WorldInitializedCopyWith<$R2, WorldInitialized, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_WorldInitializedCopyWithImpl($value, $cast, t);
}
class TeamJoinedMapper extends SubClassMapperBase<TeamJoined> {
TeamJoinedMapper._();
static TeamJoinedMapper? _instance;
static TeamJoinedMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = TeamJoinedMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
}
return _instance!;
}
@override
final String id = 'TeamJoined';
static int _$user(TeamJoined v) => v.user;
static const Field<TeamJoined, int> _f$user = Field('user', _$user);
static String _$team(TeamJoined v) => v.team;
static const Field<TeamJoined, String> _f$team = Field('team', _$team);
@override
final MappableFields<TeamJoined> fields = const {
#user: _f$user,
#team: _f$team,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'TeamJoined';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static TeamJoined _instantiate(DecodingData data) {
return TeamJoined(data.dec(_f$user), data.dec(_f$team));
}
@override
final Function instantiate = _instantiate;
static TeamJoined fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<TeamJoined>(map);
}
static TeamJoined fromJson(String json) {
return ensureInitialized().decodeJson<TeamJoined>(json);
}
}
mixin TeamJoinedMappable {
String toJson() {
return TeamJoinedMapper.ensureInitialized()
.encodeJson<TeamJoined>(this as TeamJoined);
}
Map<String, dynamic> toMap() {
return TeamJoinedMapper.ensureInitialized()
.encodeMap<TeamJoined>(this as TeamJoined);
}
TeamJoinedCopyWith<TeamJoined, TeamJoined, TeamJoined> get copyWith =>
_TeamJoinedCopyWithImpl(this as TeamJoined, $identity, $identity);
@override
String toString() {
return TeamJoinedMapper.ensureInitialized()
.stringifyValue(this as TeamJoined);
}
@override
bool operator ==(Object other) {
return TeamJoinedMapper.ensureInitialized()
.equalsValue(this as TeamJoined, other);
}
@override
int get hashCode {
return TeamJoinedMapper.ensureInitialized().hashValue(this as TeamJoined);
}
}
extension TeamJoinedValueCopy<$R, $Out>
on ObjectCopyWith<$R, TeamJoined, $Out> {
TeamJoinedCopyWith<$R, TeamJoined, $Out> get $asTeamJoined =>
$base.as((v, t, t2) => _TeamJoinedCopyWithImpl(v, t, t2));
}
abstract class TeamJoinedCopyWith<$R, $In extends TeamJoined, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
@override
$R call({int? user, String? team});
TeamJoinedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _TeamJoinedCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, TeamJoined, $Out>
implements TeamJoinedCopyWith<$R, TeamJoined, $Out> {
_TeamJoinedCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<TeamJoined> $mapper =
TeamJoinedMapper.ensureInitialized();
@override
$R call({int? user, String? team}) => $apply(FieldCopyWithData(
{if (user != null) #user: user, if (team != null) #team: team}));
@override
TeamJoined $make(CopyWithData data) => TeamJoined(
data.get(#user, or: $value.user), data.get(#team, or: $value.team));
@override
TeamJoinedCopyWith<$R2, TeamJoined, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_TeamJoinedCopyWithImpl($value, $cast, t);
}
class TeamLeftMapper extends SubClassMapperBase<TeamLeft> {
TeamLeftMapper._();
static TeamLeftMapper? _instance;
static TeamLeftMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = TeamLeftMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
}
return _instance!;
}
@override
final String id = 'TeamLeft';
static int _$user(TeamLeft v) => v.user;
static const Field<TeamLeft, int> _f$user = Field('user', _$user);
static String _$team(TeamLeft v) => v.team;
static const Field<TeamLeft, String> _f$team = Field('team', _$team);
@override
final MappableFields<TeamLeft> fields = const {
#user: _f$user,
#team: _f$team,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'TeamLeft';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static TeamLeft _instantiate(DecodingData data) {
return TeamLeft(data.dec(_f$user), data.dec(_f$team));
}
@override
final Function instantiate = _instantiate;
static TeamLeft fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<TeamLeft>(map);
}
static TeamLeft fromJson(String json) {
return ensureInitialized().decodeJson<TeamLeft>(json);
}
}
mixin TeamLeftMappable {
String toJson() {
return TeamLeftMapper.ensureInitialized()
.encodeJson<TeamLeft>(this as TeamLeft);
}
Map<String, dynamic> toMap() {
return TeamLeftMapper.ensureInitialized()
.encodeMap<TeamLeft>(this as TeamLeft);
}
TeamLeftCopyWith<TeamLeft, TeamLeft, TeamLeft> get copyWith =>
_TeamLeftCopyWithImpl(this as TeamLeft, $identity, $identity);
@override
String toString() {
return TeamLeftMapper.ensureInitialized().stringifyValue(this as TeamLeft);
}
@override
bool operator ==(Object other) {
return TeamLeftMapper.ensureInitialized()
.equalsValue(this as TeamLeft, other);
}
@override
int get hashCode {
return TeamLeftMapper.ensureInitialized().hashValue(this as TeamLeft);
}
}
extension TeamLeftValueCopy<$R, $Out> on ObjectCopyWith<$R, TeamLeft, $Out> {
TeamLeftCopyWith<$R, TeamLeft, $Out> get $asTeamLeft =>
$base.as((v, t, t2) => _TeamLeftCopyWithImpl(v, t, t2));
}
abstract class TeamLeftCopyWith<$R, $In extends TeamLeft, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
@override
$R call({int? user, String? team});
TeamLeftCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _TeamLeftCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, TeamLeft, $Out>
implements TeamLeftCopyWith<$R, TeamLeft, $Out> {
_TeamLeftCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<TeamLeft> $mapper =
TeamLeftMapper.ensureInitialized();
@override
$R call({int? user, String? team}) => $apply(FieldCopyWithData(
{if (user != null) #user: user, if (team != null) #team: team}));
@override
TeamLeft $make(CopyWithData data) => TeamLeft(
data.get(#user, or: $value.user), data.get(#team, or: $value.team));
@override
TeamLeftCopyWith<$R2, TeamLeft, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_TeamLeftCopyWithImpl($value, $cast, t);
}
class ObjectsChangedMapper extends SubClassMapperBase<ObjectsChanged> {
ObjectsChangedMapper._();
static ObjectsChangedMapper? _instance;
static ObjectsChangedMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = ObjectsChangedMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
GlobalVectorDefinitionMapper.ensureInitialized();
GameObjectMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'ObjectsChanged';
static GlobalVectorDefinition _$cell(ObjectsChanged v) => v.cell;
static const Field<ObjectsChanged, GlobalVectorDefinition> _f$cell =
Field('cell', _$cell);
static List<GameObject> _$objects(ObjectsChanged v) => v.objects;
static const Field<ObjectsChanged, List<GameObject>> _f$objects =
Field('objects', _$objects, opt: true, def: const []);
@override
final MappableFields<ObjectsChanged> fields = const {
#cell: _f$cell,
#objects: _f$objects,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'ObjectsChanged';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static ObjectsChanged _instantiate(DecodingData data) {
return ObjectsChanged(data.dec(_f$cell), data.dec(_f$objects));
}
@override
final Function instantiate = _instantiate;
static ObjectsChanged fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<ObjectsChanged>(map);
}
static ObjectsChanged fromJson(String json) {
return ensureInitialized().decodeJson<ObjectsChanged>(json);
}
}
mixin ObjectsChangedMappable {
String toJson() {
return ObjectsChangedMapper.ensureInitialized()
.encodeJson<ObjectsChanged>(this as ObjectsChanged);
}
Map<String, dynamic> toMap() {
return ObjectsChangedMapper.ensureInitialized()
.encodeMap<ObjectsChanged>(this as ObjectsChanged);
}
ObjectsChangedCopyWith<ObjectsChanged, ObjectsChanged, ObjectsChanged>
get copyWith => _ObjectsChangedCopyWithImpl(
this as ObjectsChanged, $identity, $identity);
@override
String toString() {
return ObjectsChangedMapper.ensureInitialized()
.stringifyValue(this as ObjectsChanged);
}
@override
bool operator ==(Object other) {
return ObjectsChangedMapper.ensureInitialized()
.equalsValue(this as ObjectsChanged, other);
}
@override
int get hashCode {
return ObjectsChangedMapper.ensureInitialized()
.hashValue(this as ObjectsChanged);
}
}
extension ObjectsChangedValueCopy<$R, $Out>
on ObjectCopyWith<$R, ObjectsChanged, $Out> {
ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> get $asObjectsChanged =>
$base.as((v, t, t2) => _ObjectsChangedCopyWithImpl(v, t, t2));
}
abstract class ObjectsChangedCopyWith<$R, $In extends ObjectsChanged, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition,
GlobalVectorDefinition> get cell;
ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>>
get objects;
@override
$R call({GlobalVectorDefinition? cell, List<GameObject>? objects});
ObjectsChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t);
}
class _ObjectsChangedCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, ObjectsChanged, $Out>
implements ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> {
_ObjectsChangedCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<ObjectsChanged> $mapper =
ObjectsChangedMapper.ensureInitialized();
@override
GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition,
GlobalVectorDefinition>
get cell => $value.cell.copyWith.$chain((v) => call(cell: v));
@override
ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>>
get objects => ListCopyWith($value.objects,
(v, t) => v.copyWith.$chain(t), (v) => call(objects: v));
@override
$R call({GlobalVectorDefinition? cell, List<GameObject>? objects}) =>
$apply(FieldCopyWithData({
if (cell != null) #cell: cell,
if (objects != null) #objects: objects
}));
@override
ObjectsChanged $make(CopyWithData data) => ObjectsChanged(
data.get(#cell, or: $value.cell), data.get(#objects, or: $value.objects));
@override
ObjectsChangedCopyWith<$R2, ObjectsChanged, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_ObjectsChangedCopyWithImpl($value, $cast, t);
}
class CellShuffledMapper extends SubClassMapperBase<CellShuffled> {
CellShuffledMapper._();
static CellShuffledMapper? _instance;
static CellShuffledMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = CellShuffledMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
GlobalVectorDefinitionMapper.ensureInitialized();
}
return _instance!;
}
@override
final String id = 'CellShuffled';
static GlobalVectorDefinition _$cell(CellShuffled v) => v.cell;
static const Field<CellShuffled, GlobalVectorDefinition> _f$cell =
Field('cell', _$cell);
static List<int> _$positions(CellShuffled v) => v.positions;
static const Field<CellShuffled, List<int>> _f$positions =
Field('positions', _$positions, opt: true, def: const []);
@override
final MappableFields<CellShuffled> fields = const {
#cell: _f$cell,
#positions: _f$positions,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'CellShuffled';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static CellShuffled _instantiate(DecodingData data) {
return CellShuffled(data.dec(_f$cell), data.dec(_f$positions));
}
@override
final Function instantiate = _instantiate;
static CellShuffled fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<CellShuffled>(map);
}
static CellShuffled fromJson(String json) {
return ensureInitialized().decodeJson<CellShuffled>(json);
}
}
mixin CellShuffledMappable {
String toJson() {
return CellShuffledMapper.ensureInitialized()
.encodeJson<CellShuffled>(this as CellShuffled);
}
Map<String, dynamic> toMap() {
return CellShuffledMapper.ensureInitialized()
.encodeMap<CellShuffled>(this as CellShuffled);
}
CellShuffledCopyWith<CellShuffled, CellShuffled, CellShuffled> get copyWith =>
_CellShuffledCopyWithImpl(this as CellShuffled, $identity, $identity);
@override
String toString() {
return CellShuffledMapper.ensureInitialized()
.stringifyValue(this as CellShuffled);
}
@override
bool operator ==(Object other) {
return CellShuffledMapper.ensureInitialized()
.equalsValue(this as CellShuffled, other);
}
@override
int get hashCode {
return CellShuffledMapper.ensureInitialized()
.hashValue(this as CellShuffled);
}
}
extension CellShuffledValueCopy<$R, $Out>
on ObjectCopyWith<$R, CellShuffled, $Out> {
CellShuffledCopyWith<$R, CellShuffled, $Out> get $asCellShuffled =>
$base.as((v, t, t2) => _CellShuffledCopyWithImpl(v, t, t2));
}
abstract class CellShuffledCopyWith<$R, $In extends CellShuffled, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition,
GlobalVectorDefinition> get cell;
ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions;
@override
$R call({GlobalVectorDefinition? cell, List<int>? positions});
CellShuffledCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _CellShuffledCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, CellShuffled, $Out>
implements CellShuffledCopyWith<$R, CellShuffled, $Out> {
_CellShuffledCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<CellShuffled> $mapper =
CellShuffledMapper.ensureInitialized();
@override
GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition,
GlobalVectorDefinition>
get cell => $value.cell.copyWith.$chain((v) => call(cell: v));
@override
ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions =>
ListCopyWith($value.positions, (v, t) => ObjectCopyWith(v, $identity, t),
(v) => call(positions: v));
@override
$R call({GlobalVectorDefinition? cell, List<int>? positions}) =>
$apply(FieldCopyWithData({
if (cell != null) #cell: cell,
if (positions != null) #positions: positions
}));
@override
CellShuffled $make(CopyWithData data) => CellShuffled(
data.get(#cell, or: $value.cell),
data.get(#positions, or: $value.positions));
@override
CellShuffledCopyWith<$R2, CellShuffled, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_CellShuffledCopyWithImpl($value, $cast, t);
}
class MessageSentMapper extends SubClassMapperBase<MessageSent> {
MessageSentMapper._();
static MessageSentMapper? _instance;
static MessageSentMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = MessageSentMapper._());
ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!);
}
return _instance!;
}
@override
final String id = 'MessageSent';
static int _$user(MessageSent v) => v.user;
static const Field<MessageSent, int> _f$user = Field('user', _$user);
static String _$message(MessageSent v) => v.message;
static const Field<MessageSent, String> _f$message =
Field('message', _$message);
@override
final MappableFields<MessageSent> fields = const {
#user: _f$user,
#message: _f$message,
};
@override
final String discriminatorKey = 'type';
@override
final dynamic discriminatorValue = 'MessageSent';
@override
late final ClassMapperBase superMapper =
ServerWorldEventMapper.ensureInitialized();
static MessageSent _instantiate(DecodingData data) {
return MessageSent(data.dec(_f$user), data.dec(_f$message));
}
@override
final Function instantiate = _instantiate;
static MessageSent fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<MessageSent>(map);
}
static MessageSent fromJson(String json) {
return ensureInitialized().decodeJson<MessageSent>(json);
}
}
mixin MessageSentMappable {
String toJson() {
return MessageSentMapper.ensureInitialized()
.encodeJson<MessageSent>(this as MessageSent);
}
Map<String, dynamic> toMap() {
return MessageSentMapper.ensureInitialized()
.encodeMap<MessageSent>(this as MessageSent);
}
MessageSentCopyWith<MessageSent, MessageSent, MessageSent> get copyWith =>
_MessageSentCopyWithImpl(this as MessageSent, $identity, $identity);
@override
String toString() {
return MessageSentMapper.ensureInitialized()
.stringifyValue(this as MessageSent);
}
@override
bool operator ==(Object other) {
return MessageSentMapper.ensureInitialized()
.equalsValue(this as MessageSent, other);
}
@override
int get hashCode {
return MessageSentMapper.ensureInitialized().hashValue(this as MessageSent);
}
}
extension MessageSentValueCopy<$R, $Out>
on ObjectCopyWith<$R, MessageSent, $Out> {
MessageSentCopyWith<$R, MessageSent, $Out> get $asMessageSent =>
$base.as((v, t, t2) => _MessageSentCopyWithImpl(v, t, t2));
}
abstract class MessageSentCopyWith<$R, $In extends MessageSent, $Out>
implements ServerWorldEventCopyWith<$R, $In, $Out> {
@override
$R call({int? user, String? message});
MessageSentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _MessageSentCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, MessageSent, $Out>
implements MessageSentCopyWith<$R, MessageSent, $Out> {
_MessageSentCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<MessageSent> $mapper =
MessageSentMapper.ensureInitialized();
@override
$R call({int? user, String? message}) => $apply(FieldCopyWithData(
{if (user != null) #user: user, if (message != null) #message: message}));
@override
MessageSent $make(CopyWithData data) => MessageSent(
data.get(#user, or: $value.user), data.get(#message, or: $value.message));
@override
MessageSentCopyWith<$R2, MessageSent, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>