bots wait until active

This commit is contained in:
evanpelle
2024-08-16 15:11:28 -07:00
parent d12ebc5f4b
commit 9a64a83b43
+7 -1
View File
@@ -11,6 +11,8 @@ export class BotExecution implements Execution {
private gs: MutableGame
private neighborsTerra = true
private ticksUntilStart = 50
constructor(private bot: MutablePlayer, private playerConfig: PlayerConfig) {
this.random = new PseudoRandom(bot.id())
@@ -23,6 +25,11 @@ export class BotExecution implements Execution {
}
tick(ticks: number) {
if (ticks < this.ticksUntilStart) {
return
}
if (!this.bot.isAlive()) {
this.active = false
return
@@ -42,7 +49,6 @@ export class BotExecution implements Execution {
this.neighborsTerra = false
}
const ns = this.bot.neighbors()
if (ns.length == 0) {
return