Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }