Files
DEC/DEC_GUI/Agressor/agent.cpp
2024-10-03 18:43:04 +07:00

80 lines
1.9 KiB
C++

#include "agent.h"
#include <iostream>
#include <QLineF>
Agent::Agent(uint agentId, uint agr, uint prot, uint mod, uint str, uint rad, uint sp, QObject *parent) :
id(agentId), agressor(agr), protector(prot), mode(mod), strategy(str), radius(rad),
speed(sp), distTarget(0), contentment(0), QObject(parent) {}
uint Agent::getID(){
return this->id;
}
void Agent::setID(uint agentId){
this->id = agentId;
}
uint Agent::getAgressor(){
return this->agressor;
}
void Agent::setAgressor(uint agr){
this->agressor = agr;
}
uint Agent::getProtector(){
return this->protector;
}
void Agent::setProtector(uint prot){
this->protector = prot;
}
qreal Agent::getCoordX(){
return this->coordX;
}
void Agent::setCoordX(qreal x){
this->coordX = x;
}
qreal Agent::getCoordY(){
return this->coordY;
}
void Agent::setCoordY(qreal y){
this->coordY = y;
}
uint Agent::getMode() {
return this->mode;
}
void Agent::setMode(uint mod) {
this->mode = mod;
}
uint Agent::getStrategy() {
return this->strategy;
}
void Agent::setStratedy(uint str){
this->strategy = str;
}
int Agent::getRadius(){
return this->radius;
}
void Agent::setRadius(uint rad){
this->radius = rad;
}
uint Agent::getSpeed(){
return this->speed;
}
void Agent::setSpeed(uint sp){
this->speed = sp;
}
qreal Agent::getDistTarget(){
return this->distTarget;
}
void Agent::setDistTarget(qreal dist){
this->distTarget = dist;
}
qreal Agent::getContentmemt(){
return this->contentment;
}
void Agent::setContentment(qreal cont){
this->contentment = cont;
}
void Agent::gameEvent(QLineF shift){
setCoordX(getCoordX() + shift.dx());
setCoordY(getCoordY() + shift.dy());
//std::cout << "new coord X: " << getCoordX() << ", new coord Y: " << getCoordY() << std::endl;
}