classDiagram
class Crop {
-String name
-int growthStage
-int effect
-boolean isHarvestable
+grow()
+harvest()
}
class Field {
-List~Crop~ crops
+plantCrop(Crop)
}
class Player {
-String name
-Inventory inventory
-int gold
-float energy
-int speed
+TakeDamage(int)
+Collect(Crop)
}
class Inventory {
-Farmer farmer
-Dictionary~String, int~ items
+addItem(String, int)
+removeItem(String, int)
}
Player "1" -- "1" Inventory
Player "1" -- "*" Field
Field "1" -- "*" Crop
개요
문제 정의
아래의 농집물 수확에 관한 클래스 구조를 바탕으로 플레이어의 농작물 수확 기능을 구현 후 다른 컨텐츠들을 확장
classDiagram class Crop { -String name -int growthStage -int effect -boolean isHarvestable +grow() +harvest() } class Field { -List~Crop~ crops +plantCrop(Crop) } class Player { -String name -Inventory inventory -int gold -float energy -int speed +TakeDamage(int) +Collect(Crop) } class Inventory { -Farmer farmer -Dictionary~String, int~ items +addItem(String, int) +removeItem(String, int) } Player "1" -- "1" Inventory Player "1" -- "*" Field Field "1" -- "*" Crop이 클래스 구조는 다음과 같은 주요 요소를 포함합니다:
범위
필수 요구사항
현재 프로젝트의 요구사항을 입력하세요.