本文整理汇总了C++中SetCount函数的典型用法代码示例。如果您正苦于以下问题:C++ SetCount函数的具体用法?C++ SetCount怎么用?C++ SetCount使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetCount函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetCount
bool MQuestItem::Create( const unsigned long int nItemID, const int nCount, MQuestItemDesc* pDesc, bool bKnown )
{
m_nItemID = nItemID;
m_pDesc = pDesc;
return SetCount( nCount, bKnown );
}
示例2: fFirstline
scContUnit::scContUnit( TypeSpec& spec,
scContUnit* prevPara,
long count ) :
fFirstline( 0 ),
fParaCount( 0 ),
fSpecRun( spec ),
defspec_( spec )
#ifdef _RUBI_SUPPORT
, fRubiArray( 0 )
#endif
{
#if SCDEBUG > 1
fReformatEvent = 0;
#endif
try {
SetCount( count );
Mark( scRETABULATE );
if ( prevPara )
prevPara->SetNext( this );
SetPrev( prevPara );
}
catch( ... ) {
delete this;
throw;
}
}
示例3: VListWin
PathListWin::PathListWin(Win* parent, PathList& dataList)
: VListWin(Win::WT_CHILD, WH_TABFOCUS | WH_CLICKFOCUS, 0, parent, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0),
m_dataList(dataList)
{
wal::GC gc(this);
gc.Set(GetFont());
cpoint ts = gc.GetTextExtents(ABCString);
const int fontH = ts.y + 2;
this->SetItemSize((fontH > 16 ? fontH : 16) + 1, 100);
LSize ls;
ls.x.maximal = 10000;
ls.x.ideal = 1000;
ls.x.minimal = 600;
ls.y.maximal = 10000;
ls.y.ideal = 600;
ls.y.minimal = 400;
SetLSize(ls);
if (m_dataList.GetCount() > 0)
{
SetCount(m_dataList.GetCount());
SetCurrent(0);
}
}
示例4: node
void TextList::Append( const unicode_t* txt, int i, void* p )
{
TLNode node( txt, i, p );
list.append( node );
valid = false;
SetCount( list.count() );
}
示例5: SetCapacity
bool ON_Polyline::CreateStarPolygon(
const ON_Circle& circle,
double other_radius,
int side_count
)
{
bool rc = ( circle.IsValid() && side_count >= 3 && other_radius >= 0.0 )
? true
: false;
if ( rc )
{
SetCapacity(2*side_count+1);
SetCount(2*side_count+1);
double half_a = ON_PI/side_count;
int i;
ON_Circle other_circle = circle;
other_circle.radius = other_radius;
for ( i = 0; i < side_count; i++ )
{
m_a[i*2] = circle.PointAt(half_a*2*i);
m_a[i*2+1] = other_circle.PointAt(half_a*(1+2*i));
}
m_a[side_count*2] = m_a[0];
}
else
Destroy();
return rc;
}
示例6: SetCount
CDataFactory::LPDATAITEM CDataFactory::_AddNew()
{
if(m_dwCountOfDataItems == 0 || m_lpDataItems == NULL)
{
// 如果当前数据为空,则初始化一个新的。
SetCount(1000);
m_dwCurUsedDataItemCount = 1;
return &m_lpDataItems[0];
}
// 当前数据不为空,在后面添加
m_dwCurUsedDataItemCount ++;
if(m_dwCurUsedDataItemCount <= m_dwCountOfDataItems)
{
return &m_lpDataItems[m_dwCurUsedDataItemCount - 1];
}
else
{
LPDATAITEM pNewDataItem = new DATAITEM;
if(pNewDataItem == NULL)
{
m_dwCurUsedDataItemCount --;
ASSERT(FALSE);
return NULL;
}
m_cExtDataItemArray.Add((DWORD)pNewDataItem);
return pNewDataItem;
}
}
示例7: Plant
void Plantable::Plant(ItemPtr sourceItem)
{
auto x = Player::Get().GetPositionX();
auto y = Player::Get().GetPositionY();
auto currentLandmark = GameState::Get().GetCurrentLandmark();
auto currentTile = currentLandmark->GetTile(x, y);
if (currentTile.TileType != TileType::Tilled) {
GameState::Get().AddLogMessage("You can only plant on tilled land!");
return;
}
auto item = currentLandmark->GetItem(x, y);
if (item != nullptr) {
GameState::Get().AddLogMessageFmt("Cannot plant, %s is on the ground here.", item->GetName().c_str());
return;
}
auto crop = GameState::Get().GetItemFromItemDatabase(this->Crop);
crop->SetCount(1);
currentLandmark->AddItem(x, y, crop);
auto growableInterface = crop->GetInterface<Growable>(ItemInterfaceType::Growable);
if (growableInterface != nullptr) {
growableInterface->StartGrowing(crop);
}
sourceItem->RemoveOne();
}
示例8: SetQuestion
void CWndGuildVote::SelChange(CGuild* pGuild, int nIndex)
{
GUILD_VOTE_SELECT guildvotesel[4];
CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
list <CGuildVote*>::iterator it = pGuild->m_votes.begin();
for ( ; it != pGuild->m_votes.end() ; ++it )
{
if( (*it)->GetID() == pCombo->GetItemData(nIndex) )
{
guildvotesel[0] = (*it)->GetVoteSelect(0);
guildvotesel[1] = (*it)->GetVoteSelect(1);
guildvotesel[2] = (*it)->GetVoteSelect(2);
guildvotesel[3] = (*it)->GetVoteSelect(3);
SetQuestion( (*it)->GetQuestion() );
break;
}
}
SetszString( guildvotesel[0].szString, guildvotesel[1].szString, guildvotesel[2].szString, guildvotesel[3].szString );
SetCount( guildvotesel[0].cbCount, guildvotesel[1].cbCount, guildvotesel[2].cbCount, guildvotesel[3].cbCount );
}
示例9: SetValue
bool SetValue(const void *src_ptr, std::size_t src_count)
{
bool ptr_changed_flag = SetCount(src_count, false);
memcpy(buffer_sptr_.get(), src_ptr, src_count);
return(ptr_changed_flag);
}
示例10: SetCount
__fastcall TPolyline::TPolyline(TPolyline *Poly,__int32 id)
{
FId=id;
FCount=FCapacity=0;
FPoints=NULL;
SetCount(Poly->Count);
for (int i=0;i<FCount;i++)
FPoints[i]=(*Poly)[i];
}
示例11: Count
void VectorBase::Erase( char* address, SizeType elementSize )
{
char* startAddress = address + elementSize;
const char* endAddress = reinterpret_cast< char* >( mData ) + Count() * elementSize;
SizeType numberOfBytes = endAddress - startAddress;
// addresses overlap so use memmove
memmove( address, startAddress, numberOfBytes );
SetCount( Count() - 1 );
}
示例12: MP4Property
MP4BytesProperty::MP4BytesProperty(char* name, u_int32_t valueSize,
u_int32_t defaultValueSize)
: MP4Property(name)
{
SetCount(1);
m_values[0] = (u_int8_t*)MP4Calloc(valueSize);
m_valueSizes[0] = valueSize;
m_fixedValueSize = 0;
m_defaultValueSize = defaultValueSize;
}
示例13: SetCount
HsvFeatures::HsvFeatures(const Config &conf)
{
int num_bins = kNumH * kNumS + kNumV;
SetCount(num_bins);
std::cout<< "hsv histogram bins: "<< GetCount() << std::endl;
m_h_step = 180.0 / kNumH;
m_s_step = 256.0 / kNumS;
m_v_step = 256.0 / kNumV;
}
示例14: SetCount
flag CActuator::ValidateData(ValidateDataBlk & VDB)
{
if (m_DataBlk.GetSize()<1)
SetCount(1);
if (SortRqd())
{
Sort();
FixIOTags();
}
return FlwNode::ValidateData(VDB);
}
示例15: SetCount
////////////////////////////////////////////////////////////////
// どこでもLOAD
////////////////////////////////////////////////////////////////
bool cP6T::DokoLoad( cIni *Ini )
{
int st;
if( !Ini ) return false;
Ini->GetInt( "P6T", "Counter", &st, 0 );
SetCount( st );
Ini->GetInt( "P6T", "swait", &swait, swait );
Ini->GetInt( "P6T", "pwait", &pwait, pwait );
return true;
}