import sale.*;
import log.*;
import users.*;
import data.*;
import data.ooimpl.*;
import java.io.*;
import java.util.*;
public class VideoMachine extends Shop
{
private static Set customerSet = new HashSet();
public VideoMachine()
{
super();
String[] videos = {"Video 01", "Video 02", "Video 03", "Video 04",
"Video 05", "Video 06", "Video 07", "Video 08",
"Video 09", "Video 10"};
int[] buy = {5000, 5000, 5000, 5000, 5000, 4000, 4000, 4000, 3000, 3000};
int[] sell = {4000, 4000, 4000, 4000, 3500, 3500, 3500, 3500, 3000, 3000};
Catalog videoCatalog = new CatalogImpl("Video-Catalog");
addCatalog(videoCatalog);
for (int i = 0; i < videos.length; i++) {
videoCatalog.add(new VideoCassette (videos[i], new QuoteValue
(new IntegerValue (buy[i]), new IntegerValue (sell[i]))), null);
}
CountingStock cs = new CountingStockImpl("Video-Countingstock",
(CatalogImpl)videoCatalog);
addStock(cs);
Iterator cassettes = videoCatalog.keySet(null).iterator();
while (cassettes.hasNext()) {
cs.add((String)cassettes.next(), 5, null);
}
addCatalog(new CurrencyImpl("DM"));
MoneyBag coinSlot = new MoneyBagImpl("coin slot",
(CurrencyImpl)getCatalog("DM"));
coinSlot.add(CurrencyImpl.PFENNIG_STCK_1, 100000, null);
addStock(coinSlot);
}
public static void main (String[] args)
{
VideoMachine vidMachine = new VideoMachine();
setTheShop(vidMachine);
vidMachine.setShopFrameTitle("Videoverleihautomat *** HOMECINEMA *** 24h");
vidMachine.start();
vidMachine.getShopFrame().setSize(640,480);
vidMachine.getShopFrame().validate();
}
public void quit()
{
if (Shop.getTheShop().shutdown (false)) {
System.exit (0);
}
}
}