Quote:
This way, I didn't need to include block.h in prototypes.h and I included types.h in player.h instead. Is this a good attempt to avoid "in file includes" or am I just solving this in a cheap way?
No, this is still just as bad, and it can still lead to the same problems. Why can't you just put the typedef for blocklib into block.h, with the rest of the block stuff?
Catch-all headers of almost any sort are
bad. In addition to the #include nightmares that can result, they can seriously impact compile times because they introduce dependancies where dependancies don't exist.
types.h might seem benign now, but when type.h includes related typedefs for sixty or seventy classes, it will be a nightmare. A given translation unit might #include "types.h" for
one type (say, blocklib), but if
any of the seventy-odd types in types.h (or any of the files types.h includes) changes, that translation unit will be rebuilt unneccessarily. When sixty or seventy files rebuild because you changed one file unrelated to all of those, you'll regret using a catch-all header.
The proper solution is to put things like blocklib in block.h.
Any translation that needed to include types.h to get access to blocklib will need block.h included anyway, and this way you drastically reduce your potential for preprocessor screw-ups and dependancy issues.
Follow the principal of minimizing your dependancies.