Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 64c6fcc

Browse files
Zhangyr2022futrime
authored andcommitted
Fix #39
1 parent dfc2e88 commit 64c6fcc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Source/Game.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,11 @@ public void Refresh()
445445
this.End();
446446
}
447447

448-
this.GenerateOrder();
448+
// Actually, whether the CarPosition is null or not, the game should generate orders anyway.
449+
// So, I take the function 'GenerateOrder' out of the function 'Refresh'
450+
// For more details, please check the reference of this function-- 'Refresh'
451+
452+
// this.GenerateOrder();
449453

450454
this.TakeAndDeliverOrder();
451455

@@ -632,7 +636,7 @@ private void AutoCharge()
632636
/// <summary>
633637
/// Attempt to generate an order.
634638
/// </summary>
635-
private void GenerateOrder()
639+
public void GenerateOrder()
636640
{
637641
var newOrder = this._orderGenerator.Generate((long)this.GameTime);
638642
if (newOrder != null)

Source/MainWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ private void RefreshAll()
314314
this._game.Refresh();
315315
}
316316

317+
// Actually, whether the CarPosition is null or not, the game should generate orders anyway.
318+
// So, I take the function 'GenerateOrder' out of the function 'Refresh'
319+
320+
this._game.GenerateOrder();
321+
317322
this.buttonFoul.Enabled = true;
318323
this.buttonCalibration.Enabled = false;
319324
this.buttonSettings.Enabled = false;

0 commit comments

Comments
 (0)