diff --git a/src/SSDStore.java b/src/SSDStore.java index e1409d6..1bc24a7 100644 --- a/src/SSDStore.java +++ b/src/SSDStore.java @@ -4,6 +4,7 @@ public class SSDStore { private Capacity capacity; private SiteA siteA; // ���̎Q�Ƃ͕s�v�ɂȂ�”\�������� + private SiteB siteB; private SiteWrapper siteWrapper; private ItemsByCapacity itemsByCapacity; private Price price; @@ -12,8 +13,10 @@ public SSDStore() { this.capacity = new Capacity(); this.siteA = new SiteA(); - this.siteWrapper = new SiteWrapper(); - this.siteWrapper.addSite(this.siteA); // SiteA �I�u�W�F�N�g��lj� + this.siteB = new SiteB(); + //this.siteWrapper = new SiteWrapper(); + this.siteWrapper = new SiteWrapper(siteA, siteB); + //this.siteWrapper.addSite(this.siteA); // SiteA �I�u�W�F�N�g��lj� this.itemsByCapacity = new ItemsByCapacity(capacity, siteWrapper); this.price = new Price(); this.itemsByPrice = new ItemsByPrice(price, siteWrapper); @@ -32,11 +35,18 @@ return siteA.getValue(); } +// public void addProductToSiteA(int capacity, int price) { +// List siteAList = this.siteWrapper.getSites(); +// if (!siteAList.isEmpty()) { +// siteAList.get(0).addProductToSiteA(capacity, price); // �ŏ��� SiteA �I�u�W�F�N�g�ɐ��i��lj� +// } +// } public void addProductToSiteA(int capacity, int price) { - List siteAList = this.siteWrapper.getSites(); - if (!siteAList.isEmpty()) { - siteAList.get(0).addProductToSiteA(capacity, price); // �ŏ��� SiteA �I�u�W�F�N�g�ɐ��i��lj� - } + this.siteA.addProductToSiteA(capacity, price); + } + + public void addProductToSiteB(int capacity, int price) { + this.siteB.addProductToSiteB(capacity, price); } public List> getItemsByCapacity() {