#ifndef VISION_AVOIDANCEH #define VISION_AVOIDANCEH #include "avoidance.h" #include "visionary.h" //a motion class that uses class visionary's heuristics to determine the proper //direction to move than ranks its 8 possible moves based on collision avoidance //with an object with a character specified in the constructor. //used with the wall character (#) by the game, objects avoid picking moves //that would run them into walls while still giving preference //to the visionary directive class vision_avoidance: protected avoidance, private visionary { void decide(int *dx, int *dy) const {avoidance::decide(dx,dy);} void getInitialDirection(int *dx, int *dy) const{ visionary::decide(dx,dy);} public: vision_avoidance(game *initial_g, unsigned initial_x, unsigned initial_y, char initial_c, char initial_avoid, unsigned initial_rad = 3) :wabbit(initial_g, initial_x, initial_y, initial_c), avoidance(initial_g, initial_x, initial_y, initial_c, initial_avoid), visionary(initial_g, initial_x, initial_y, initial_c, initial_rad) {} }; #endif