Пример #1
0
static void		notify_bot_for_connected_gfx(t_env *e, int fd, t_team *t)
{
	t_iterator		iter_b;
	t_bot			*b;

	iter_b = NULL;
	while ((b = (t_bot *)ft_lst_iter_next_content(t->connected, &iter_b)))
	{
		pnw(e, fd, b);
		if (b->life_unit <= 0)
			pdi(e, fd, b);
	}
	iter_b = NULL;
	while ((b = (t_bot *)ft_lst_iter_next_content(t->queue, &iter_b)))
	{
		pnw(e, fd, b);
		if (b->life_unit <= 0)
			pdi(e, fd, b);
	}
	iter_b = NULL;
	while ((b = (t_bot *)ft_lst_iter_next_content(t->egg, &iter_b)))
	{
		enw(e, fd, b->parent, b);
		if (b->life_unit <= 0)
			edi(e, fd, b);
	}
}
Пример #2
0
void		monitor_graphic(t_graphic mn, t_data_serv ds, t_player p)
{
  t_iter	*it;
  t_iter	*it2;
  t_map		map;

  map = get_map(NULL);
  msz(mn, map->size_x, map->size_y);
  sgt(mn, ds->t);
  bct_all(mn, map);
  tna(mn, ds->teams);
  it = ds->player->head;
  while (it)
    {
      if ((*(t_player*)it->data)->welcome)
	  pnw(mn, (*(t_player*)it->data));
      it = it->next;
    }
  it2 = ds->egg->head;
  while (it2)
    {
      enw(mn, ((t_egg)it2->data)->id,
	  p->lvl, &((t_egg)it2->data)->fetus->pos);
      it2 = it2->next;
    }
}
Пример #3
0
void		gfx_player_join(t_ctrl *c, t_player *p)
{
  t_jm_list	*l;

  l = c->l;
  while (l)
    {
      if (l->fd != -1 && l->data && ((t_handler *)l->data)->t == GFX)
	pnw(l, p);
      l = l->next;
    }
}
Пример #4
0
void		send_pnw_player(t_env *env)
{
  int		i;
  t_client	*client;

  i = 0;
  while (env->nb_team > i)
    {
      client = env->teams[i].clients.next;
      while (client->root != 1)
        {
          if (client->role == IA)
            pnw(env, client);
          client = client->next;
        }
      ++i;
    }
}