We can specify the exact position of a Player by a Map and a pair of Y-X coordinates. Since both of these are necessary to specify a location, I've created a class (Location) to contain them and updated any relevant functions. This will be useful in the future when we remove regen_coords (see Map) in favor of a respawn_location for the Player. Additionally, we could probably write some checks to ensure the Location is "well-formed" (existing, passable, etc.), throwing an exception if it's not so.
Coverage remained the same at 100.0% when pulling 33210133dc2b48d8e1803977ebd4fdbfc1dc8389 on location into 4daa6a2bd26ba6c93afa90e252e68d063cd6c3e0 on 0.2.0.
We can specify the exact position of a
Player
by aMap
and a pair of Y-X coordinates. Since both of these are necessary to specify a location, I've created a class (Location
) to contain them and updated any relevant functions. This will be useful in the future when we removeregen_coords
(seeMap
) in favor of arespawn_location
for thePlayer
. Additionally, we could probably write some checks to ensure theLocation
is "well-formed" (existing, passable, etc.), throwing an exception if it's not so.