]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
merged Point into Vector
[l2e.git] / src / main.cpp
index cf6e78bbf6c9596235b82ecc5d18001881c68bb6..bebeed106e14bf8520b80b00aa8affaa2b07bc14 100644 (file)
@@ -17,7 +17,6 @@
 #include "common/Inventory.h"
 #include "common/Item.h"
 #include "common/Spell.h"
-#include "geometry/Point.h"
 #include "geometry/Vector.h"
 #include "graphics/ComplexAnimation.h"
 #include "graphics/Font.h"
@@ -30,6 +29,8 @@
 #include "sdl/InitScreen.h"
 #include "sdl/InitSDL.h"
 
+#include <cstdlib>
+#include <ctime>
 #include <exception>
 #include <iostream>
 #include <SDL.h>
@@ -46,7 +47,6 @@ using common::Ikari;
 using common::Inventory;
 using common::Item;
 using common::Spell;
-using geometry::Point;
 using geometry::Vector;
 using graphics::ComplexAnimation;
 using graphics::Font;
@@ -70,6 +70,8 @@ int main(int argc, char **argv) {
 
        const int framerate = 33;
 
+//     std::srand(std::time(0));
+
        try {
                InitSDL sdl;
                InitImage image(IMG_INIT_PNG);
@@ -78,15 +80,15 @@ int main(int argc, char **argv) {
                // temporary test data
                SDL_Surface *bg(IMG_Load("test-data/battle-bg.png"));
                PartyLayout monstersLayout;
-               monstersLayout.AddPosition(Point<Uint8>(88, 88));
-               monstersLayout.AddPosition(Point<Uint8>(128, 88));
-               monstersLayout.AddPosition(Point<Uint8>(168, 88));
-               monstersLayout.AddPosition(Point<Uint8>(208, 88));
+               monstersLayout.AddPosition(Vector<Uint8>(88, 88));
+               monstersLayout.AddPosition(Vector<Uint8>(128, 88));
+               monstersLayout.AddPosition(Vector<Uint8>(168, 88));
+               monstersLayout.AddPosition(Vector<Uint8>(208, 88));
                PartyLayout heroesLayout;
-               heroesLayout.AddPosition(Point<Uint8>(48, 136));
-               heroesLayout.AddPosition(Point<Uint8>(128, 136));
-               heroesLayout.AddPosition(Point<Uint8>(80, 152));
-               heroesLayout.AddPosition(Point<Uint8>(160, 152));
+               heroesLayout.AddPosition(Vector<Uint8>(48, 136));
+               heroesLayout.AddPosition(Vector<Uint8>(128, 136));
+               heroesLayout.AddPosition(Vector<Uint8>(80, 152));
+               heroesLayout.AddPosition(Vector<Uint8>(160, 152));
 
                SDL_Surface *monsterImg(IMG_Load("test-data/monster.png"));
                Sprite monsterSprite(monsterImg, 64, 64);
@@ -481,6 +483,7 @@ int main(int argc, char **argv) {
                Item zircoSword;
                zircoSword.SetName("Zirco sword");
                zircoSword.SetMenuIcon(&swordIcon);
+               zircoSword.GetTargetingMode().TargetSingleEnemy();
                Ikari firestorm;
                firestorm.SetName("Firestorm");
                firestorm.SetCost(224);
@@ -543,6 +546,7 @@ int main(int argc, char **argv) {
                Item zircoWhip;
                zircoWhip.SetName("Zirco whip");
                zircoWhip.SetMenuIcon(&rodIcon);
+               zircoWhip.GetTargetingMode().TargetSingleEnemy();
                Ikari thundershriek;
                thundershriek.SetName("Thundershriek");
                thundershriek.SetCost(224);
@@ -604,6 +608,7 @@ int main(int argc, char **argv) {
                Item zircoAx;
                zircoAx.SetName("Zirco ax");
                zircoAx.SetMenuIcon(&axIcon);
+               zircoAx.GetTargetingMode().TargetSingleEnemy();
                Ikari torrent;
                torrent.SetName("Torrent");
                torrent.SetCost(224);
@@ -648,6 +653,7 @@ int main(int argc, char **argv) {
                Item lizardBlow;
                lizardBlow.SetName("Lizard blow");
                lizardBlow.SetMenuIcon(&swordIcon);
+               lizardBlow.GetTargetingMode().TargetSingleEnemy();
                Ikari dragonRush;
                dragonRush.SetName("Dragon rush");
                dragonRush.SetCost(164);