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]; }
// 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; }
math::Vector3& BoundingBox::operator[](int i){ if(i<0 || i>1) throw BadIndexException("Bad index while getting BoundingBox's Vector3!"); return position[i]; }
word MS3DGroup::operator[](int i){ if(i<0 || i>=numTriangles) throw BadIndexException("Bad triangle index at MS3DGroup!"); return triangleIndices[i]; }