public void postLetter(Inhabitant prmReceiver, Letter prmLetter) { hisCity.sendLetter(prmLetter); this.getBankAccount().setDebit(prmLetter.getPrice()); Console.WriteLine("-> inhabitant-" + this.number + " mails " + prmLetter.putContent() + " to inhabitant-" + prmReceiver.number + " for a cost of " + prmLetter.getPrice() + " euros"); Console.WriteLine(" - " + prmLetter.getPrice() + " euros are debited from inhabitant-" + this.number + " account whose balance is now " + this.getBankAccount().getAmount() + " euros"); }
public void createUrgentLetter(Inhabitant prmReceiver, Letter prmLetter) { Letter objUrgentLetter = new UrgentLetter(new Sender(this), new Receiver(prmReceiver), prmLetter); this.postLetter(prmReceiver, objUrgentLetter); }
public void createSimpleLetter(Inhabitant prmReceiver, String prmContent) { Letter objLetterTemp = new SimpleLetter(new Sender(this), new Receiver(prmReceiver), prmContent); this.postLetter(prmReceiver, objLetterTemp); }
public void createThanksLetter(Inhabitant prmReceiver, string prmMessage) { Letter objThanksLetter = new ThanksLetter(new Sender(this), new Receiver(prmReceiver), prmMessage); this.postLetter(prmReceiver, objThanksLetter); }
public void createRegisteredLetter(Inhabitant prmReceiver, Letter prmLetter) { Letter objRegisteredLetter = new RegisteredLetter(new Sender(this), new Receiver(prmReceiver), prmLetter); this.postLetter(prmReceiver, objRegisteredLetter); }
public void createPromissoryNote(Inhabitant prmReceiver, int prmNote) { Letter objPromissoryNote = new PromissoryNote(new Sender(this), new Receiver(prmReceiver), prmNote); this.postLetter(prmReceiver, objPromissoryNote); }
public void createAcknowledgment(Inhabitant prmReceiver, string prmMessage) { Letter objAcknowledgment = new Acknowledgment(new Sender(this), new Receiver(prmReceiver), prmMessage); this.postLetter(prmReceiver, objAcknowledgment); }
public Receiver(Inhabitant prmInhabitant) { objInhabitant = prmInhabitant; }
public Sender(Inhabitant prmInhabitant) { objInhabitant = prmInhabitant; }