Skip to content

Instantly share code, notes, and snippets.

@avasilkov
Created January 16, 2016 20:31
Show Gist options
  • Select an option

  • Save avasilkov/76cc9266026f9d15badf to your computer and use it in GitHub Desktop.

Select an option

Save avasilkov/76cc9266026f9d15badf to your computer and use it in GitHub Desktop.
struct Base{
virtual float getDistance() = 0;
};
struct CanBeSmelled{
Smell smells[10];
Smell getSmell();
};
struct CanBeHeard{
Sound sounds[10];
Sound getSound();
};
struct CanBeSeen{
EyeInfo eyeInfoVec[10];
EyeInfo getEyeInfo();
};
struct Human : CanBeSeen, CanBeHeard, CanBeSmelled{
float getDistance()override{return distanceToHuman;}
};
struct Wall : CanBeSeen{
float getDistance()override{return distanceToWall;}
};
struct ShitOnTheGround : CanBeSeen, CanBeSmelled{
float getDistance()override{return distanceToWall;}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment