コード例 #1
0
ファイル: math_lib.cpp プロジェクト: Mateus-mc2/Projeto-AM
double& Matrix::At(const uint32_t &i, const uint32_t &j) {
  if (i >= this->rows_ || j >= this->cols_) {
    throw BadIndexException("Index out of bounds.");
  }

  return this->data_[i][j];
}
コード例 #2
0
ファイル: ListPiece.cpp プロジェクト: StraToN/stratego
// retourne la piece situee a l'index donne
Piece* ListPiece::get(int index){
    if ((index<0)||(index>=this->size())){
        // index hors des limites de la liste
        throw BadIndexException();
    }
    // placement de l'iterateur sur le premier element
    list<Piece*>::const_iterator ci=this->pieces->begin();
    for (int i=0;i<index;i++){
        ci++;
    }
    return *ci;
}
コード例 #3
0
ファイル: BoundingBox.cpp プロジェクト: koosk/siege
		math::Vector3& BoundingBox::operator[](int i){
			if(i<0 || i>1)
				throw BadIndexException("Bad index while getting BoundingBox's Vector3!");
			return position[i];
		}
コード例 #4
0
ファイル: MS3DStruct.cpp プロジェクト: koosk/siege
		word MS3DGroup::operator[](int i){
			if(i<0 || i>=numTriangles)
				throw BadIndexException("Bad triangle index at MS3DGroup!");
			return triangleIndices[i];
		}