-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into doc/API-docs
- Loading branch information
Showing
11 changed files
with
726 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,65 @@ | ||
package team.rocket.Entities; | ||
|
||
/** | ||
* An abstract class to define characteristics and behaviors for multiple types of organisms. | ||
* | ||
* @version 0.6.0 | ||
* @since 0.1.0 | ||
* @version 0.4.0 | ||
*/ | ||
public abstract class AbstractOrganism { | ||
private static char icon; | ||
private static int count; | ||
private static int nutrition; | ||
private static char icon; // The icon representation of this type of organism | ||
private static int count; // The total number of existing organisms | ||
private static int nutrition; // The hunger value that this type of organism rewards when eaten | ||
|
||
/** | ||
* @return Organism's icon as a character | ||
* Returns the icon representation for this type of organism. | ||
* | ||
* @return this type of organism's icon as a character | ||
*/ | ||
public static char toIcon(){ | ||
public static char toIcon() { | ||
return icon; | ||
} | ||
|
||
/** | ||
* gets the icon from an instance | ||
* @return the icon of the organism | ||
* Gets the icon from an instance. | ||
* | ||
* @return the icon of the organism | ||
*/ | ||
abstract public char instancedToIcon(); | ||
|
||
/** | ||
* @return current Organism count | ||
* Returns the total number of existing organisms | ||
* | ||
* @return current organism count | ||
*/ | ||
public static int getCount(){ | ||
public static int getCount() { | ||
return count; | ||
} | ||
|
||
/** | ||
* Sets the count of animals | ||
* Sets the count of organisms. | ||
* | ||
* @param i the number count is being set too | ||
*/ | ||
public abstract void setCount(int i); | ||
|
||
|
||
/** | ||
* Needed for very specific instance with OrganismEnum so that the instance in the enum doesn't count towards the total number of Organisms | ||
* Needed for very specific instance with OrganismEnum so that the instance in the enum doesn't count towards the | ||
* total number of organisms. | ||
*/ | ||
public abstract void reduceCount(); | ||
|
||
/** | ||
* Takes the instance of an object and creates a brand new one and returns that new object | ||
* @return a fresh new not-copied AbstractOrganism | ||
* Takes the instance of an object and creates a brand new one and returns that new object. | ||
* | ||
* @return a fresh new not-copied abstract organism | ||
*/ | ||
public abstract AbstractOrganism getNewObjectFromExistingObject(); | ||
|
||
/** | ||
* Returns the hunger that this type of organism rewards when eaten | ||
* | ||
* @return nutrition | ||
*/ | ||
public abstract int getNutrition(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.