X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;fp=src%2Fbattle%2FPartyLayout.h;h=b2454f2cba18bcbcd8b8f9588fb8f2c931bf0de8;hb=06cdcf42d8f86955419bcf8ca3457f1d59a14707;hp=1d72aa8ad483bc8fadeafc6cf62a16d41fea5971;hpb=c45562467a2845a9f5b6942e8bf091251f5d16d6;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index 1d72aa8..b2454f2 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -19,37 +19,24 @@ namespace battle { class PartyLayout { public: - PartyLayout() { } + PartyLayout() : positions(0), numPositions(0) { } public: - std::vector >::size_type NumPositions() const { return positions.size(); } - template - void CalculatePositions(U width, U height, std::vector > &dest) const { - dest.clear(); - dest.reserve(positions.size()); - for (std::vector >::const_iterator i(positions.begin()), end(positions.end()); i != end; ++i) { - dest.push_back(geometry::Vector( - i->X() * width / 255, - i->Y() * height / 223 - )); - } - } - template - geometry::Vector CalculatePosition(std::vector >::size_type index, U width, U height) const { - assert(index >= 0 && index < positions.size()); - return geometry::Vector( - positions[index].X() * width / 255, - positions[index].Y() * height / 223 - ); - } + std::vector >::size_type NumPositions() const { return numPositions; } + void CalculatePositions(int width, int height, std::vector > &dest) const; + geometry::Vector CalculatePosition(int index, int width, int height) const; public: - void AddPosition(const geometry::Vector &p) { - positions.push_back(p); + void SetPositions(const geometry::Vector *p, int num) { + positions = p; + numPositions = num; } + static void CreateTypeDescription(); + private: - std::vector > positions; + const geometry::Vector *positions; + int numPositions; };