Beispiel #1
0
        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");
        }
Beispiel #2
0
 public void createUrgentLetter(Inhabitant prmReceiver, Letter prmLetter)
 {
     Letter objUrgentLetter = new UrgentLetter(new Sender(this), new Receiver(prmReceiver), prmLetter);
     this.postLetter(prmReceiver, objUrgentLetter);
 }
Beispiel #3
0
 public void createSimpleLetter(Inhabitant prmReceiver, String prmContent)
 {
     Letter objLetterTemp = new SimpleLetter(new Sender(this), new Receiver(prmReceiver), prmContent);
     this.postLetter(prmReceiver, objLetterTemp);
 }
Beispiel #4
0
 public void createThanksLetter(Inhabitant prmReceiver, string prmMessage)
 {
     Letter objThanksLetter = new ThanksLetter(new Sender(this), new Receiver(prmReceiver), prmMessage);
     this.postLetter(prmReceiver, objThanksLetter);
 }
Beispiel #5
0
 public void createRegisteredLetter(Inhabitant prmReceiver, Letter prmLetter)
 {
     Letter objRegisteredLetter = new RegisteredLetter(new Sender(this), new Receiver(prmReceiver), prmLetter);
     this.postLetter(prmReceiver, objRegisteredLetter);
 }
Beispiel #6
0
 public void createPromissoryNote(Inhabitant prmReceiver, int prmNote)
 {
     Letter objPromissoryNote = new PromissoryNote(new Sender(this), new Receiver(prmReceiver), prmNote);
     this.postLetter(prmReceiver, objPromissoryNote);
 }
Beispiel #7
0
 public void createAcknowledgment(Inhabitant prmReceiver, string prmMessage)
 {
     Letter objAcknowledgment = new Acknowledgment(new Sender(this), new Receiver(prmReceiver), prmMessage);
     this.postLetter(prmReceiver, objAcknowledgment);
 }
Beispiel #8
0
 public Receiver(Inhabitant prmInhabitant)
 {
     objInhabitant = prmInhabitant;
 }
Beispiel #9
0
 public Sender(Inhabitant prmInhabitant)
 {
     objInhabitant = prmInhabitant;
 }