本文整理汇总了C++中PointType::Value方法的典型用法代码示例。如果您正苦于以下问题:C++ PointType::Value方法的具体用法?C++ PointType::Value怎么用?C++ PointType::Value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointType
的用法示例。
在下文中一共展示了PointType::Value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tptS_bubble
AnyType TPTScriptInterface::tptS_bubble(std::deque<std::string> * words)
{
//Arguments from stack
PointType bubblePosA = eval(words);
ui::Point bubblePos = bubblePosA.Value();
if(bubblePos.X<0 || bubblePos.Y<0 || bubblePos.Y >= YRES || bubblePos.X >= XRES)
throw GeneralException("Invalid position");
Simulation * sim = m->GetSimulation();
int first, rem1, rem2;
first = sim->create_part(-1, bubblePos.X+18, bubblePos.Y, PT_SOAP);
rem1 = first;
for (int i = 1; i<=30; i++)
{
rem2 = sim->create_part(-1, bubblePos.X+18*cosf(i/5.0), bubblePos.Y+18*sinf(i/5.0), PT_SOAP);
sim->parts[rem1].ctype = 7;
sim->parts[rem1].tmp = rem2;
sim->parts[rem2].tmp2 = rem1;
rem1 = rem2;
}
sim->parts[rem1].ctype = 7;
sim->parts[rem1].tmp = first;
sim->parts[first].tmp2 = rem1;
sim->parts[first].ctype = 7;
return NumberType(0);
}
示例2: tptS_create
AnyType TPTScriptInterface::tptS_create(std::deque<std::string> * words)
{
//Arguments from stack
AnyType createType = eval(words);
PointType position = eval(words);
Simulation * sim = m->GetSimulation();
int type;
if(createType.GetType() == TypeNumber)
type = ((NumberType)createType).Value();
else if(createType.GetType() == TypeString)
type = GetParticleType(((StringType)createType).Value());
else
throw GeneralException("Invalid type");
if(type == -1)
throw GeneralException("Invalid particle type");
ui::Point tempPoint = position.Value();
if(tempPoint.X<0 || tempPoint.Y<0 || tempPoint.Y >= YRES || tempPoint.X >= XRES)
throw GeneralException("Invalid position");
int returnValue = sim->create_part(-1, tempPoint.X, tempPoint.Y, type);
return NumberType(returnValue);
}