Package gotnames.dm

Examples of gotnames.dm.Guess


       
        new KTrans.Void(pm) {
          @Override protected void run() {
            Query query = pm.newQuery(Guess.class);
            query.setFilter(String.format("userKey == %s && correctUser == %s", user.getKey(), correctUserKey));
            Guess guess = CollUtils.getOneOrNull(Utils.<Collection<Guess>>cast(query.execute()));
            if (guess == null) {
              guess = new Guess();
              guess.setUserKey(user.getKey());
              guess.setCorrectUser(correctUserKey);
            } else {
              if (!Guess.guessAllowed(now, guess))
                throw new IllegalStateException("Error, user " + user.getFullName() + " is not currently allowed to guess on " + correctUser.getFullName());
            }
           
            guess.registerGuess(now, correctGuess);
           
            pm.makePersistent(guess);
          }
        }.go();
        new KTrans.Void(pm) {
View Full Code Here


        // Remove users without profile picture
        if (!u.isProfilePicture())
          return false;
       
        // Remove any users which have been guessed 'recently'
        Guess guess = guessByCorrectUser.get(u.getKey());
        if (guess != null && !Guess.guessAllowed(now, guess))
          return false;
       
        return true;
      }
View Full Code Here

TOP

Related Classes of gotnames.dm.Guess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.