本文整理汇总了C++中ParameterList::AddValue方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::AddValue方法的具体用法?C++ ParameterList::AddValue怎么用?C++ ParameterList::AddValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList::AddValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSense
void VisionPerceptor::AddSense(oxygen::Predicate& predicate, ObjectData& od) const
{
ParameterList& element = predicate.parameter.AddList();
element.AddValue(od.mObj->GetPerceptName());
// if(od.mObj->GetPerceptName() == "Player")
if(od.mObj->GetPerceptName() == "P")
{
ParameterList player;
player.AddValue(std::string("team"));
player.AddValue
(std::string
(od.mObj->GetPerceptName(ObjectState::PT_Player)
)
);
element.AddValue(player);
}
if (!od.mObj->GetID().empty())
{
ParameterList id;
id.AddValue(std::string("id"));
id.AddValue(od.mObj->GetID());
element.AddValue(id);
}
ParameterList& position = element.AddList();
position.AddValue(std::string("pol"));
position.AddValue(od.mDist);
position.AddValue(od.mTheta);
position.AddValue(od.mPhi);
}
示例2: SetParams
void Capsule::SetParams(float radius, float length)
{
ParameterList parameter;
parameter.AddValue(radius);
parameter.AddValue(length);
Load("StdCapsule",parameter);
mRadius = radius;
mLength = length;
}
示例3: switch
void
getParameterList(VALUE args, ParameterList& params)
{
int argc = RARRAY_LEN(args);
for (int i = 0; i<argc; ++i)
{
VALUE argument = rb_ary_entry(args, i);
boost::any var;
// do type conversion
switch (TYPE(argument))
{
case T_STRING:
{
char *c = STR2CSTR(argument);
var = c;
//printf("string: '%s'\n",boost::any_cast<char*>(var));
}
break;
case T_FIXNUM:
{
int i = FIX2INT(argument);
var = i;
//printf("int: '%d'\n", boost::any_cast<int>(var));
}
break;
case T_FLOAT:
{
float f = (float)NUM2DBL(argument);
var = f;
//printf("float: '%f'\n", boost::any_cast<float>(var));
}
break;
case T_TRUE:
{
var = true;
//printf("bool: 'true'\n");
}
break;
case T_FALSE:
{
var = false;
//printf("bool: 'false'\n");
}
break;
}
params.AddValue(var);
}
}
示例4: while
void
SexpParser::SexpToList(ParameterList& arguments, const sexp_t* const sexp)
{
sexp_t* s = const_cast<sexp_t*>(sexp);
while (s != 0)
{
if (s->ty == SEXP_VALUE)
{
arguments.AddValue(string(s->val));
} else {
ParameterList& elem = arguments.AddList();
SexpToList(elem,s->list);
}
s = s->next;
}
}
示例5:
void
RestrictedVisionPerceptor::AddSense(Predicate& predicate,
boost::shared_ptr<BaseNode> node,
TObjectList& objectList) const
{
if (objectList.empty())
{
return;
}
boost::shared_ptr<AgentAspect> agent_aspect =
dynamic_pointer_cast<AgentAspect>(node);
if (agent_aspect != 0)
{
boost::shared_ptr<AgentAspect> aspect =
agent_aspect->FindParentSupportingClass<AgentAspect>().lock();
if (aspect != 0)
{
agent_aspect = aspect;
}
boost::shared_ptr<AgentState> agent_state = static_pointer_cast<AgentState>
(agent_aspect->GetChildOfClass("AgentState",true));
if (agent_state.get() == 0 ||
(agent_state->GetPerceptName(ObjectState::PT_Player).empty())
)
{
return;
}
ParameterList& element = predicate.parameter.AddList();
element.AddValue(std::string("P"));
ParameterList player;
player.AddValue(std::string("team"));
player.AddValue
(std::string
(agent_state->GetPerceptName(ObjectState::PT_Player)
)
);
element.AddValue(player);
if (! agent_state->GetID().empty())
{
ParameterList id;
id.AddValue(std::string("id"));
id.AddValue(agent_state->GetID());
element.AddValue(id);
}
for (TObjectList::iterator j = objectList.begin();
j != objectList.end(); ++j)
{
ObjectData& od = (*j);
if (!od.mObj->GetID().empty())
{
ParameterList id;
id.AddValue(od.mObj->GetID());
ParameterList position;
position.AddValue(std::string("pol"));
position.AddValue(od.mDist);
position.AddValue(od.mTheta);
position.AddValue(od.mPhi);
id.AddValue(position);
element.AddValue(id);
}
}
}
else
{
for (TObjectList::iterator j = objectList.begin();
j != objectList.end(); ++j)
{
ObjectData& od = (*j);
ParameterList& element = predicate.parameter.AddList();
element.AddValue(od.mObj->GetPerceptName());
ParameterList& position = element.AddList();
position.AddValue(std::string("pol"));
position.AddValue(od.mDist);
position.AddValue(od.mTheta);
position.AddValue(od.mPhi);
}
}
}