本文整理汇总了C++中IRect::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ IRect::Contains方法的具体用法?C++ IRect::Contains怎么用?C++ IRect::Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRect
的用法示例。
在下文中一共展示了IRect::Contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Editor_CaptureGadget
int ChangeEnergySpeed::Editor_CaptureGadget(const IPoint& mouse_pos, int x, int y)
{
// Преобразовываем координаты к координатам на поле
int mx = mouse_pos.x + GameSettings::FieldCoordMouse().x;
int my = mouse_pos.y + GameSettings::FieldCoordMouse().y;
IRect r (mx - (GameSettings::SQUARE_SIDE / 2), my - (GameSettings::SQUARE_SIDE / 2), 0, 0);
r.Inflate((GameSettings::SQUARE_SIDE / 2));
_sliderRect = IRect(_snapPoint.x * GameSettings::SQUARE_SIDE,_snapPoint.y * GameSettings::SQUARE_SIDE - 30,200,30);
if (r.Contains(_snapPoint * GameSettings::SQUARE_SIDE))
{
return (-2);
}
else if (_sliderRect.Contains(IPoint(mx,my)))
{
return (-3);
}
else
{
return (-1);
}
}
示例2: Editor_CopyToClipboard
void SquareNewInfo::Editor_CopyToClipboard(IRect part)
{
Game::FieldAddress offset(part.x, part.y);
_clipboard.clear();
for(std::map<Game::FieldAddress, InfoSquare>::iterator itr = _info.begin(); itr != _info.end(); ++itr)
{
if( part.Contains(itr->first.ToPoint()) )
_clipboard.insert( std::make_pair(itr->first - offset, itr->second) );
}
}
示例3: Editor_ClearFieldPart
void SquareNewInfo::Editor_ClearFieldPart(IRect part)
{
for(std::map<Game::FieldAddress, InfoSquare>::iterator itr = _info.begin(); itr != _info.end(); )
{
if( part.Contains(itr->first.ToPoint()) ) {
itr = _info.erase(itr);
} else {
++itr;
}
}
}
示例4: Editor_CutToClipboard
void LockBarriers::Editor_CutToClipboard(IRect part)
{
_clipboard.clear();
for(Barriers::iterator itr = _barriers.begin(); itr != _barriers.end(); )
{
if( part.Contains((*itr)->GetPos()) ) {
(*itr)->SetPos( (*itr)->GetPos() - part.LeftBottom() );
_clipboard.push_back(*itr);
itr = _barriers.erase(itr);
} else {
++itr;
}
}
}