Skip to content

Commit e05051e

Browse files
committed
Abstract plant class
1 parent ae8d339 commit e05051e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
2. [Board](#meadow-board)
88
3. [Animals](#animals)
99
* [General concept](#general-concept)
10+
4. [Plants](#plants)
11+
* [General concept](#general-concept-plants)
1012

1113
# Project info
1214

@@ -45,3 +47,17 @@ Methods:
4547
* eat - abstract eating method of some MeadowBoard object that should
4648
affect some other properties and may result in reproducing
4749

50+
51+
# Plants
52+
53+
## General concept plants
54+
55+
Plant - abstract class for plants.
56+
57+
Properties:
58+
* roundsToReproduce - round without being eaten needed in order to force reproduce
59+
* rounds - counts rounds without being eaten
60+
* reproduceChange - change to reproduce in each turn in %
61+
62+
Method:
63+
* reproduce - abstract reproduction that creates new identical Plant

src/main/java/Plant.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public abstract class Plant {
2+
3+
int roundToReproduce;
4+
int rounds;
5+
int reproduceChange;
6+
7+
public abstract Plant reproduce();
8+
}

0 commit comments

Comments
 (0)