Closed averbraeck closed 5 months ago
The following code snippet has been added to ApproveRejectStayServlet
when the staying is approved by the facilitator:
if (data.getScenarioParameters().getSatisfactionHouseRatingPerRound() != 0)
{
HousegroupRecord hgr = SqlUtils.readRecordFromId(data, Tables.HOUSEGROUP, transaction.getHousegroupId());
HouseRecord house = SqlUtils.readRecordFromId(data, Tables.HOUSE, hgr.getHouseId());
int phr = prr.getPreferredHouseRating();
int hr = house.getRating();
prr.setSatisfactionHouseRatingDelta(hr - phr);
prr.setPersonalSatisfaction(prr.getPersonalSatisfaction() + hr - phr);
prr.setFinalHousegroupId(hgr.getId());
}
Completed.
See https://github.com/averbraeck/housinggame-common/issues/23. The satisfaction rating for a house below/above the required rating can be applied every round, or one-time only when buying.