X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=f5cd03d924e496ce867a1369c49b1fbfaaec2622;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=d16f2bdd6eb678212b60e1c098cdbdc3b2777f87;hpb=d1df71f636f14fe2cb5b44b173e3d30bdc73521e;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index d16f2bd..f5cd03d 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -1,15 +1,9 @@ -/* - * PartyLayout.h - * - * Created on: Aug 5, 2012 - * Author: holy - */ - #ifndef BATTLE_PARTYLAYOUT_H_ #define BATTLE_PARTYLAYOUT_H_ -#include "../geometry/Point.h" +#include "../geometry/Vector.h" +#include #include #include @@ -17,30 +11,29 @@ namespace battle { class PartyLayout { + public: + static const int TYPE_ID = 203; + 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::Point( - i->X() * width / 255, - i->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::Point &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; };