func (a *Agent) getAction() int { if a.currentTile.GetITile().GetState() == env.DIRTY { return SUCK } if a.noopsRemaining > 0 { a.noopsRemaining-- return NOOP } if a.phase == EXPLORE { a.tileQueue.AddUnique(a.currentTile) var dir = int(a.getSearchDirection()) if dir != int(env.NONE) { return dir } } if a.phase == MAINTENANCE { if arg.NoMoreDirt() { return NOOP } return int(a.getPatrolDirection()) } return NOOP }
func (c *Controller) Tick() { if arg.NoMoreDirt() { return } for i := 0; i < len(c.tileSlice); i++ { c.tileSlice[i].tick() } }