summaryrefslogtreecommitdiff
path: root/src/game-server/testing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/testing.cpp')
-rw-r--r--src/game-server/testing.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/game-server/testing.cpp b/src/game-server/testing.cpp
index cd2f08fb..495b3617 100644
--- a/src/game-server/testing.cpp
+++ b/src/game-server/testing.cpp
@@ -6,48 +6,50 @@
#include "defines.h"
#include "game-server/itemmanager.hpp"
+#include "game-server/mapcomposite.hpp"
+#include "game-server/mapmanager.hpp"
#include "game-server/spawnarea.hpp"
#include "game-server/state.hpp"
#include "game-server/trigger.hpp"
-static Rectangle rectA = { 56 * 32, 12 * 32, 5 * 32, 32 };
-static WarpAction warpA(3, 44 * 32 + 16, 80 * 32 + 16);
-static Rectangle rectB = { 42 * 32, 88 * 32, 5 * 32, 32 };
-static WarpAction warpB(1, 58 * 32 + 16, 17 * 32 + 16);
-
-static void dropItem(int map, int x, int y, int type)
+static void dropItem(MapComposite *map, int x, int y, int type)
{
ItemClass *ic = itemManager->getItem(type);
assert(ic);
Item *i = new Item(ic, 1);
- i->setMapId(map);
+ i->setMap(map);
Point pos(x, y);
i->setPosition(pos);
gameState->insert(i);
}
-void testingMap(int id)
+void testingMap(MapComposite *map)
{
- switch (id)
+ static Rectangle rectA = { 56 * 32, 12 * 32, 5 * 32, 32 };
+ static WarpAction warpA(mapManager->getMap(3), 44 * 32 + 16, 80 * 32 + 16);
+ static Rectangle rectB = { 42 * 32, 88 * 32, 5 * 32, 32 };
+ static WarpAction warpB(mapManager->getMap(1), 58 * 32 + 16, 17 * 32 + 16);
+
+ switch (map->getID())
{
case 1:
{
// Create maggot spawn area
Rectangle maggotSpawnRect = { 720, 900, 320, 320 };
- gameState->insert(new SpawnArea(1, maggotSpawnRect));
+ gameState->insert(new SpawnArea(map, maggotSpawnRect));
// Portal to map 3
- gameState->insert(new TriggerArea(1, rectA, &warpA));
+ gameState->insert(new TriggerArea(map, rectA, &warpA));
// Drop some items
- dropItem(1, 58 * 32 + 16, 20 * 32 + 16, 508);
- dropItem(1, 58 * 32 + 16, 21 * 32 + 16, 524);
+ dropItem(map, 58 * 32 + 16, 20 * 32 + 16, 508);
+ dropItem(map, 58 * 32 + 16, 21 * 32 + 16, 524);
} break;
case 3:
{
// Portal to map 1
- gameState->insert(new TriggerArea(3, rectB, &warpB));
+ gameState->insert(new TriggerArea(map, rectB, &warpB));
} break;
}
}