作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
<分区>
Pickup::Pickup(std::vector<Agent, std::allocator<Agent>> &agents)" provides no initializer for:
我的许多构造函数都遇到了这个错误,令人恼火的是,错误在它告诉我我没有提供初始化程序之前就突然结束了。此外,我非常确定我实际上正在为所有需要它的东西提供初始化。任何人都可以阐明这一点吗?
#include "Pickup.h"
Pickup::Pickup(vector<Agent>& agents)
: GameObject(), TOLERANCE(0.1f)
{ // this brace is underlined and is where the error occurs.
xRotation = D3DXVECTOR3(0.005f, 0.005f, 0.04f);
count = 0;
index = -1;
nodeIndex = -1;
isPresent = true;
}
void Pickup::Regenerate()
{
//when the pickup gets picked up, start a countdown
count++;
if (count == 300)
{
isPresent = true;
count = 0;
}
}
//void Pickup::addAmmo(int agentIndex) { }
void Pickup::Update()
{
Rotation(Rotation() + xRotation);
for (unsigned int i = 0; i < agents.size(); i++)
{
//if (D3DXVec3Length(agents[i].MainLegsPosition() - Position()) < TOLERANCE && isPresent)//right here
//{
// addAmmo(agents[i].Index());
// isPresent = false;
//}
}
if (isPresent == false)
{
Regenerate();
}
}
/*void Pickup::Draw(D3DXMATRIX matView, D3DXMATRIX matProjection, ID3D10Effect* effect)//right here
{
if (isPresent == true)
{
Draw(matView, matProjection, effect);
}
}*/
// getters
int Pickup::Index()
{
return index;
}
int Pickup::NodeIndex()
{
return nodeIndex;
}
bool Pickup::IsPresent()
{
return isPresent;
}
/* vector<Agent>& Pickup::Agents()
{
return agents;
}*/
// setters
void Pickup::Index(int index)
{
this->index = index;
}
void Pickup::NodeIndex(int nodeIndex)
{
this->nodeIndex = nodeIndex;
}
标题:
#ifndef PICKUP_H
#define PICKUP_H
#include "gameObject.h"
#include "Agent.h"
#include <vector>
using namespace std;
class Pickup : public GameObject
{
private:
int count;
int index;
int nodeIndex;
bool isPresent;
D3DXVECTOR3 xRotation;
const float TOLERANCE;
void Regenerate();
protected:
vector<Agent>& agents;
public:
Pickup(vector<Agent>& agents);
virtual void addAmmo(int agentIndex);
void Update();
void Draw();
// getters
int Index();
int NodeIndex();
bool IsPresent();
// setters
void Index(int index);
void NodeIndex(int nodeIndex);
};
#endif
我想成为 Spark 纱客户(link)。是否需要安装hadoop?还是只安装 yarn 可以吗? (by this link) 最佳答案 No Spark不需要Hadoop即可运行。 Apache
我是一名优秀的程序员,十分优秀!