Skip to content

Commit

Permalink
Refactor PetHelper.cs to improve code readability and remove unnecess…
Browse files Browse the repository at this point in the history
…ary console outputs
  • Loading branch information
rpothin committed Apr 4, 2024
1 parent 05adec2 commit 1a566f3
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,10 @@ public static bool ArePetLifePointsCorrectlyUpdatedAfterFeedingActivity(ServiceC
// Get the life points
var lifePoints = pet.GetAttributeValue<int>("rpo_lifepoints");

Console.WriteLine("lifePointsBeforeFeeding: " + lifePointsBeforeFeeding);
Console.WriteLine("foodQuantity: " + foodQuantity);
Console.WriteLine("lifePoints: " + lifePoints);
Console.WriteLine("initialLifePoints: " + _initialLifePoints);
Console.WriteLine("lifePointsBeforeFeeding + foodQuantity: " + (lifePointsBeforeFeeding + foodQuantity));

// Check if the life points are correctly updated
if (lifePointsBeforeFeeding + foodQuantity >= _initialLifePoints) {
Console.WriteLine("1");
return lifePoints == _initialLifePoints;
} else {
Console.WriteLine("2");
// Consider the option that the life points already decreased by 10
return lifePoints == lifePointsBeforeFeeding + foodQuantity || lifePoints == lifePointsBeforeFeeding + foodQuantity - 10;
}
Expand Down

0 comments on commit 1a566f3

Please sign in to comment.