/**
*
* @author gzy
*
*/
public class UserDaoImpl implements UserDao {
private static User[] users = new User[5];
private static int index = 0;
@Override
public boolean isIogin(String name, String password) {
boolean flag = false;
for (int i = 0; i < users.length; i++) {
if (users[i] != null) {
if (name.equals(users[i].getUsername())
&& password.equals(users[i].getPassword())) {
flag = true;
break;
}
}
}
return flag;
}
@Override
public void register(User user) {
users[index++] = user;
}