📄 agent.h
字号:
//// pedsim - A microscopic pedestrian simulation system. // Copyright (c) 2003 - 2004 by Christian Gloor// // You can redistribute and/or modify this program under the terms of// the GNU General Public License. See copying.txt for details.// #include <iostream>#include <vector>class Tagent { private: double x,y; int id; double vx,vy; int type; double energy; bool dead;
std::vector<Tagent>::iterator enemynearest; double enemydist; double color; double direction; double sword; double swordini; public: Tagent(); void move(long systemtime); void setPosition(double px, double py); void setType(int t) {type = t; }; int getid() { return id; }; int gettype() { return type; }; double getx() { return x; }; double gety() { return y; }; double getdirection() { return direction; }; double getsword() { return sword; }; double getcolor() { return color; }; bool isalive() { return !dead; }; void hit(); void print() {std::cout << "agent " << id << ": " << x << "/" << y << std::endl; };};#define AgentContainer std::vector<Tagent>#define AgentIterator std::vector<Tagent>::iterator
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -