Merge branch 'main' of github.com:SowinskiBraeden/comp2522

This commit is contained in:
SowinskiBraeden committed 2025-09-22 14:08:05 -07:00
commit 8a190bfe6a
5 files changed
+21 -17

No files matched your search

@@ -9,7 +9,8 @@ package ca.bcit.comp2522.lab02;
* @author Trishaan Shetty * @author Trishaan Shetty
* @version 1.0.0 * @version 1.0.0
*/ */
public class Creature { public class Creature
{
private static final int MIN_HEALTH = 1; private static final int MIN_HEALTH = 1;
private static final int MAX_HEALTH = 100; private static final int MAX_HEALTH = 100;
@@ -162,7 +163,8 @@ public class Creature {
* *
* @return details of the creature. * @return details of the creature.
*/ */
public String getDetails() { public String getDetails()
{
StringBuilder builder; StringBuilder builder;
builder = new StringBuilder(); builder = new StringBuilder();
+8 -4
View File
@@ -9,7 +9,8 @@ package ca.bcit.comp2522.lab02;
* @author Trishaan Shetty * @author Trishaan Shetty
* @version 1.0.0 * @version 1.0.0
*/ */
public class Dragon extends Creature { public class Dragon extends Creature
{
private static final int MAX_FIRE_POWER = 100; private static final int MAX_FIRE_POWER = 100;
private static final int MIN_FIRE_POWER = 0; private static final int MIN_FIRE_POWER = 0;
@@ -61,10 +62,11 @@ public class Dragon extends Creature {
* @return details of dragon * @return details of dragon
*/ */
@Override @Override
public String getDetails() { public String getDetails()
{
final StringBuilder builder; final StringBuilder builder;
builder = new StringBuilder(); builder = new StringBuilder();
builder.append("Is alive: " + this.isAlive()); builder.append("Is alive: " + this.isAlive());
@@ -74,6 +76,7 @@ public class Dragon extends Creature {
builder.append(" Health: " + this.getHealth()); builder.append(" Health: " + this.getHealth());
builder.append(" FirePower: " + this.firePower); builder.append(" FirePower: " + this.firePower);
return builder.toString(); return builder.toString();
} }
@@ -110,7 +113,8 @@ public class Dragon extends Creature {
* *
* @param amount to increase firePower * @param amount to increase firePower
*/ */
protected void restoreFirePower(final int amount) { protected void restoreFirePower(final int amount)
{
this.firePower += amount; this.firePower += amount;
@@ -9,12 +9,8 @@ package ca.bcit.comp2522.lab02;
* @author Trishaan Shetty * @author Trishaan Shetty
* @version 1.0.0 * @version 1.0.0
*/ */
public class HealingException extends RuntimeException { public class HealingException extends RuntimeException
{
/**
* HealingException constructor
* @param message HealingException error message
*/
public HealingException(final String message) { public HealingException(final String message) {
super(message); super(message);
} }
@@ -9,12 +9,9 @@ package ca.bcit.comp2522.lab02;
* @author Trishaan Shetty * @author Trishaan Shetty
* @version 1.0.0 * @version 1.0.0
*/ */
public class LowFirePowerException extends Exception { public class LowFirePowerException extends Exception
{
/**
* LowFirePowerException constructor
* @param message LowFirePowerException error message
*/
public LowFirePowerException(final String message) { public LowFirePowerException(final String message) {
super(message); super(message);
} }
@@ -9,12 +9,17 @@ package ca.bcit.comp2522.lab02;
* @author Trishaan Shetty * @author Trishaan Shetty
* @version 1.0.0 * @version 1.0.0
*/ */
<<<<<<< HEAD
public class LowRageException extends Exception
{
=======
public class LowRageException extends Exception { public class LowRageException extends Exception {
/** /**
* LowRageException constructor * LowRageException constructor
* @param message LowRageException error message * @param message LowRageException error message
*/ */
>>>>>>> 95139d77e5ef179a1fdf39684f766170502c6138
public LowRageException(final String message) { public LowRageException(final String message) {
super(message); super(message);
} }