-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
47 lines (41 loc) · 1.33 KB
/
index.php
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
<?php
/**
* Created by PhpStorm.
* User: kion
* Date: 16/01/2019
* Time: 03:11
*/
require_once __DIR__ . 'src/GildedRose.php';
require_once __DIR__ . 'src/BaseItem.php';
require_once __DIR__ . 'src/Item.php';
require_once __DIR__ . 'src/RareItem.php';
require_once __DIR__ . 'src/LegendaryItem.php';
require_once __DIR__ . 'src/ConcertTicketItem.php';
require_once __DIR__ . 'src/ConjuredItem.php';
echo "OMGHAI!\n";
$items = [
new BaseItem('+5 Dexterity Vest', 10, 20),
new RareItem('Aged Brie', 2, 1),
new BaseItem('Elixir of the Mongoose', 5, 7),
new LegendaryItem('Sulfuras, Hand of Ragnaros', 0, 80),
new LegendaryItem('Sulfuras, Hand of Ragnaros', -1, 80),
new ConcertTicketItem('Backstage passes to a TAFKAL80ETC concert', 15, 20),
new ConcertTicketItem('Backstage passes to a TAFKAL80ETC concert', 10, 49),
new ConcertTicketItem('Backstage passes to a TAFKAL80ETC concert', 5, 49),
// this conjured item does not work properly yet
new ConjuredItem('Conjured Mana Cake', 3, 6)
];
$app = new GildedRose($items);
$days = 2;
if (count($argv) > 1) {
$days = (int) $argv[1];
}
for ($i = 0; $i < $days; $i++) {
echo("-------- day $i --------\n");
echo("name, sellIn, quality\n");
foreach ($items as $item) {
echo $item . PHP_EOL;
}
echo PHP_EOL;
$app->updateQualityOfItems();
}