]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/PartyLayout.h
removed useless comments
[l2e.git] / src / battle / PartyLayout.h
index 1d72aa8ad483bc8fadeafc6cf62a16d41fea5971..e1fa6d9510c68ea70e2e28c087554fce94973e73 100644 (file)
@@ -1,14 +1,7 @@
-/*
- * PartyLayout.h
- *
- *  Created on: Aug 5, 2012
- *      Author: holy
- */
-
 #ifndef BATTLE_PARTYLAYOUT_H_
 #define BATTLE_PARTYLAYOUT_H_
 
-#include "../geometry/Vector.h"
+#include "../math/Vector.h"
 
 #include <cassert>
 #include <vector>
@@ -18,41 +11,32 @@ namespace battle {
 
 class PartyLayout {
 
+       public:
+               static const int TYPE_ID = 203;
+
 public:
-       PartyLayout() { }
+       PartyLayout() : positions(0), numPositions(0) { }
 
 public:
-       std::vector<geometry::Vector<Uint8> >::size_type NumPositions() const { return positions.size(); }
-       template<class U>
-       void CalculatePositions(U width, U height, std::vector<geometry::Vector<U> > &dest) const {
-               dest.clear();
-               dest.reserve(positions.size());
-               for (std::vector<geometry::Vector<Uint8> >::const_iterator i(positions.begin()), end(positions.end()); i != end; ++i) {
-                       dest.push_back(geometry::Vector<U>(
-                                       i->X() * width / 255,
-                                       i->Y() * height / 223
-                                       ));
-               }
-       }
-       template<class U>
-       geometry::Vector<U> CalculatePosition(std::vector<geometry::Vector<Uint8> >::size_type index, U width, U height) const {
-               assert(index >= 0 && index < positions.size());
-               return geometry::Vector<U>(
-                               positions[index].X() * width / 255,
-                               positions[index].Y() * height / 223
-                               );
-       }
+       std::vector<math::Vector<int> >::size_type NumPositions() const { return numPositions; }
+       void CalculatePositions(int width, int height, std::vector<math::Vector<int> > &dest) const;
+       math::Vector<int> CalculatePosition(int index, int width, int height) const;
 
 public:
-       void AddPosition(const geometry::Vector<Uint8> &p) {
-               positions.push_back(p);
+       void SetPositions(const math::Vector<int> *p, int num) {
+               positions = p;
+               numPositions = num;
        }
 
+       static void CreateTypeDescription();
+       static void Construct(void *);
+
 private:
-       std::vector<geometry::Vector<Uint8> > positions;
+       const math::Vector<int> *positions;
+       int numPositions;
 
 };
 
 }
 
-#endif /* BATTLE_PARTYLAYOUT_H_ */
+#endif