#include #include using namespace std; struct Params { int life = 3; int movement = 4; int pos[2]; }; class Enemy: protected Params { virtual void move() {}; friend void killAi(Enemy); }; template class Palladin : public Enemy { TT stamina; string weapon = "sword"; int mana = 10; public: void move(int x, int y) { if (movement > x && movement > y) { pos[0] = x; pos[1] = y; } } }; void killAi(Enemy e) { e.life = 0; } template TTTT upgradeAi(TTTT e) { return e; } int main() { Palladin> jerzy; Enemy kretoszczur; jerzy.move(1, 1); killAi(jerzy); killAi(kretoszczur); upgradeAi(jerzy); upgradeAi(kretoszczur); upgradeAi("kolonia"); }