require "objectteam"
require "observerpattern"
require "library"
require "deploy"



jack = Person.new("jack")
gof = Book.new("Design Pattterns", "GoF", 1234)
etl = Book.new("Eiffel The Language", "BM", 345)
gof1 = BookCopy.new(gof)
gof2 = BookCopy.new(gof)
etl1 = BookCopy.new(etl)
etl2 = BookCopy.new(etl)

gof1.borrow(jack)
etl2.borrow(jack)


manager = BookManager.new()
manager.buy(gof1)
manager.buy(gof2)
manager.buy(etl1)
manager.buy(etl2)

print("\n\n===> bought 4 books, 2 are borrowed\n")
manager.printAll()

print("\n\n===> return gof1, borrow etl1\n")
gof1.returnIt()
etl1.borrow(jack)
manager.printAll()

print("\n\n===> drop borrowed book etl2.\n")
manager.drop(etl2)
etl2.returnIt()
manager.printAll()

print("\n\n===> buy again... (somehow unrealistic :)\n")
manager.buy(etl2)
manager.printAll()

