3 #include "weaponitem.h"
5 Mapa::Mapa(std::string name
, Game
* g
) {
8 loader
.load(name
,this);
12 std::list
<Platform
*>::iterator it
;
13 for (it
= platforms
.begin(); it
!= platforms
.end(); it
++)
15 game
->removePlatforms();
18 void Mapa::setTamanho(double width
, double height
) {
23 void Mapa::setSpawn(Ponto spawn
) {
24 game
->setSpawn(spawn
);
27 void Mapa::novaPlataforma(double xmin
, double ymin
, double xmax
, double ymax
, bool pass
, double r
, double g
, double b
) {
28 Linha
l(xmin
, ymin
, xmax
, ymax
);
29 Platform
*plat
= new Platform(l
, pass
, r
, g
, b
);
30 platforms
.push_front(plat
);
31 game
->addPlatform(plat
);
34 void Mapa::dropWeapon(std::string name
, Ponto p
) {
35 WeaponItem
*a
= game
->dropWeapon(name
);
36 a
->setPosition(p
.x
, p
.y
);
40 void Mapa::desenha() {
41 std::list
<Platform
*>::iterator itP
;
42 for (itP
= platforms
.begin(); itP
!= platforms
.end(); itP
++)
44 std::list
<WeaponItem
*>::iterator itW
;
45 for (itW
= items
.begin(); itW
!= items
.end(); itW
++)
58 std::list
<WeaponItem
*>::iterator it
;
59 for (it
= items
.begin(); it
!= items
.end(); it
++)