(result, getToLocationsGoal)
| 658 | } |
| 659 | |
| 660 | function generateGetToLocations (result, getToLocationsGoal) { |
| 661 | while (true) { |
| 662 | const locationThang = { |
| 663 | id: 'Goal Junior', |
| 664 | pos: getRandomPosition(result), |
| 665 | margin: 0 |
| 666 | } |
| 667 | if (addThang(result, locationThang)) { |
| 668 | getToLocationsGoal.getToLocations.targets = [locationThang.id] |
| 669 | break |
| 670 | } |
| 671 | } |
| 672 | if (!getToLocationsGoal.getToLocations.targets.length) { |
| 673 | console.log("Couldn't find space for a goal; removing getToLocationsGoal") |
| 674 | result.goals = _.without(result.goals, getToLocationsGoal) |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | function generateCollectThangs (result, collectThangsGoal) { |
| 679 | let lastThangCount = result.thangs.length |
no test coverage detected