"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShoppingCard = exports.Item = void 0;
class Item {
    constructor(price) {
        this.price = price;
    }
}
exports.Item = Item;
class ShoppingCard {
    constructor(strategy) {
        this.strategy = strategy;
        this.items = [];
    }
    AddItem(item) {
        this.items.concat(item);
    }
    Pay() {
        let total = 0;
        for (let i = this.items.length - 1; i >= 0; i--) {
            total += this.items[i].price;
        }
        return this.strategy.Pay(total);
    }
}
exports.ShoppingCard = ShoppingCard;
