//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- int CBaseTeamObjectiveResource::GetPreviousPointForPoint( int index, int team, int iPrevIndex ) { AssertValidIndex(index); Assert( iPrevIndex >= 0 && iPrevIndex < MAX_PREVIOUS_POINTS ); int iIntIndex = iPrevIndex + (index * MAX_PREVIOUS_POINTS) + (team * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS); return m_iPreviousPoints[ iIntIndex ]; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetPreviousPoint( int index, int iTeam, int iPrevIndex, int iPrevPoint ) { AssertValidIndex(index); Assert( iPrevIndex >= 0 && iPrevIndex < MAX_PREVIOUS_POINTS ); int iIntIndex = iPrevIndex + (index * MAX_PREVIOUS_POINTS) + (iTeam * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS); m_iPreviousPoints.Set( iIntIndex, iPrevPoint ); }
void MySQLPreparedStatement::setDouble(const uint8 index, const double value) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; setValue(param, MYSQL_TYPE_DOUBLE, &value, sizeof(double), (value > 0.0f)); }
void MySQLPreparedStatement::setFloat(const uint8 index, const float value) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; setValue(param, MYSQL_TYPE_FLOAT, &value, sizeof(float), (value > 0.0f)); }
void MySQLPreparedStatement::setInt64(const uint8 index, const int64 value) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; setValue(param, MYSQL_TYPE_LONGLONG, &value, sizeof(int64), false); }
void MySQLPreparedStatement::setUInt16(const uint8 index, const uint16 value) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(uint16), true); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetOwningTeam( int index, int team ) { AssertValidIndex(index); m_iOwner.Set( index, team ); // clear the capper m_iCappingTeam.Set( index, TEAM_UNASSIGNED ); UpdateCapHudElement(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetTeamInZone( int index, int team ) { AssertValidIndex(index); if ( m_iTeamInZone.Get( index ) != team ) { m_iTeamInZone.Set( index, team ); UpdateCapHudElement(); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCapBlocked( int index, bool bBlocked ) { AssertValidIndex(index); if ( m_bBlocked.Get( index ) != bBlocked ) { m_bBlocked.Set( index, bBlocked ); UpdateCapHudElement(); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCappingTeam( int index, int team ) { AssertValidIndex(index); if ( m_iCappingTeam.Get( index ) != team ) { m_iCappingTeam.Set( index, team ); UpdateCapHudElement(); } }
void MySQLPreparedStatement::setNull(const uint8 index) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; param->buffer_type = MYSQL_TYPE_NULL; delete [] static_cast<char *>(param->buffer); param->buffer = NULL; param->buffer_length = 0; param->is_null_value = 1; delete param->length; param->length = NULL; }
void MySQLPreparedStatement::setBinary(const uint8 index, const std::vector<uint8>& value, bool isString) { AssertValidIndex(index); m_paramsSet[index] = true; MYSQL_BIND* param = &m_bind[index]; uint32 len = uint32(value.size()); param->buffer_type = MYSQL_TYPE_BLOB; delete [] static_cast<char *>(param->buffer); param->buffer = new char[len]; param->buffer_length = len; param->is_null_value = 0; delete param->length; param->length = new unsigned long(len); if (isString) { *param->length -= 1; param->buffer_type = MYSQL_TYPE_VAR_STRING; } memcpy(param->buffer, value.data(), len); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CBaseTeamObjectiveResource::TeamCanCapPoint( int index, int team ) { AssertValidIndex(index); return m_bTeamCanCap[ TEAM_ARRAY( index, team ) ]; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetTeamCanCap( int index, int iTeam, bool bCanCap ) { AssertValidIndex(index); m_bTeamCanCap.Set( TEAM_ARRAY( index, iTeam ), bCanCap ); UpdateCapHudElement(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPCapTimeScalesWithPlayers( int index, bool bScales ) { AssertValidIndex(index); m_bCPCapRateScalesWithPlayers.Set( index, bScales ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPTimerTime( int index, float flTime ) { AssertValidIndex(index); m_flCPTimerTimes.Set( index, flTime ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPVisible( int index, bool bVisible ) { AssertValidIndex(index); m_bCPIsVisible.Set( index, bVisible ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPCapPercentage( int index, float flTime ) { AssertValidIndex(index); m_flCapPercentages[index] = flTime; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPOverlays( int index, int iTeam, int iIcon ) { AssertValidIndex(index); m_iTeamOverlays.Set( TEAM_ARRAY( index, iTeam ), iIcon ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetWarnSound( int index, string_t iszSound ) { AssertValidIndex(index); m_iszWarnSound.Set( index, iszSound ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetWarnOnCap( int index, int iWarnLevel ) { AssertValidIndex(index); m_iWarnOnCap.Set( index, iWarnLevel ); }
//----------------------------------------------------------------------------- // Purpose: Data setting functions //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetNumPlayers( int index, int team, int iNumPlayers ) { AssertValidIndex(index); m_iNumTeamMembers.Set( TEAM_ARRAY( index, team ), iNumPlayers ); UpdateCapHudElement(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- float CBaseTeamObjectiveResource::GetCPCapPercentage( int index ) { AssertValidIndex(index); return m_flCapPercentages[index]; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPGroup( int index, int iCPGroup ) { AssertValidIndex(index); m_iCPGroup.Set( index, iCPGroup ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPPosition( int index, const Vector& vPosition ) { AssertValidIndex(index); m_vCPPositions.Set( index, vPosition ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPRequiredCappers( int index, int iTeam, int iReqPlayers ) { AssertValidIndex(index); m_iTeamReqCappers.Set( TEAM_ARRAY( index, iTeam ), iReqPlayers ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetCPCapTime( int index, int iTeam, float flTime ) { AssertValidIndex(index); m_flTeamCapTime.Set( TEAM_ARRAY( index, iTeam ), flTime ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetTrainPathDistance( int index, float flDistance ) { AssertValidIndex(index); m_flPathDistance.Set( index, flDistance ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseTeamObjectiveResource::SetWarnOnCap( int index, bool bWarn ) { AssertValidIndex(index); m_bWarnOnCap.Set( index, bWarn ); }