-
Notifications
You must be signed in to change notification settings - Fork 0
/
PLBasketStore.h
63 lines (50 loc) · 1.81 KB
/
PLBasketStore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// PLBasketStore.h
// Plate
//
// Created by emileleon on 12/23/13.
// Copyright (c) 2013 Plate SF. All rights reserved.
//
#import <Foundation/Foundation.h>
@class PLALaCarteItem;
@class PLAddOnItem;
@class PLMenuItem;
@class PLPlate;
@interface PLBasketStore : NSObject
// Singleton object
+ (PLBasketStore *)sharedStore;
// These are items that the user has not yet confirmed adding to basket
@property (nonatomic, strong) NSMutableArray* alaCarteBuilder;
@property (nonatomic, strong) NSMutableArray* addOnBuilder;
@property (nonatomic, strong) PLPlate* plateBuilder;
// These are items that have been added to the basket
@property (nonatomic, strong) NSMutableArray* alaCarteItems;
@property (nonatomic, strong) NSMutableArray* addOns;
@property (nonatomic, strong) NSMutableArray* plates;
// These add items to the temporary *builders
-(int)addALaCarteItem:(PLALaCarteItem *)item;
-(int)removeALaCarteItem:(PLALaCarteItem *)itemI;
-(int)addAddOnItem:(PLAddOnItem *)item;
-(int)removeAddOnItem:(PLAddOnItem *)item;
-(void)setPlateType:(PlateType)plateType;
-(void)setPlateSize:(PlateSize)plateSize;
-(void)setPlateMain:(PLMenuItem *)mainEntree;
-(void)addPlateSide:(PLMenuItem *)newSide;
-(void)removePlateSide:(PLMenuItem *)sideToRemove;
// These move items from the builders to the basket
-(void)addPlateToBasket;
-(void)addALaCarteItemsToBasket;
-(void)addAddOnItemsToBasket;
// This resets the basket to empty
-(void)clearBasket;
// Helper methods
-(int)quantityOfAllItemsInBasket;
-(int)quantityOfItemInALaCarteBuilder:(PLALaCarteItem *)item;
-(int)quantityOfItemInAddOnBuilder:(PLAddOnItem *)item;
-(int)quantityOfSideInPlateBuilder:(PLMenuItem *)item;
-(int)quantityOfItemsInALaCarteBuilder;
-(int)quantityOfItemsInAddOnBuilder;
// Debugging helper
-(NSString *)printContentsOfBasket;
-(float)totalCostOfItemsInBasket;
@end