Ejemplo n.º 1
0
 // ACTIONS
 private void collectRent(MyTenant mt) {
   if (!test) {
     log("Collecting rent now");
   }
   mt.tenant.msgRentDue(this, mt.rate);
   mt.newPayment = false;
   p.stateChanged();
 }
Ejemplo n.º 2
0
 // MESSAGES
 public void msgCollectRent() {
   log.add(new LoggedEvent("Recieved msgEndOfDay, all tenants now should have rent due"));
   if (!test) {
     log("Time to collect rent from all of my tenants!");
   }
   synchronized (tenants) {
     for (MyTenant t : tenants) {
       t.numOutstandingPayments++;
       t.newPayment = true;
       if (t.numOutstandingPayments > 0) {
         t.paymentsUpToDate = false;
       }
     }
   }
   this.p.stateChanged();
 }