Ok, now we're ready for this change
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@724 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -64,10 +64,10 @@ public class StatRepository extends DepotRepository
|
||||
* Applies a modification to a single stat. If the stat in question does not exist, a blank
|
||||
* instance will be created via {@link Stat.Type#newStat}.
|
||||
*
|
||||
* @return true if the stat was modified and written to the database, false if the modifier had
|
||||
* @return the modified Stat, if any modification took place; or null if the modification had
|
||||
* no effect on the stat's data.
|
||||
*/
|
||||
public <T extends Stat> boolean updateStat (int playerId, StatModifier<T> modifier)
|
||||
public <T extends Stat> T updateStat (int playerId, StatModifier<T> modifier)
|
||||
throws PersistenceException
|
||||
{
|
||||
Where where = new Where(StatRecord.PLAYER_ID_C, playerId,
|
||||
@@ -80,10 +80,10 @@ public class StatRepository extends DepotRepository
|
||||
@SuppressWarnings("unchecked") T tstat = (T)stat;
|
||||
modifier.modify(tstat);
|
||||
if (!tstat.isModified()) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
if (updateStat(playerId, stat, false)) {
|
||||
return true;
|
||||
if (updateStat(playerId, tstat, false)) {
|
||||
return tstat;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user