ํฌ์คํ ์ ๋ชฉ์ ํด๋ต์ ์๋ ์ฝ๋์ ์๋ค.
์๋ ์ฝ๋๋ฅผ ๋ณด๊ณ ๋, ์ง์ํ๊ธฐ ์ด๋ ต๋ค๋ฉด ํฌ์คํ ๊ฐ์ฅ ์๋์ ๊ธฐ์ฌํด๋์๋ค!
//ํํธ1
const machines = [
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
];
machines.forEach((machine) => {
console.log("------------์ปคํผ๋จธ์ ๊ฐ๋~!------------");
console.log(machine.makeCoffee(1));
});
์๋์ ๊ฐ์ด ์ปคํผ๋จธ์ ํด๋์ค์ ์นดํ๋ผ๋ผ๋จธ์ ํด๋์ค๊ฐ ์๋ค๊ณ ๊ฐ์ ํ๋ค.
// //์ปคํผ๋จธ์ ๋ง๋ค๊ธฐ
type CoffeeCup = {
orderShot: number;
hasMilk: boolean;
};
interface CoffeeMaker {
makeCoffee(shots: number): CoffeeCup;
}
//์ ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ๋ ํด๋์ค์ด๋ค.
class CoffeMachine implements CoffeeMaker {
private static ONE_SHOT_CAPSULE: number = 3;
protected static ONE_CUP_WATER: number = 10;
static makeMachine(beans: number, water: number): CoffeMachine {
return new CoffeMachine(beans, water);
}
public constructor(
protected capsule: number = 3,
protected water: number = 10
) {}
makeCoffee(orderShot: number): CoffeeCup {
this.checkMaterials(orderShot);
console.log("์บก์์ฐ๊ธฐ ์ " + this.capsule);
this.useCapsule(orderShot);
console.log("๋ฌผ์ฐ๊ธฐ ์ " + this.water);
this.useWater();
this.heatWater();
return this.extract(orderShot);
}
protected checkMaterials(orderShot: number) {
if (this.capsule < orderShot * CoffeMachine.ONE_SHOT_CAPSULE) {
throw new Error(`์ปคํผ์บก์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์บก์ : ${this.capsule}`);
}
if (this.water < CoffeMachine.ONE_CUP_WATER) {
throw new Error(`๋ฌผ ๋ถ์กฑ!!! ๋จ์ ๋ฌผ ${this.water}`);
}
}
clean(): void {
console.log("์ปคํผ๋จธ์ ํ๊ตฌ๋ ์ค!");
}
private extract(shots: number): CoffeeCup {
return {
orderShot: shots,
hasMilk: false,
};
}
private heatWater() {
console.log("๋ฌผ ๋์ด๋ ์ค...");
}
private useCapsule(shot: number) {
console.log("์บก์์ฐ๋ฌ์์ต๋๋ค.");
this.capsule -= shot * CoffeMachine.ONE_SHOT_CAPSULE;
console.log("์บก์ ์ฐ๊ณ ๋ ํ" + this.capsule);
}
protected useWater() {
console.log("๋ฌผ์ฐ๋ฌ์์ต๋๋ค.");
this.water -= CoffeMachine.ONE_CUP_WATER;
console.log("๋ฌผ์ฐ๊ณ ๋ ํ " + this.water);
}
addCapsule(capsule: number) {
this.capsule += capsule;
}
fulfillWater(water: number) {
this.water += water;
}
get Water(): number {
return this.water;
}
get Capsule(): number {
return this.capsule;
}
}
// tslint:disable-next-line: max-classes-per-file
class CafeLatteMachine extends CoffeMachine {
protected static ONE_CUP_WATER: number = 8;
private static ONE_CUP_Milk: number = 2;
public constructor(
protected capsule: number = 3,
protected water: number = 10,
private milk: number,
public readonly serialNumber: string
) {
super(capsule, water);
}
makeCoffee(orderShot: number): CoffeeCup {
const coffee = super.makeCoffee(orderShot); //๊ธฐ๋ณธ์ ์ธ ์บก์ ์๋น, ๋ฌผ ์๋น, ๋ฌผ ๊ฐ์ด ๋ค ๋๋๊ณ ์์ฑ๋ ์ปคํผ๊ฐ ๋ฐํ
//๋ถ๋ชจ์์ ๋ฐ์์จ ์ปคํผ ์์ฑํ์ ์ฐ์ ๋ง ๋ถ์ด์ฃผ์!!!
this.steamMilk();
this.pourMilk();
return { orderShot: orderShot, hasMilk: true };
}
//์ค๋ฒ๋ผ์ด๋ฉ
checkMaterials(orderShot: number) {
super.checkMaterials(orderShot);
if (this.milk < CafeLatteMachine.ONE_CUP_Milk) {
throw new Error(`์ฐ์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์ฐ์ ๋ : ${this.milk}`);
}
}
useWater() {
console.log("๋ฌผ์ฐ๋ฌ์์ต๋๋ค.");
this.water -= CafeLatteMachine.ONE_CUP_WATER;
console.log("๋ฌผ์ฐ๊ณ ๋ ํ " + this.water);
}
private steamMilk(): void {
console.log("์ฐ์ ๋ฐ์ฐ๋ ์ค...");
}
private pourMilk() {
console.log("์ฐ์ ๋ถ๋ ์ค...");
this.milk -= CafeLatteMachine.ONE_CUP_Milk;
console.log("์ฐ์ ๋ถ๊ณ ๋ ๋ค " + this.milk);
}
public fulfillMilk(milk: number) {
this.milk += milk;
}
get Milk(): number {
return this.milk;
}
}
ํด๋์ค ๊ตฌ๋ ์ฌ๋ถ๋ ์๋ ์ฝ์๋ค๋ก ์ฐ์ด๋ณด๋ฉด ์ ๋์๊ฐ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
const machine = new CoffeMachine(100, 100);
const latteMachine = new CafeLatteMachine(100, 100, 2, "1S");
const latte1 = latteMachine.makeCoffee(10);
console.log("์ฒซ๋ฒ์งธ ๋ผ๋ผ...๋๊ตฌ๋๊ตฌ๋๊ตฌ...");
console.log(latte1);
console.log("์ง๊ธ ์ฐ์ ์ํ๋? : " + latteMachine.Milk);
console.log("์ฐ์ ๊ฐ ์์ผ๋๊น ์ถฉ์ ํด์ฃผ์");
latteMachine.fulfillMilk(2);
const latte2 = latteMachine.makeCoffee(10);
console.log("๋๋ฒ์งธ ๋ผ๋ผ~~~");
console.log(latte2);
const latte3 = latteMachine.makeCoffee(10);
console.log("์ฐ์ ๊ฐ ์๋ ์ํ์์ ์ธ๋ฒ์งธ ๋ผ๋ผ๋ฅผ ๋ง๋ค๋ ค๊ณ ํ๋ฉด~~?");
console.log(latte3);
console.log(latteMachine.serialNumber);
์ฌ๊ธฐ์ ์๊ธ์ด ๋ค์ด๊ฐ๋ ์๊ธ ์ปคํผ๋จธ์ ๋ ๋ง๋ค์ด๋ณธ๋ค.
์ด์ฒ๋ผ ๋คํ์ฑ์ ์ด์ฉํ๋ฉด ํ๊ฐ์ง์ ์ธํฐํ์ด์ค๋, ํ๊ฐ์ง์ ํด๋์ค๋ฅผ ํตํด์ ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก ๊ตฌํํ ํด๋์ค๋ฅผ ๋ ์ค๊ณํ ์ ์๋ค.
์ด๋ฌํ ๋คํ์ฑ์ ์ฅ์ ์ ๋๋์ผ๋ก ๋๋ํ ํ์ผํด ๋ณผ ํ์ด๋ฐ์ด ๋ค๊ฐ์๋ค.
์ด๋ ๊ฒ ์ฌ๋ฌ๊ฐ์ง ์ปคํผ๋จธ์ ๋ค(ํด๋์ค๋ฅผ ์์ฑํ๋ฉด ์ธ์คํด์ค, ๊ณง ํด๋น ์ฝ๋์์๋ ์ปคํผ๋จธ์ :_)์ด ๋ค์ด์๋ ๋ฐฐ์ด์ด ์๋ค๊ณ ์น์.
const machines = [
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
];
๋คํ์ฑ ์ต๊ณ ์ ์ฅ์ !
๋ฐ๋ก ์ด machines๋ฅผ ๋น๊ธ๋น๊ธ ๋๋ฉด์ ๊ฐ๊ฐ์ ๋จธ์ ๋ค์ ํ๋กํผํฐ(ํน์ ํจ์)๋ฅผ ๋ฐ์์์ ์ ์ดํ ์ ์๋ค๋ ์ ์ด๋ค!
const machines = [
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
];
machines.forEach((machine) => {
console.log("------------์ปคํผ๋จธ์ ๊ฐ๋~!------------");
console.log(machine.makeCoffee(1));
});
<์ถ๋ ฅ๊ฒฐ๊ณผ> ์ด๋ ๊ฒ ๋ฐฐ์ด์ ์๋ ๋ชจ๋ ์ปคํผ๋จธ์ ๋ค์ ์ ๊ทผํ๋ฉด์ ๊ฐ์ ํจ์๋ฅผ ์ ์คํํ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 25
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ22
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 15
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 15
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ12
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 17
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 23
{ orderShot: 1, hasMilk: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 5
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ2
๋ฌผ์ฐ๊ธฐ ์ 10
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 0
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false, hasSalt: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 25
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ22
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 15
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 15
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ12
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 17
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 23
{ orderShot: 1, hasMilk: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 5
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ2
๋ฌผ์ฐ๊ธฐ ์ 10
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 0
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false, hasSalt: true }
์ด์ฒ๋ผ ๋คํ์ฑ์ ์ฅ์ ์ ๋ค์ํ ํด๋์ค๋ค์ด ํ๊ฐ์ง ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ๊ฑฐ๋ ๋๋ ๋์ผํ ๋ถ๋ชจํด๋์ค๋ฅผ ์์๋ฐ์ ์ํ๋ผ๋ฉด,
๊ณตํต API๋ฅผ ์์ ์์์ฒ๋ผ ํธ์ถํ ์๋ ์๋ ๊ฒ์ด๋ค.
์ ์บก์ฒ๊ฐ ๊ฐ๋ฅํ ์ด์
์ฌ๊ธฐ์ ๋ ๊ธฐ๊ฐ ๋งํ ๊ฒ์,
๋ฐฐ์ด์ ํ์ ์ ์ธํฐํ์ด์ค ๋ฐฐ์ด๋ก ์ ํ์ ๊ฑธ์ด์ฃผ๋ฉด!
const machines: CoffeeMaker[] = [
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
];
์๋ ์บก์ณ์ ๊ฐ์ด ํธ์ถํ ์ ์๋ ๊ณตํตAPI๋ ์ธํฐํ์ด์ค์ ๊ท์ฝ๋์ด์๋ ํจ์ ๋ฟ์ด๋ค.
์ด์ฒ๋ผ ๋คํ์ฑ์ด๋, ํ๋์ ์ธํฐํ์ด์ค๋ ๋๋ ๊ฐ์ ๋ถ๋ชจ์ ํด๋์ค๋ฅผ ์์ํ ์์ํด๋์ค๋ค์ด,
๊ณตํต ์ธํฐํ์ด์ค ํน์ ๊ฐ์ ๋ถ๋ชจ ํด๋์ค์ ์๋ ํจ์๋ค์ ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก ๋ค์ํ๊ฒ ๊ตฌํํ ์ ์๋ ๊ฒ์ ๋งํ๋ค!!!
์ด๋ ๊ฒ ๊ณตํต ์ธํฐํ์ด์ค ํน์ ๊ฐ์ ๋ถ๋ชจ ํด๋์ค์ ์๋ ํจ์๋ฅผ ํธ์ถํ๋ ๊ณผ์ ์์,
๊ฐ๋ฐ์๋ ๊ฐ ํด๋์ค๋ค์ ์ธ๋ถ์ ์ธ ๋ด๋ถ ๊ตฌํ์ฌํญ์ ์ ๊ฒฝ์ฐ์ง ์๊ณ ๊ณตํต API๋ง์ ๋ณด๊ณ ๋ฝ์ ์ธ ์ ์๊ฒ ๋๋ ์ฌ์ฉ์์๋ ๊ฐํธํจ์ ๋๋ ์ ์๋ค.
<๋ณธ ํฌ์คํ ์ ํ์ฉํ ์ต์ข ์์ค ์ฝ๋>
// //์ปคํผ๋จธ์ ๋ง๋ค๊ธฐ
type CoffeeCup = {
orderShot: number;
hasMilk?: boolean;
hasSalt?: boolean;
};
interface CoffeeMaker {
makeCoffee(shots: number): CoffeeCup;
}
// CoffeeMaker ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ๋ CoffeMachine ํด๋์ค์ด๋ค.
class CoffeMachine implements CoffeeMaker {
private static ONE_SHOT_CAPSULE: number = 3;
protected static ONE_CUP_WATER: number = 10;
static makeMachine(beans: number, water: number): CoffeMachine {
return new CoffeMachine(beans, water);
}
public constructor(
protected capsule: number = 3,
protected water: number = 10
) {}
makeCoffee(orderShot: number): CoffeeCup {
this.checkMaterials(orderShot);
console.log("์บก์์ฐ๊ธฐ ์ " + this.capsule);
this.useCapsule(orderShot);
console.log("๋ฌผ์ฐ๊ธฐ ์ " + this.water);
this.useWater();
this.heatWater();
return this.extract(orderShot);
}
protected checkMaterials(orderShot: number) {
if (this.capsule < orderShot * CoffeMachine.ONE_SHOT_CAPSULE) {
throw new Error(`์ปคํผ์บก์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์บก์ : ${this.capsule}`);
}
if (this.water < CoffeMachine.ONE_CUP_WATER) {
throw new Error(`๋ฌผ ๋ถ์กฑ!!! ๋จ์ ๋ฌผ ${this.water}`);
}
}
clean(): void {
console.log("์ปคํผ๋จธ์ ํ๊ตฌ๋ ์ค!");
}
private extract(shots: number): CoffeeCup {
return {
orderShot: shots,
hasMilk: false,
};
}
private heatWater() {
console.log("๋ฌผ ๋์ด๋ ์ค...");
}
private useCapsule(shot: number) {
console.log("์บก์์ฐ๋ฌ์์ต๋๋ค.");
this.capsule -= shot * CoffeMachine.ONE_SHOT_CAPSULE;
console.log("์บก์ ์ฐ๊ณ ๋ ํ" + this.capsule);
}
protected useWater() {
console.log("๋ฌผ์ฐ๋ฌ์์ต๋๋ค.");
this.water -= CoffeMachine.ONE_CUP_WATER;
console.log("๋ฌผ์ฐ๊ณ ๋ ํ " + this.water);
}
addCapsule(capsule: number) {
this.capsule += capsule;
}
fulfillWater(water: number) {
this.water += water;
}
get Water(): number {
return this.water;
}
get Capsule(): number {
return this.capsule;
}
}
// CoffeMachine ํด๋์ค๋ฅผ ์์๋ฐ์ CafeLatteMachine ํด๋์ค์ด๋ค.
class CafeLatteMachine extends CoffeMachine {
protected static ONE_CUP_WATER: number = 8;
private static ONE_CUP_Milk: number = 2;
public constructor(
protected capsule: number = 3,
protected water: number = 10,
private milk: number,
public readonly serialNumber: string
) {
super(capsule, water);
}
makeCoffee(orderShot: number): CoffeeCup {
const coffee = super.makeCoffee(orderShot); //๊ธฐ๋ณธ์ ์ธ ์บก์ ์๋น, ๋ฌผ ์๋น, ๋ฌผ ๊ฐ์ด ๋ค ๋๋๊ณ ์์ฑ๋ ์ปคํผ๊ฐ ๋ฐํ
//๋ถ๋ชจ์์ ๋ฐ์์จ ์ปคํผ ์์ฑํ์ ์ฐ์ ๋ง ๋ถ์ด์ฃผ์!!!
this.steamMilk();
this.pourMilk();
return { orderShot: orderShot, hasMilk: true };
}
//์ค๋ฒ๋ผ์ด๋ฉ
checkMaterials(orderShot: number) {
super.checkMaterials(orderShot);
if (this.milk < CafeLatteMachine.ONE_CUP_Milk) {
throw new Error(`์ฐ์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์ฐ์ ๋ : ${this.milk}`);
}
}
useWater() {
console.log("๋ฌผ์ฐ๋ฌ์์ต๋๋ค.");
this.water -= CafeLatteMachine.ONE_CUP_WATER;
console.log("๋ฌผ์ฐ๊ณ ๋ ํ " + this.water);
}
private steamMilk(): void {
console.log("์ฐ์ ๋ฐ์ฐ๋ ์ค...");
}
private pourMilk() {
console.log("์ฐ์ ๋ถ๋ ์ค...");
this.milk -= CafeLatteMachine.ONE_CUP_Milk;
console.log("์ฐ์ ๋ถ๊ณ ๋ ๋ค " + this.milk);
}
public fulfillMilk(milk: number) {
this.milk += milk;
}
get Milk(): number {
return this.milk;
}
}
// CoffeMachine ํด๋์ค๋ฅผ ์์๋ฐ์ saltCoffeeMachine ํด๋์ค์ด๋ค.
class saltCoffeeMachine extends CoffeMachine {
//..
makeCoffee(orderShot: number): CoffeeCup {
const coffee = super.makeCoffee(orderShot);
return {
...coffee,
hasSalt: true,
};
}
}
const machines: CoffeeMaker[] = [
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
new CoffeMachine(25, 25),
new CafeLatteMachine(15, 25, 25, "S1"),
new saltCoffeeMachine(5, 10),
];
machines.forEach((machine) => {
console.log("------------์ปคํผ๋จธ์ ๊ฐ๋~!------------");
console.log(machine.makeCoffee(1));
});
const machine = new CoffeMachine(100, 100);
const latteMachine = new CafeLatteMachine(100, 100, 2, "1S");
const latte1 = latteMachine.makeCoffee(10);
console.log("์ฒซ๋ฒ์งธ ๋ผ๋ผ...๋๊ตฌ๋๊ตฌ๋๊ตฌ...");
console.log(latte1);
console.log("์ง๊ธ ์ฐ์ ์ํ๋? : " + latteMachine.Milk);
console.log("์ฐ์ ๊ฐ ์์ผ๋๊น ์ถฉ์ ํด์ฃผ์");
latteMachine.fulfillMilk(2);
const latte2 = latteMachine.makeCoffee(10);
console.log("๋๋ฒ์งธ ๋ผ๋ผ~~~");
console.log(latte2);
const latte3 = latteMachine.makeCoffee(10);
console.log("์ฐ์ ๊ฐ ์๋ ์ํ์์ ์ธ๋ฒ์งธ ๋ผ๋ผ๋ฅผ ๋ง๋ค๋ ค๊ณ ํ๋ฉด~~?");
console.log(latte3);
console.log(latteMachine.serialNumber);
<์ถ๋ ฅ๊ฒฐ๊ณผ>
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 25
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ22
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 15
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 15
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ12
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 17
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 23
{ orderShot: 1, hasMilk: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 5
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ2
๋ฌผ์ฐ๊ธฐ ์ 10
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 0
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false, hasSalt: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 25
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ22
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 15
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 15
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ12
๋ฌผ์ฐ๊ธฐ ์ 25
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 17
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 23
{ orderShot: 1, hasMilk: true }
------------์ปคํผ๋จธ์ ๊ฐ๋~!------------
์บก์์ฐ๊ธฐ ์ 5
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ2
๋ฌผ์ฐ๊ธฐ ์ 10
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 0
๋ฌผ ๋์ด๋ ์ค...
{ orderShot: 1, hasMilk: false, hasSalt: true }
์บก์์ฐ๊ธฐ ์ 100
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ70
๋ฌผ์ฐ๊ธฐ ์ 100
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 92
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 0
์ฒซ๋ฒ์งธ ๋ผ๋ผ...๋๊ตฌ๋๊ตฌ๋๊ตฌ...
{ orderShot: 10, hasMilk: true }
์ง๊ธ ์ฐ์ ์ํ๋? : 0
์ฐ์ ๊ฐ ์์ผ๋๊น ์ถฉ์ ํด์ฃผ์
์บก์์ฐ๊ธฐ ์ 70
์บก์์ฐ๋ฌ์์ต๋๋ค.
์บก์ ์ฐ๊ณ ๋ ํ40
๋ฌผ์ฐ๊ธฐ ์ 92
๋ฌผ์ฐ๋ฌ์์ต๋๋ค.
๋ฌผ์ฐ๊ณ ๋ ํ 84
๋ฌผ ๋์ด๋ ์ค...
์ฐ์ ๋ฐ์ฐ๋ ์ค...
์ฐ์ ๋ถ๋ ์ค...
์ฐ์ ๋ถ๊ณ ๋ ๋ค 0
๋๋ฒ์งธ ๋ผ๋ผ~~~
{ orderShot: 10, hasMilk: true }
/Users/์ ์ ๋ช
^_^/Desktop/ํ์ ๋ช
^__^/dist/index.js:87
throw new Error(`์ฐ์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์ฐ์ ๋ : ${this.milk}`);
^
Error: ์ฐ์ ๋ถ์กฑ!!! ํ์ฌ ๋ณด์ ์ฐ์ ๋ : 0