void Honor_Arena_Manager::check_fight_teams(const Time_Value& now){
	int now_sec = now.sec();
	std::vector<Honor_Arena_Match_Team>::iterator it;
	for(it = fight_teams_.begin(); it != fight_teams_.end();){
		if(now_sec > it->fight_time){
			if(start_fight(it->role_id_1, it->role_id_2) == 0){

			}else{

			}
			it = fight_teams_.erase(it);
		}else{
			++it;
		}
	}
}
Example #2
0
int				main(int argc, char **argv)
{
	t_arena	*arena;

	arena = create_arena();
	check_param(&argc, &argv, arena);
	save_players(argc, argv, arena);
	load_players(arena);
	if (arena->display != NULL)
		init_display(arena);
	else
		display_champions(arena);
	start_fight(arena);
	if (arena->cycle != arena->dump_cycle)
	{
		if (arena->display != NULL && !arena->display->quitting)
			print_winner_display(arena);
		else
			print_winner(arena);
	}
	destroy_arena(arena);
	return (0);
}
Example #3
0
// make the two Warriors ``self'' and ``other'' fight until one of the die
void fight(Warrior& self, Warrior& other)
{
    std::thread foe(start_fight, std::ref(other), std::ref(self));
    start_fight(std::ref(self), std::ref(other));
    foe.join();
}