X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=e4f7d1b706517393bd262bebdeeaa26cd069f7d3;hb=b02da898c7c8a08141df4e797774a61cf5e0163f;hp=1d72aa8ad483bc8fadeafc6cf62a16d41fea5971;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index 1d72aa8..e4f7d1b 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -19,37 +19,25 @@ 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(); + static void Construct(void *); + private: - std::vector > positions; + const geometry::Vector *positions; + int numPositions; };