The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Games::Wumpus::Room - Cave room used for Hunt the Wumpus

SYNOPSIS

 my $room = Games::Wumpus::Room -> new -> init;

 $room -> set_hazard ($WUMPUS);
 @exits = $room -> exits;

DESCRIPTION

Games::Wumpus::Room is used to create objects representing rooms in the Hunt the Wumpus cave system. It's used from Games::Wumpus::Cave.

The following methods are implemented:

new

Class method returning an unintialized object.

init

Initializes the room.

name

Accessor returning the name of the room.

set_name

Accessor setting the name of the room.

set_hazard

Accessor setting one or more hazards in the room. Multiple hazards should be orred. Note that existing hazards aren't cleared.

hazards

Accessor returning a bitfield with the hazards of the room.

clear_hazards

Accessor removing all hazards from the room.

clear_hazard

Accessor clearing the given hazard from the room.

has_hazard

Accessor returning true if the room contains the given hazard.

exits

Accessor returning all the exits (rooms with tunnels leading to them) of the room.

add_exit

Accessor adding the given exit to the room.

exit_by_name

Accessor returning the exit which was passed by name. Returns undefined if the exit doesn't exist.

near_hazard

Returns true if one of the exits leads to the given hazard.

BUGS

None known.

TODO

Configuration of the game should be possible.

SEE ALSO

Games::Wumpus::, Games::Wumpus::Cave, Games::Wumpus::Constants

DEVELOPMENT

The current sources of this module are found on github, git://github.com/Abigail/Games--Wumpus.git.

AUTHOR

Abigail, mailto:wumpus@abigail.be.

COPYRIGHT and LICENSE

Copyright (C) 2009 by Abigail.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

INSTALLATION

To install this module, run, after unpacking the tar-ball, the following commands:

   perl Makefile.PL
   make
   make test
   make install