Files
remoteturtle/server/states/IdleState.js

24 lines
469 B
JavaScript

/**
* IdleState - Turtle is idle, waiting for commands
*/
import { BaseState } from './BaseState.js';
export class IdleState extends BaseState {
get name() {
return 'idle';
}
get description() {
return 'Idle - waiting for commands';
}
async *act() {
// Periodic fuel check while idle (no scanning — avoids rotating turtle)
while (!this.cancelled) {
await this.checkFuel();
yield;
await this._sleep(10000);
}
}
}