Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
Accelerator
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Type
/
to search
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
aaccioly-coding-challenges
/
GildedRose-Refactoring-Kata
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
1
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
GildedRose-Refactoring-Kata
/
GildedRoseRequirements_zh.txt
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
32 lines (21 loc) · 2.3 KB
main
Breadcrumbs
GildedRose-Refactoring-Kata
/
GildedRoseRequirements_zh.txt
Copy path
Top
File metadata and controls
Code
Blame
32 lines (21 loc) · 2.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
======================================
Gilded Rose 需求描述
======================================
欢迎来到镶金玫瑰(Gilded Rose)团队。如你所知,我们是主城(暴风城)中的一个小旅店,店主非常友好,名叫Allison。我们也售卖最好的物品。不幸的是,物品品质会随着销售期限的接近而不断下降。
我们有一个系统来更新库存信息。系统是由一个火车王(魔兽世界中导致团灭的猪队友)Leeroy所开发的,他已经不在这了。
你的任务是添加新功能,这样我们就可以售卖新的物品。
先介绍一下我们的系统:
- 每种物品都具备一个销售期限`SellIn`,表示我们要在多少天之前把物品卖出去
- 每种的物品都具备品质值`Quality`,表示物品的品质
- 每天结束时,系统会降低每种物品的这两个数值
很简单吧?这还有些更有意思的:
- 一旦销售期限过期,品质`Quality`会以双倍速度加速下降
- 物品的品质`Quality`永远不会为负值
- "Aged Brie"(陈年布利奶酪)的品质`Quality`会随着时间推移而提高
- 物品的品质`Quality`永远不会超过50
- 传奇物品"Sulfuras"(萨弗拉斯—炎魔拉格纳罗斯之手)永不过期,也不会降低品质`Quality`
- "Backstage passes"(后台通行证)与"Aged Brie"(陈年布利奶酪)类似,其品质`Quality`会随着时间推移而提高;当还剩10天或更少的时候,品质`Quality`每天提高2;当还剩5天或更少的时候,品质`Quality`每天提高3;但一旦过期,品质就会降为0
我们最近签约了一个召唤物品供应商。这需要对我们的系统进行升级:
- "Conjured"(召唤物品)的品质`Quality`下降速度比正常物品快一倍
请随意对**UpdateQuality()**函数进行修改和添加新代码,只要系统还能正常工作。然而,不要修改Item类或其属性,因为那属于角落里的地精,他会非常愤怒地爆你头,因为他不相信代码共享所有制(如果你愿意,你可以将UpdateQuality方法和Items属性改为静态的,我们会掩护你的)。
再次澄清,每种物品的品质不会超过50,然而"Sulfuras"(萨弗拉斯—炎魔拉格纳罗斯之手)是一个传奇物品,因此它的品质是80且永远不变。
You can’t perform that action at this time.