mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
map reading improvements
This commit is contained in:
@@ -142,8 +142,7 @@ namespace battleship{
|
||||
void Map::loadSpawnPoints(){
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
string spawnPointInd = "spawnPoints";
|
||||
SOL_LUA_VIEW.script("numSpawnPoints = #" + mapTable + "." + spawnPointInd);
|
||||
int numSpawnPoints = SOL_LUA_VIEW["numSpawnPoints"];
|
||||
int numSpawnPoints = ((sol::table)SOL_LUA_VIEW[mapTable][spawnPointInd]).size();
|
||||
|
||||
for(int i = 0; i < numSpawnPoints; i++){
|
||||
sol::table posTable = SOL_LUA_VIEW[mapTable][spawnPointInd][i + 1];
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace battleship{
|
||||
inline vb01::Vector3 getCellSize(){return CELL_SIZE;}
|
||||
inline int getNumSpawnPoints(){return spawnPoints.size();}
|
||||
inline vb01::Vector3 getSpawnPoint(int i){return spawnPoints[i];}
|
||||
inline vb01::Vector3 getMapSize(){return mapSize;}
|
||||
inline void addSpawnPoint(vb01::Vector3 sp){spawnPoints.push_back(sp);}
|
||||
inline std::vector<Map::Cell>& getCells(){return cells;}
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user