diff options
Diffstat (limited to 'world.cpp')
-rw-r--r-- | world.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -234,6 +234,14 @@ Robot& World::create(const Team *team,int iset,int nbanks,bool mobile){ y=rand()%SIZE; if(!board[y][x])break; } + + return create(team, iset, nbanks, mobile, x, y); +} + +Robot& World::create(const Team *team,int iset,int nbanks,bool mobile,int x,int y){ + x = (x%SIZE + SIZE)%SIZE; // Negative values are wrapped + y = (y%SIZE + SIZE)%SIZE; + assert(!board[y][x]); board[y][x]=new Robot(); board[y][x]->team=team; board[y][x]->banks.resize(nbanks); |