Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public class User {
  2. protected String username, password;
  3. protected int puntaje, partidas;
  4. public static User current,second;
  5. public static ArrayList<User> Usuarios = new ArrayList<>(); //ArrayList donde estarn los datos de usuario
  6. public static ArrayList<User>ultimas10 = new ArrayList<>();//ArrayList de ultimas 10 partidas
  7.  
  8. public User(String username, String password){
  9. this.username = username;
  10. this.password = password;
  11. puntaje = 0;
  12. partidas = 0;
  13. }
  14.  
  15. public String getUsuario(){
  16. return username;
  17. }
  18.  
  19. public String getContra(){
  20. return password;
  21. }
  22.  
  23. public int getPuntos(){
  24. return puntaje;
  25. }
  26.  
  27. public int getPartidas(){
  28. return partidas;
  29. }
  30.  
  31. public void setPass(String pass){
  32. password = pass;
  33. }
  34.  
  35. public static boolean validarEntrada(String user, String pass){
  36. for( User p: User.Usuarios)
  37. if((user.equals(p.username))&&(pass.equals(p.password))){
  38. current = p;
  39. return true;
  40. }
  41. return false;
  42. }
  43.  
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement