#include <cassert>

#include "client/math/MatrixStack.h"

void MatrixStack::pop() {
    assert(index > 0);
    index--;
}

void MatrixStack::push() {
    assert(index < stack.size() - 1);
    index++;
    stack[index] = stack[index - 1];
}

Matrix& MatrixStack::get() {
    return stack[index];
}

void MatrixStack::clear() {
    index = 0;
    stack[0].setToIdentity();
}