protected MissionTarget SelectRandomMissionStructure(MissionInProgress missionInProgress, MissionTargetType targetType) { var structures = SearchForMinimalAmountOfStructures(missionInProgress, targetType, missionInProgress.SelectedTargets); if (structures.Count == 0) { Log("no possible structure targets to select from. " + targetType + " " + this + " " + missionInProgress); return(null); } var selectedTarget = structures.RandomElement(); missionInProgress.AddToSelectedTargets(selectedTarget); return(selectedTarget); }
private MissionTarget SearchForPossibleSpots(MissionInProgress missionInProgress) { var foundTargets = SearchForMinimalAmountOfSpots(missionInProgress, missionInProgress.SelectedTargets); if (foundTargets.Count == 0) { Log("no possible location targets to select from. " + this + " " + missionInProgress); return(null); } var selectedTarget = foundTargets.RandomElement(); missionInProgress.AddToSelectedTargets(selectedTarget); return(selectedTarget); }