]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/PartyLayout.h
moved hero position to Hero
[l2e.git] / src / battle / PartyLayout.h
index d16f2bdd6eb678212b60e1c098cdbdc3b2777f87..684413964d096b77b352f5e31840d97acc47c65e 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "../geometry/Point.h"
 
+#include <cassert>
 #include <vector>
 #include <SDL.h>
 
@@ -33,6 +34,14 @@ public:
                                        ));
                }
        }
+       template<class U>
+       geometry::Point<U> CalculatePosition(std::vector<geometry::Point<Uint8> >::size_type index, U width, U height) const {
+               assert(index >= 0 && index < positions.size());
+               return geometry::Point<U>(
+                               positions[index].X() * width / 255,
+                               positions[index].Y() * height / 223
+                               );
+       }
 
 public:
        void AddPosition(const geometry::Point<Uint8> &p) {