Enemy AI is now prototyped and can find the player and attack them.

This commit is contained in:
Zed A. Shaw 2025-03-14 13:41:22 -04:00
parent ad71631809
commit f3e157a0f7
6 changed files with 78 additions and 38 deletions

View file

@ -198,7 +198,10 @@ namespace DinkyECS
return !queue.empty();
}
/* std::optional can't do references. Don't try it! */
/* std::optional can't do references. Don't try it!
* Actually, this sucks, either delete it or have it
* return pointers (assuming optional can handle pointers)
*/
template <typename Comp>
std::optional<Comp> get_if(DinkyECS::Entity entity) {
if(has<Comp>(entity)) {