Consider the following set of classes / Interfaces:
class IFish{
public:
virtual void eat() = 0;
}
class IFriendly{
public:
virtual void protect() = 0;
}
class IAggresive{
public:
virtual void attack(Point inDest) = 0;
}
class CDolphin : public IFish, IFriendly{
eat...
protect....
}
class CShark : public IFish, IAggresive{
eat....
attack...
}
Now i have the next class
void CDiver
{
Void shouldRunAway(IFish* fish)
{
}
}
My question is: can "mustRunAway" extract from the fish argument, is it IAggresive or IFreindly (if at all any of this ...) is there some kind of drop that might help?
source
share