pushing befor major changes
This commit is contained in:
@@ -62,6 +62,18 @@ class Game
|
||||
@players.delete_at(idx)
|
||||
end
|
||||
|
||||
# Finds if a player is in this game
|
||||
#
|
||||
# @return [Boolean]
|
||||
def find_player(player_name)
|
||||
@players.each do |player|
|
||||
if player.name == player_name
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# Checks if the given id matches a player in the game. Returns the player if
|
||||
# so. otherwise raises an error.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user