X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=1d72aa8ad483bc8fadeafc6cf62a16d41fea5971;hb=520af5a8ef4fdfd4156377d4fccd93eecd450f0f;hp=684413964d096b77b352f5e31840d97acc47c65e;hpb=cded7d136b41e22f363ec702f2288491c0006e3a;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index 6844139..1d72aa8 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -8,7 +8,7 @@ #ifndef BATTLE_PARTYLAYOUT_H_ #define BATTLE_PARTYLAYOUT_H_ -#include "../geometry/Point.h" +#include "../geometry/Vector.h" #include #include @@ -22,34 +22,34 @@ public: PartyLayout() { } public: - std::vector >::size_type NumPositions() const { return positions.size(); } + std::vector >::size_type NumPositions() const { return positions.size(); } template - void CalculatePositions(U width, U height, std::vector > &dest) const { + 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( + 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::Point CalculatePosition(std::vector >::size_type index, U width, U height) const { + geometry::Vector CalculatePosition(std::vector >::size_type index, U width, U height) const { assert(index >= 0 && index < positions.size()); - return geometry::Point( + return geometry::Vector( positions[index].X() * width / 255, positions[index].Y() * height / 223 ); } public: - void AddPosition(const geometry::Point &p) { + void AddPosition(const geometry::Vector &p) { positions.push_back(p); } private: - std::vector > positions; + std::vector > positions; };