Exemple #1
0
static bool
up_down(t_cli *c)
{
  t_hash        *tile;
  int64_t       x;
  int64_t       y;
  int64_t       real_x;
  int64_t       real_y;
  int           nb_players;
  int           i;

  for (y = 0; y <= c->level; ++y)
    {
      for (x = -y; x <= y; ++x)
        {
          real_x = ((c->x_pos + (x * g_coef[c->direction].x)));
          real_y = ((c->y_pos + (y * g_coef[c->direction].y)));
          tile = t_map_at(&c->servptr->map, (t_coord){real_x, real_y});
          ERR("x:%ld ; y:%ld\n", real_x, real_y);
          nb_players = count_players_on_tile(c, (t_coord){real_x, real_y});
          for (i = 0; i < nb_players; ++i)
            print_str_to_buffer(&" joueur"[0/* (i > 0) ? 0 : 1 */]);
          ht_foreach(tile, &ht_callback_print_rsrc);
          print_str_to_buffer(((y == c->level && x == y)) ? "" : ",");
        }
    }
  return (true);
}
void copy_message_map(MessageMap* _src, MessageMap* _tgt) {
	memcpy(_tgt->fast_table, _src->fast_table, sizeof(_src->fast_table));
	_tempMsgMap = _tgt;
	ht_foreach(_src->proc_map, _copy_message_map);
	_tempMsgMap = 0;
}