#ifndef BATTLE_PARTYLAYOUT_H_
#define BATTLE_PARTYLAYOUT_H_
-#include "../geometry/Point.h"
+#include "../geometry/Vector.h"
+#include <cassert>
#include <vector>
#include <SDL.h>
class PartyLayout {
+ public:
+ static const int TYPE_ID = 203;
+
public:
- PartyLayout() { }
+ PartyLayout() : positions(0), numPositions(0) { }
public:
- int NumPositions() const { return positions.size(); }
- template<class U>
- void CalculatePositions(U width, U height, std::vector<geometry::Point<U> > &dest) const {
- dest.clear();
- dest.reserve(positions.size());
- for (std::vector<geometry::Point<Uint8> >::const_iterator i(positions.begin()), end(positions.end()); i != end; ++i) {
- dest.push_back(geometry::Point<U>(
- i->X() * 256 / width,
- i->Y() * 256 / height
- ));
- }
- }
+ std::vector<geometry::Vector<int> >::size_type NumPositions() const { return numPositions; }
+ void CalculatePositions(int width, int height, std::vector<geometry::Vector<int> > &dest) const;
+ geometry::Vector<int> CalculatePosition(int index, int width, int height) const;
public:
- void AddPosition(const geometry::Point<Uint8> &p) {
- positions.push_back(p);
+ void SetPositions(const geometry::Vector<int> *p, int num) {
+ positions = p;
+ numPositions = num;
}
+ static void CreateTypeDescription();
+ static void Construct(void *);
+
private:
- std::vector<geometry::Point<Uint8> > positions;
+ const geometry::Vector<int> *positions;
+ int numPositions;
};