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