refactor: update IdleState to include periodic fuel checks and adjust sleep duration
This commit is contained in:
@@ -13,12 +13,11 @@ export class IdleState extends BaseState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async *act() {
|
async *act() {
|
||||||
// Send periodic status updates while idle
|
// Periodic fuel check while idle (no scanning — avoids rotating turtle)
|
||||||
while (!this.cancelled) {
|
while (!this.cancelled) {
|
||||||
await this.checkFuel();
|
await this.checkFuel();
|
||||||
await this.scanSurroundings();
|
|
||||||
yield;
|
yield;
|
||||||
await this._sleep(5000);
|
await this._sleep(10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user