void MapCollision::setmap(const Map_Layer& _colmap, unsigned short w, unsigned short h) { clearmap(); colmap.resize(w); for (unsigned i=0; i<w; ++i) { colmap[i].resize(h); } for (unsigned i=0; i<w; i++) for (unsigned j=0; j<h; j++) colmap[i][j] = _colmap[i][j]; map_size.x = w; map_size.y = h; }
void close_connection(t_env *env, t_play *p) { while (env->init && search_team(env)) { sem_rel(env); sem_wait(env); sem_block(env); } if (env->init) { clearmap(env); exit(0); } env->map[return_pose(env, p->init.x, p->init.y)] = 0; shmdt (env->mem); }
MapCollision::~MapCollision() { clearmap(); }