#include <iostream>
using namespace std;
void HelloWorld() {
cout << "Hello World" << endl;
}
class Knight {
public:
void AddHp(int addHp) {
_hp += addHp;
}
public:
int _hp = 100;
};
class Functor {
public:
void operator()() {
cout << "Functor Test " << _value << endl;
}
bool operator()(int num) {
cout << "Functor Test2" << endl;
_value += num;
cout << _value << endl;
return true;
}
public:
int _value = 0;
};
class MoveTask {
public:
void operator()() {
cout << "해당 좌표로 이동" << endl;
}
public:
int _playerId;
int _posX;
int _posY;
};
int main()
{
void (*func)();
func = &HelloWorld;
(*func)();
HelloWorld();
Functor functor;
functor();
functor(5);
MoveTask task;
task._playerId = 100;
task._posX = 5;
task._posY = 0;
task();
return 0;
}