Ejemplo n.º 1
0
        private static List <string> FromAsResources(Dictionary <string, List <Target> > map, string sensor)
        {
            List <string> resources = new List <string>();

            foreach (Target target in map[sensor])
            {
                resources.Add(TargetHelper.AsResource(target));
            }
            return(resources);
        }
Ejemplo n.º 2
0
        private static List <BotController> ByDistance(BotController myself, List <BotController> them, bool nearIsPriority)
        {
            List <BotController> working = new List <BotController>(them);

            working.Sort((x, y) =>
            {
                return((nearIsPriority ? 1 : -1) * TargetHelper.Distance(myself, x).CompareTo(TargetHelper.Distance(myself, y)));
            });
            return(working);
        }
Ejemplo n.º 3
0
 internal static bool ApplyTargetConditional(string targetConditional, BotController myself, BotController target)
 {
     return(conditionalFunctions[TargetHelper.Parse(targetConditional)](myself, target));
 }
Ejemplo n.º 4
0
 internal static List <BotController> ApplyTargetPriority(string targetPriority, BotController myself, List <BotController> them)
 {
     return(priorityFunctions[TargetHelper.Parse(targetPriority)](myself, them));
 }
Ejemplo n.º 5
0
        private static bool DistanceBetween(BotController myself, BotController target, float min, float max)
        {
            float distance = TargetHelper.Distance(myself, target);

            return(min <= distance && distance <= max);
        }