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
|
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XHomeCookAndPartyDocument : XDocComponent
{
public override uint ID
{
get
{
return XHomeCookAndPartyDocument.uuID;
}
}
public static XHomeCookAndPartyDocument Doc
{
get
{
return XSingleton<XGame>.singleton.Doc.GetXComponent(XHomeCookAndPartyDocument.uuID) as XHomeCookAndPartyDocument;
}
}
public static CookingFoodInfo CookingFoolInfoTable
{
get
{
return XHomeCookAndPartyDocument._cookingFoodInfoTable;
}
}
public static CookingLevel CookingLevelTable
{
get
{
return XHomeCookAndPartyDocument._cookingLevelTable;
}
}
public static GardenBanquetCfg GardenBanquetCfgTable
{
get
{
return XHomeCookAndPartyDocument._gardenBanquetCfg;
}
}
public uint CurBanquetID
{
get
{
return this._curBanquetID;
}
set
{
this._curBanquetID = value;
}
}
public uint CurBanquetState
{
get
{
return this._curBanquetState;
}
set
{
this._curBanquetState = value;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("HomeCookAndPartyDocument");
private static CookingFoodInfo _cookingFoodInfoTable = new CookingFoodInfo();
private static CookingLevel _cookingLevelTable = new CookingLevel();
private static GardenBanquetCfg _gardenBanquetCfg = new GardenBanquetCfg();
private static ItemBuffTable _itemBuffTable = new ItemBuffTable();
public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();
private uint MaxCookLevel = 0u;
private List<uint> _newCookingItems = new List<uint>();
private uint _timerID = 0u;
private uint _curBanquetID = 0u;
private uint _curBanquetState = 0u;
private uint _CountDownTimerID = 0u;
private int _curFeastRemainTime = 0;
private uint _totalFeastedTimesWeekly = 0u;
private uint _timeToCooking = 5u;
protected float _curPassedTime = 0f;
public static void Execute(OnLoadedCallback callback = null)
{
XHomeCookAndPartyDocument.AsyncLoader.AddTask("Table/CookingFoodInfo", XHomeCookAndPartyDocument._cookingFoodInfoTable, false);
XHomeCookAndPartyDocument.AsyncLoader.AddTask("Table/CookingLevel", XHomeCookAndPartyDocument._cookingLevelTable, false);
XHomeCookAndPartyDocument.AsyncLoader.AddTask("Table/GardenBanquetCfg", XHomeCookAndPartyDocument._gardenBanquetCfg, false);
XHomeCookAndPartyDocument.AsyncLoader.AddTask("Table/ItemBuff", XHomeCookAndPartyDocument._itemBuffTable, false);
XHomeCookAndPartyDocument.AsyncLoader.Execute(callback);
}
public override void OnAttachToHost(XObject host)
{
base.OnAttachToHost(host);
}
protected override void EventSubscribe()
{
base.EventSubscribe();
}
public override void OnDetachFromHost()
{
base.OnDetachFromHost();
this.ResetBanquetState();
}
private void ResetBanquetState()
{
bool flag = this._curBanquetID > 0u;
if (flag)
{
this._curBanquetID = 0u;
bool flag2 = this._curBanquetState > 0u;
if (flag2)
{
XSingleton<XInput>.singleton.Freezed = false;
}
this._curBanquetState = 0u;
}
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
this.ResetBanquetState();
}
public override void OnEnterSceneFinally()
{
base.OnEnterSceneFinally();
}
public CookingFoodInfo.RowData GetCookInfoByCuisineID(uint id)
{
for (int i = 0; i < XHomeCookAndPartyDocument._cookingFoodInfoTable.Table.Length; i++)
{
bool flag = XHomeCookAndPartyDocument._cookingFoodInfoTable.Table[i].FoodID == id;
if (flag)
{
return XHomeCookAndPartyDocument._cookingFoodInfoTable.Table[i];
}
}
return null;
}
public GardenBanquetCfg.RowData GetGardenBanquetInfoByID(uint id)
{
GardenBanquetCfg.RowData[] table = XHomeCookAndPartyDocument._gardenBanquetCfg.Table;
for (int i = 0; i < table.Length; i++)
{
bool flag = table[i].BanquetID == id;
if (flag)
{
return table[i];
}
}
return null;
}
public bool IsFoodIdActiveInTable(uint id)
{
for (int i = 0; i < XHomeCookAndPartyDocument.CookingFoolInfoTable.Table.Length; i++)
{
bool flag = XHomeCookAndPartyDocument.CookingFoolInfoTable.Table[i].FoodID == id;
if (flag)
{
return XHomeCookAndPartyDocument.CookingFoolInfoTable.Table[i].CookBookID == 0u;
}
}
return false;
}
public void ReqGardenCookingFood(uint foodId)
{
RpcC2M_GardenCookingFood rpcC2M_GardenCookingFood = new RpcC2M_GardenCookingFood();
rpcC2M_GardenCookingFood.oArg.food_id = foodId;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GardenCookingFood);
}
public void AddNewCookItem(uint id)
{
bool flag = !this._newCookingItems.Contains(id);
if (flag)
{
this._newCookingItems.Add(id);
}
}
public bool RemoveNewCookItem(uint id)
{
bool flag = this._newCookingItems.Contains(id);
bool result;
if (flag)
{
this._newCookingItems.Remove(id);
result = true;
}
else
{
result = false;
}
return result;
}
public bool IsNewAddedCookItem(uint id)
{
return this._newCookingItems.Contains(id);
}
public void StartCreateFood(uint foodID)
{
CookingFoodInfo.RowData cookInfoByCuisineID = XHomeCookAndPartyDocument.Doc.GetCookInfoByCuisineID(foodID);
bool flag = cookInfoByCuisineID != null;
if (flag)
{
this._timeToCooking = cookInfoByCuisineID.Duration;
this._curPassedTime = 0f;
this.TimerUp();
}
}
private void TimerUp()
{
this.StopCreateFoodTimer();
this._timerID = XSingleton<XTimerMgr>.singleton.SetTimerAccurate(0.025f, new XTimerMgr.AccurateElapsedEventHandler(this.OnCreatingFood), 0.025f);
}
public void StopCreateFoodTimer()
{
XSingleton<XTimerMgr>.singleton.KillTimer(this._timerID);
this._timerID = 0u;
}
public void CookingFoodSuccess()
{
bool flag = DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.IsVisible() && DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeCookingHandler.IsVisible();
if (flag)
{
DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeCookingHandler.CookingSuccess();
}
}
public void BeginToFeast(uint banquet_id)
{
SceneType sceneType = XSingleton<XScene>.singleton.SceneType;
bool flag = sceneType != SceneType.SCENE_FAMILYGARDEN;
if (!flag)
{
this._curBanquetID = banquet_id;
GardenBanquetCfg.RowData gardenBanquetInfoByID = this.GetGardenBanquetInfoByID(this._curBanquetID);
bool flag2 = gardenBanquetInfoByID != null;
if (flag2)
{
this._curFeastRemainTime = (int)this.GetTotalFeastTimeByID(this._curBanquetID);
bool flag3 = XSingleton<XEntityMgr>.singleton.Player != null;
if (flag3)
{
XCharacterShowChatComponent xcharacterShowChatComponent = XSingleton<XEntityMgr>.singleton.Player.GetXComponent(XCharacterShowChatComponent.uuID) as XCharacterShowChatComponent;
bool flag4 = xcharacterShowChatComponent != null;
if (flag4)
{
xcharacterShowChatComponent.AttachFeastCdTime();
this.CountDownTimerUp();
XAutoFade.FadeIn(2f, true);
}
}
bool flag5 = DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.IsVisible() && DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeFeastHandler != null && DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeFeastHandler.IsVisible();
if (flag5)
{
DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeFeastHandler.BeginToFeast();
DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.SetVisible(false, true);
}
}
else
{
this._curFeastRemainTime = 0;
this._curBanquetID = 0u;
this._curBanquetState = 0u;
}
}
}
public void SendActiveFoodMenu(uint foodID)
{
RpcC2M_ActiveCookbook rpcC2M_ActiveCookbook = new RpcC2M_ActiveCookbook();
rpcC2M_ActiveCookbook.oArg.garden_id = HomePlantDocument.Doc.GardenId;
rpcC2M_ActiveCookbook.oArg.cook_book_id = foodID;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_ActiveCookbook);
}
public string GetFoodNameByID(uint id)
{
for (int i = 0; i < XHomeCookAndPartyDocument.CookingFoolInfoTable.Table.Length; i++)
{
bool flag = XHomeCookAndPartyDocument.CookingFoolInfoTable.Table[i].FoodID == id;
if (flag)
{
return XHomeCookAndPartyDocument.CookingFoolInfoTable.Table[i].FoodName;
}
}
return "";
}
public void SortFoodTableData()
{
CookingFoodInfo.RowData[] table = XHomeCookAndPartyDocument._cookingFoodInfoTable.Table;
for (int i = 0; i < table.Length; i++)
{
for (int j = i + 1; j < table.Length; j++)
{
bool flag = this.SortData(table[i], table[j]) > 0;
if (flag)
{
CookingFoodInfo.RowData rowData = table[i];
table[i] = table[j];
table[j] = rowData;
}
}
}
}
public bool IsTimeLimited(uint foodId)
{
uint frequency = XHomeCookAndPartyDocument.Doc.GetCookInfoByCuisineID(foodId).Frequency;
bool flag = frequency <= 0u;
bool result;
if (flag)
{
result = false;
}
else
{
bool flag2 = frequency <= HomeMainDocument.Doc.GetFoodMakedTimes(foodId);
result = flag2;
}
return result;
}
public void SendGardenBanquet(uint banquetID)
{
RpcC2M_GardenBanquet rpcC2M_GardenBanquet = new RpcC2M_GardenBanquet();
rpcC2M_GardenBanquet.oArg.banquet_id = banquetID;
XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GardenBanquet);
}
public void OnGardenFeastPhase(PtcG2C_GardenBanquetNotice res)
{
SceneType sceneType = XSingleton<XScene>.singleton.SceneType;
bool flag = sceneType != SceneType.SCENE_FAMILYGARDEN;
if (!flag)
{
this._totalFeastedTimesWeekly = res.Data.timesTSWK;
this._curBanquetState = res.Data.banquet_stage;
bool flag2 = this._curBanquetState == 1u;
if (flag2)
{
this.EnableBackToMainCity(false);
XSingleton<XInput>.singleton.Freezed = true;
bool flag3 = XSingleton<XEntityMgr>.singleton.Player != null && XSingleton<XEntityMgr>.singleton.Player.Nav != null;
if (flag3)
{
bool flag4 = XSingleton<XEntityMgr>.singleton.Player.Ator != null;
if (flag4)
{
XSingleton<XEntityMgr>.singleton.Player.Ator.EnableRootMotion(true);
}
XSingleton<XEntityMgr>.singleton.Player.Nav.Interrupt();
XSingleton<XEntityMgr>.singleton.Player.Nav.Enabled = false;
}
}
else
{
bool flag5 = this._curBanquetState == 0u;
if (flag5)
{
this.EnableBackToMainCity(true);
bool flag6 = this.IsHasRewards();
if (flag6)
{
this.OnGetGardenFeastRewards();
}
this._curFeastRemainTime = 0;
this._curBanquetID = 0u;
XSingleton<XInput>.singleton.Freezed = false;
bool flag7 = XSingleton<XEntityMgr>.singleton.Player != null && XSingleton<XEntityMgr>.singleton.Player.Nav != null;
if (flag7)
{
bool flag8 = XSingleton<XEntityMgr>.singleton.Player.Ator != null;
if (flag8)
{
XSingleton<XEntityMgr>.singleton.Player.Ator.EnableRootMotion(false);
}
XSingleton<XEntityMgr>.singleton.Player.Nav.Interrupt();
XSingleton<XEntityMgr>.singleton.Player.Nav.Enabled = true;
}
}
}
this.ChangeFeastPhase();
}
}
private bool IsHasRewards()
{
int @int = XSingleton<XGlobalConfig>.singleton.GetInt("GardenBanquetAwardTimesTSWK");
return (ulong)this._totalFeastedTimesWeekly <= (ulong)((long)@int);
}
public void OnHomeFeastingCountDown(object argu, float delay)
{
this._curFeastRemainTime--;
XEvent_HomeFeastingArgs @event = XEventPool<XEvent_HomeFeastingArgs>.GetEvent();
@event.time = (uint)Math.Max(0, this._curFeastRemainTime);
@event.Firer = XSingleton<XEntityMgr>.singleton.Player;
XSingleton<XEventMgr>.singleton.FireEvent(@event);
bool flag = this._curFeastRemainTime >= 1;
if (flag)
{
this.CountDownTimerUp();
}
else
{
this.StopCountDownTimer();
}
}
private void CountDownTimerUp()
{
this.StopCountDownTimer();
this._CountDownTimerID = XSingleton<XTimerMgr>.singleton.SetTimerAccurate(1f, new XTimerMgr.AccurateElapsedEventHandler(this.OnHomeFeastingCountDown), null);
}
private void StopCountDownTimer()
{
XSingleton<XTimerMgr>.singleton.KillTimer(this._CountDownTimerID);
this._CountDownTimerID = 0u;
}
public void OnGetGardenFeastRewards()
{
GardenBanquetCfg.RowData gardenBanquetInfoByID = this.GetGardenBanquetInfoByID(this._curBanquetID);
bool flag = gardenBanquetInfoByID != null;
if (flag)
{
List<ItemBrief> list = new List<ItemBrief>();
for (int i = 0; i < gardenBanquetInfoByID.BanquetAwards.Count; i++)
{
list.Add(new ItemBrief
{
itemID = gardenBanquetInfoByID.BanquetAwards[i, 0],
itemCount = gardenBanquetInfoByID.BanquetAwards[i, 1]
});
}
DlgBase<RewdAnimDlg, RewdAnimBehaviour>.singleton.ShowByTitle(list, XSingleton<XStringTable>.singleton.GetString("FeastReward"), null);
bool flag2 = DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.IsVisible() && DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeFeastHandler.IsVisible();
if (flag2)
{
DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeFeastHandler.RefreshPartyBtnState(true);
}
}
}
public uint GetExpByCookLevel(uint level)
{
foreach (CookingLevel.RowData rowData in XHomeCookAndPartyDocument._cookingLevelTable.Table)
{
bool flag = rowData.CookLevel == level;
if (flag)
{
return rowData.Experiences;
}
}
return 0u;
}
public ItemBuffTable.RowData GetItembuffDataByID(uint id)
{
for (int i = 0; i < XHomeCookAndPartyDocument._itemBuffTable.Table.Length; i++)
{
ItemBuffTable.RowData rowData = XHomeCookAndPartyDocument._itemBuffTable.Table[i];
bool flag = rowData.ItemId == id;
if (flag)
{
return rowData;
}
}
return null;
}
public uint GetItemIDByBuffID(uint id)
{
for (int i = 0; i < XHomeCookAndPartyDocument._itemBuffTable.Table.Length; i++)
{
ItemBuffTable.RowData rowData = XHomeCookAndPartyDocument._itemBuffTable.Table[i];
for (int j = 0; j < rowData.Buffs.Count; j++)
{
bool flag = rowData.Buffs[j, 0] == id;
if (flag)
{
return rowData.ItemId;
}
}
}
return 0u;
}
private void ChangeFeastPhase()
{
GardenBanquetCfg.RowData gardenBanquetInfoByID = this.GetGardenBanquetInfoByID(this._curBanquetID);
bool flag = gardenBanquetInfoByID == null;
if (!flag)
{
XBubbleEventArgs @event = XEventPool<XBubbleEventArgs>.GetEvent();
string bubbletext = "";
uint num = 0u;
bool flag2 = this._curBanquetState != 0u && (ulong)this._curBanquetState <= (ulong)((long)XSingleton<XGlobalConfig>.singleton.GetInt("HomePartyMaxPhase"));
if (flag2)
{
switch (this._curBanquetState)
{
case 1u:
bubbletext = gardenBanquetInfoByID.VoiceOver1;
num = gardenBanquetInfoByID.VoiceOver1Duration;
break;
case 2u:
bubbletext = gardenBanquetInfoByID.VoiceOver2;
num = gardenBanquetInfoByID.VoiceOver2Duration;
break;
case 3u:
bubbletext = gardenBanquetInfoByID.VoiceOver3;
num = gardenBanquetInfoByID.VoiceOver3Duration;
break;
case 4u:
bubbletext = gardenBanquetInfoByID.VoiceOver4;
num = gardenBanquetInfoByID.VoiceOver4Duration;
break;
default:
XSingleton<XDebug>.singleton.AddErrorLog("Invalid _curBanquetState", null, null, null, null, null);
break;
}
XNpc npc = XSingleton<XEntityMgr>.singleton.GetNpc((uint)XSingleton<XGlobalConfig>.singleton.GetInt("HouseKeeperID"));
bool flag3 = npc == null;
if (!flag3)
{
@event.bubbletext = bubbletext;
@event.existtime = num;
@event.Firer = npc;
@event.speaker = npc.Name;
XBubbleComponent xbubbleComponent = @event.Firer.GetXComponent(XBubbleComponent.uuID) as XBubbleComponent;
bool flag4 = xbubbleComponent == null;
if (flag4)
{
XSingleton<XComponentMgr>.singleton.CreateComponent(@event.Firer, XBubbleComponent.uuID);
}
XSingleton<XEventMgr>.singleton.FireEvent(@event);
}
}
}
}
public uint GetTotalFeastTimeByID(uint banquetID)
{
GardenBanquetCfg.RowData gardenBanquetInfoByID = this.GetGardenBanquetInfoByID(banquetID);
bool flag = gardenBanquetInfoByID != null;
uint result;
if (flag)
{
result = gardenBanquetInfoByID.VoiceOver1Duration + gardenBanquetInfoByID.VoiceOver2Duration + gardenBanquetInfoByID.VoiceOver3Duration + gardenBanquetInfoByID.VoiceOver4Duration;
}
else
{
result = 0u;
}
return result;
}
public string GetHomeFeastAction(uint basicType)
{
return string.Format("Player_{0}_{1}", XSingleton<XProfessionSkillMgr>.singleton.GetLowerCaseWord(basicType), "yanhui");
}
public uint GetMaxLevel()
{
bool flag = this.MaxCookLevel == 0u;
if (flag)
{
uint num = 0u;
for (int i = 0; i < XHomeCookAndPartyDocument._cookingLevelTable.Table.Length; i++)
{
num = Math.Max(XHomeCookAndPartyDocument._cookingLevelTable.Table[i].CookLevel, num);
}
this.MaxCookLevel = num;
}
return this.MaxCookLevel;
}
private void EnableBackToMainCity(bool Enable)
{
bool flag = DlgBase<HomePlantDlg, HomePlantBehaviour>.singleton.IsVisible();
if (flag)
{
DlgBase<HomePlantDlg, HomePlantBehaviour>.singleton.SetVisible(false, true);
}
DlgBase<DramaDlg, DramaDlgBehaviour>.singleton.SetVisible(false, true);
bool flag2 = !Enable;
if (flag2)
{
XSingleton<UIManager>.singleton.CloseAllUI();
}
HomeHandler homeHandler = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._HomeHandler;
bool flag3 = homeHandler != null;
if (flag3)
{
homeHandler.EnableBackToMainCity(Enable);
}
DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.BottomDownBtns(Enable);
}
private void OnCreatingFood(object argu, float delay)
{
this._curPassedTime += (float)argu;
bool flag = DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.IsVisible() && DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeCookingHandler.IsVisible();
if (flag)
{
DlgBase<HomeMainDlg, TabDlgBehaviour>.singleton.HomeCookingHandler.SetProgress(this._curPassedTime / this._timeToCooking);
}
bool flag2 = this._curPassedTime >= this._timeToCooking;
if (flag2)
{
this.StopCreateFoodTimer();
}
else
{
this.TimerUp();
}
}
private int SortData(CookingFoodInfo.RowData x1, CookingFoodInfo.RowData x2)
{
int num = x1.Level.CompareTo(x2.Level);
return (num == 0) ? this.FoodActiveCompare(x1.FoodID, x2.FoodID) : num;
}
private int FoodActiveCompare(uint foodIdL, uint foodIdR)
{
bool flag = HomeMainDocument.Doc.IsFoodIDActive(foodIdL);
bool flag2 = HomeMainDocument.Doc.IsFoodIDActive(foodIdR);
bool flag3 = flag ^ flag2;
int result;
if (flag3)
{
bool flag4 = flag;
if (flag4)
{
result = -1;
}
else
{
result = 1;
}
}
else
{
result = 0;
}
return result;
}
}
}
|