package szakdolgozat.client;

import java.util.ArrayList;

import szakdolgozat.shared.User;
import szakdolgozat.shared.UserStats;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("Services")
public interface Services extends RemoteService {
	/**
	 * 
	 * @param user
	 * @return A játékos ID-je
	 */
	public int isUserPasswordValid(User user);
	public void logoutUser(User user);
	public boolean registerNewUser(User user);
	public UserStats getUserStats(User user);
	public ArrayList<User> getLoggedInUsersList();
	public ArrayList<UserStats> getLoggedInUsersStats();
	public void sendMessageToGamePartner(User partner, String message);	
	public String proposeGameTo(User from, User to);
	public void replyToProposal(User opponent, boolean answer);
	public void sendMoveToOpponent(User opponent, int row, int col);
	public void gameStarted(User player1, User player2);
	public void gameWonByUser(User user);
	
	static class ServerServiceHolder {
		// This Class Should be Private for singleton holder
		public static ServicesAsync getInstance() {
			return GWT.create(Services.class);
		}
	}
	
}
