示例#1
0
static void		ft_dispatch(t_game *g, int *q, int ret, int y)
{
	int		x;

	while (++y < g->height)
	{
		x = -1;
		ret = 0;
		while (++x < g->width)
		{
			if (q[0] > 0)
				g->map[y][x].linemate += ft_check_ret(g, q, &ret, 0);
			if (q[1] > 0)
				g->map[y][x].deraumere += ft_check_ret(g, q, &ret, 1);
			if (q[2] > 0)
				g->map[y][x].sibur += ft_check_ret(g, q, &ret, 2);
			if (q[3] > 0)
				g->map[y][x].phiras += ft_check_ret(g, q, &ret, 3);
			if (q[4] > 0)
				g->map[y][x].mendiane += ft_check_ret(g, q, &ret, 4);
			if (q[5] > 0)
				g->map[y][x].thystame += ft_check_ret(g, q, &ret, 5);
			if (ret > 0)
				ft_graph_bct(g, 0, x, y);
		}
	}
}
示例#2
0
文件: ft_life.c 项目: mandre42/AIIEEE
static void		ft_drop_all(t_game *g, int num_cli)
{
	int		x;
	int		y;

	x = g->cls[num_cli].x;
	y = g->cls[num_cli].y;
	g->map[y][x].linemate += g->cls[num_cli].resource.linemate;
	g->map[y][x].deraumere += g->cls[num_cli].resource.deraumere;
	g->map[y][x].sibur += g->cls[num_cli].resource.sibur;
	g->map[y][x].mendiane += g->cls[num_cli].resource.mendiane;
	g->map[y][x].phiras += g->cls[num_cli].resource.phiras;
	g->map[y][x].thystame += g->cls[num_cli].resource.thystame;
	ft_graph_bct(g, 0, x, y);
}
示例#3
0
static void		ft_dispatch(t_game *g, int *q, int y)
{
	int		x;

	while (q[0] + q[1] + q[2] + q[3] + q[4] + q[5] > 0)
	{
		x = ft_rand(g->width);
		y = ft_rand(g->height);
		if (q[0] > 0)
			g->map[y][x].linemate += ft_rand_q(q, 0);
		else if (q[1] > 0)
			g->map[y][x].deraumere += ft_rand_q(q, 1);
		else if (q[2] > 0)
			g->map[y][x].sibur += ft_rand_q(q, 2);
		else if (q[3] > 0)
			g->map[y][x].phiras += ft_rand_q(q, 3);
		else if (q[4] > 0)
			g->map[y][x].mendiane += ft_rand_q(q, 4);
		else if (q[5] > 0)
			g->map[y][x].thystame += ft_rand_q(q, 5);
		ft_graph_bct(g, 0, x, y);
	}
}