X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=e1fa6d9510c68ea70e2e28c087554fce94973e73;hb=4309d259becd96ead792678257e910c03a6b4a3d;hp=d16f2bdd6eb678212b60e1c098cdbdc3b2777f87;hpb=d1df71f636f14fe2cb5b44b173e3d30bdc73521e;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index d16f2bd..e1fa6d9 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 "../math/Vector.h" +#include #include #include @@ -17,33 +11,32 @@ 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; + math::Vector CalculatePosition(int index, int width, int height) const; public: - void AddPosition(const geometry::Point &p) { - positions.push_back(p); + void SetPositions(const math::Vector *p, int num) { + positions = p; + numPositions = num; } + static void CreateTypeDescription(); + static void Construct(void *); + private: - std::vector > positions; + const math::Vector *positions; + int numPositions; }; } -#endif /* BATTLE_PARTYLAYOUT_H_ */ +#endif