Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李楚霏
/
refactorTest
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
13c57e5a
authored
May 23, 2020
by
李楚霏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task-7-adding-structure
parent
ad3cf480
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
gildedRose/src/item.js
+12
-0
No files found.
gildedRose/src/item.js
View file @
13c57e5a
...
...
@@ -42,6 +42,12 @@ export class Item {
}
_updateItem
(
item
)
{
this
.
updateQualityInOneDay
(
item
);
this
.
updateSellInInOneDay
(
item
);
this
.
updateQualityAfterDevaluation
(
item
);
}
updateQualityInOneDay
(
item
)
{
if
(
item
.
name
!=
this
.
isAgedBrie
()
&&
item
.
name
!=
this
.
isBackStagePass
())
{
if
(
item
.
quality
>
0
)
{
if
(
item
.
name
!=
this
.
isSulfuras
())
{
...
...
@@ -65,9 +71,15 @@ export class Item {
}
}
}
}
updateSellInInOneDay
(
item
)
{
if
(
item
.
name
!=
this
.
isSulfuras
())
{
this
.
decreaseSellIn
(
item
)
}
}
updateQualityAfterDevaluation
(
item
)
{
if
(
item
.
sell_in
<
0
)
{
if
(
item
.
name
!=
this
.
isAgedBrie
())
{
if
(
item
.
name
!=
this
.
isBackStagePass
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment