Class: ClasslessMud::Commands::Move
- Inherits:
-
Object
- Object
- ClasslessMud::Commands::Move
- Defined in:
- lib/classless_mud/commands/move.rb
Class Method Summary collapse
Class Method Details
.perform(game, player, message) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/classless_mud/commands/move.rb', line 4 def self.perform game, player, direction = .split[0] valid_exit = player.room.exits.detect {|exit| exit.direction == direction} if valid_exit player.room.exit player valid_exit.target.enter player else player.puts "You can't go that way." end end |