From: Daniel Karbach Date: Thu, 29 Nov 2012 14:24:28 +0000 (+0100) Subject: made vector components writable X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=c806ec0b9fde2cd3e8313b4a2c38e62a0ff14365;p=l2e.git made vector components writable --- diff --git a/src/geometry/Vector.h b/src/geometry/Vector.h index ebff4b3..c0b22e5 100644 --- a/src/geometry/Vector.h +++ b/src/geometry/Vector.h @@ -31,6 +31,9 @@ public: Scalar X() const { return x; } Scalar Y() const { return y; } + Scalar &X() { return x; } + Scalar &Y() { return y; } + Scalar Index(Scalar lineLength) const { return Y() * lineLength + X(); } static Vector FromIndex(Scalar index, Scalar lineLength) { return Vector(index % lineLength, index / lineLength);