X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=ec12f4dda9764a3859efdef806bf9fdc6da96a28;hb=a3ba4dc677ad7c92eeb78b20b642241563605c9d;hp=684413964d096b77b352f5e31840d97acc47c65e;hpb=cded7d136b41e22f363ec702f2288491c0006e3a;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index 6844139..ec12f4d 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -1,14 +1,7 @@ -/* - * 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 @@ -18,38 +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 - )); - } - } - template - geometry::Point CalculatePosition(std::vector >::size_type index, U width, U height) const { - assert(index >= 0 && index < positions.size()); - return geometry::Point( - 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; + 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; };