You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
641 B
27 lines
641 B
import { Command } from './Command.js'; |
|
|
|
/** |
|
* Command for ending the player's turn in battle |
|
* Wraps the existing root.end() method |
|
*/ |
|
export class EndTurnCommand extends Command { |
|
constructor(gameRoot) { |
|
super(); |
|
this.gameRoot = gameRoot; |
|
} |
|
|
|
execute() { |
|
try { |
|
// Use existing root.end method (which now creates proper battle context) |
|
this.gameRoot.end(); |
|
return true; |
|
} catch (error) { |
|
console.error("EndTurnCommand execution failed:", error); |
|
return false; |
|
} |
|
} |
|
|
|
getDescription() { |
|
return "End Turn"; |
|
} |
|
} |