feat: Implement IdleState class for turtle state machine to handle idle behavior

This commit is contained in:
MayaTheShy
2026-02-20 01:42:06 -05:00
parent 0f22c8e49b
commit 6f73fdd0ed

View File

@@ -0,0 +1,24 @@
/**
* 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() {
// Send periodic status updates while idle
while (!this.cancelled) {
await this.checkFuel();
await this.scanSurroundings();
yield;
await this._sleep(5000);
}
}
}