mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-25 23:49:03 +00:00
fixing compil but linkage issues
This commit is contained in:
@@ -227,7 +227,7 @@ namespace BBM {
|
||||
for (int j = 0; j < Runner::mapHeight; j++)
|
||||
map[std::make_tuple(i, 0, j)] = MapGenerator::NOTHING;
|
||||
auto childNode = node.getChildNodes("blocks").at(0).getChildNodes();
|
||||
for (auto child : childNode)
|
||||
for (const auto& child : childNode)
|
||||
_loadBlock(scene, child, map);
|
||||
MapGenerator::loadMap(Runner::mapWidth, Runner::mapHeight, map, scene);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ namespace BBM {
|
||||
_loadPlayers(gameScene, playerInfos);
|
||||
}
|
||||
|
||||
Vector3f ParserYAML::_parsePosition(std::string line)
|
||||
Vector3f ParserYAML::_parsePosition(const std::string& line)
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace BBM {
|
||||
static float _parseSpeed(const std::string& line);
|
||||
//!@param line to parse
|
||||
//!@brief return vector3f of position parsed
|
||||
static Vector3f _parsePosition(std::string line);
|
||||
static Vector3f _parsePosition(const std::string& line);
|
||||
//!@param blockType to parse
|
||||
//!@brief return BlockType of type parsed
|
||||
static MapGenerator::BlockType _parseBlockType(const std::string& blockType);
|
||||
@@ -106,19 +106,18 @@ namespace BBM {
|
||||
|
||||
static Node parseFile(const std::string &path);
|
||||
|
||||
|
||||
struct PlayerInfos {
|
||||
std::string playerName;
|
||||
std::string name;
|
||||
//! @brief Player position
|
||||
Vector3f playerPosition;
|
||||
Vector3f position;
|
||||
//! @brief The amount of bomb a player had
|
||||
int playerBombCount;
|
||||
int maxBombCount;
|
||||
//! @brief The explosion range of a player
|
||||
int playerExplosionRange;
|
||||
int explosionRange;
|
||||
//! @brief The speed of a player
|
||||
float playerSpeed;
|
||||
float speed;
|
||||
//! @brief The assets of the player
|
||||
std::string playerAssets;
|
||||
std::string asset;
|
||||
};
|
||||
|
||||
static std::vector<PlayerInfos> playersInfos;
|
||||
|
||||
@@ -300,18 +300,18 @@ namespace BBM
|
||||
std::cout << i << std::endl;
|
||||
i++;
|
||||
auto &player = Runner::createPlayer(*scene);
|
||||
player.setName(ParserYAML::playerName[countPlayer]);
|
||||
player.setName(ParserYAML::playersInfos[countPlayer].name);
|
||||
auto *position = player.tryGetComponent<PositionComponent>();
|
||||
auto *bombHolder = player.tryGetComponent<BombHolderComponent>();
|
||||
auto *model = player.tryGetComponent<Drawable3DComponent>();
|
||||
auto *controllable = player.tryGetComponent<ControllableComponent>();
|
||||
if (position && bombHolder && model && controllable) {
|
||||
dynamic_cast<RAY3D::Model *>(model->drawable.get())->setTextureToMaterial(MAP_DIFFUSE,
|
||||
ParserYAML::playerAssets[countPlayer]);
|
||||
position->position = ParserYAML::playerPosition[countPlayer];
|
||||
bombHolder->explosionRadius = ParserYAML::playerExplosionRange[countPlayer];
|
||||
bombHolder->maxBombCount = ParserYAML::playerBombCount[countPlayer];
|
||||
controllable->speed = ParserYAML::playerSpeed[countPlayer];
|
||||
ParserYAML::playersInfos[countPlayer].asset);
|
||||
position->position = ParserYAML::playersInfos[countPlayer].position;
|
||||
bombHolder->explosionRadius = ParserYAML::playersInfos[countPlayer].explosionRange;
|
||||
bombHolder->maxBombCount = ParserYAML::playersInfos[countPlayer].maxBombCount;
|
||||
controllable->speed = ParserYAML::playersInfos[countPlayer].speed;
|
||||
}
|
||||
addController(player, lobby.layout);
|
||||
countPlayer++;
|
||||
|
||||
Reference in New Issue
Block a user