RobRolls (2) [Avatar] Offline
#1
public Character(int health, Point location) {
this.health = health; #2
this.location = location; #2
}
public Character HitByShooting(Point target) {
int newHealth = CalculateHealth(target);
return new GameCharacter(newHealth, this.location); #3
}

the above code has the constructor for Character and the method HitByShooting that says it should return Character but the return statement returns GameCharacter. Is there a reason for this?
Tomas Petricek (160) [Avatar] Offline
#2
Re: misleading code example 1.2.2
Hi,
Thanks for the feedback - we've already fixed this - "Character" should be "GameCharacter" in all of the places you mentioned.

T.