Games-Axmud

 view release on metacpan or  search on metacpan

lib/Games/Axmud/Win/Map.pm  view on Meta::CPAN

                $borderCornerXPosPixels,
                $borderCornerYPosPixels,
                $regionCount,
                $superRegionCount,
            );

        # Draw the number of checked/checkable directions
        } elsif ($mode eq 'checked_count') {

            # Count the number of checked and checkable directions
            $checkedCount = 0;
            %checkHash = $self->preCountCheckedHash;

            foreach my $dir ($roomObj->ivKeys('checkedDirHash')) {

                $checkedCount++;
                delete $checkHash{$dir};
            }

            foreach my $dir ($roomObj->sortedExitList) {

                delete $checkHash{$dir};
            }

            # Checkable directions are all those that remain in the hash
            $checkableCount = scalar (keys %checkHash);

            $self->drawInteriorCounts(
                $roomObj,
                $canvasWidget,
                $borderCornerXPosPixels,
                $borderCornerYPosPixels,
                $checkedCount,
                $checkableCount,
            );

        # Draw the number of living and non-living objects contained in the room
        } elsif ($mode eq 'room_content' || $mode eq 'hidden_content') {

            # Count the number of living and non-living things
            $livingCount = 0;
            $nonLivingCount = 0;

            # Count either permanent, or only hidden, objects (which are usually also in the room's
            #   permanent object list too), depending on the value of $mode
            if ($mode eq 'room_content') {

                @list = $roomObj->ivKeys('childHash');

            } else {

                # (Mode 'hidden_content')
                @list = $roomObj->ivKeys('hiddenObjHash');
            }

            foreach my $number (@list) {

                my $obj = $self->worldModelObj->ivShow('modelHash', $number);
                if ($obj) {

                    if ($obj->aliveFlag) {
                        $livingCount++;
                    } else {
                        $nonLivingCount++;
                    }
                }
            }

            if ($livingCount || $nonLivingCount) {

                $self->drawInteriorCounts(
                    $roomObj,
                    $canvasWidget,
                    $borderCornerXPosPixels,
                    $borderCornerYPosPixels,
                    $livingCount,
                    $nonLivingCount,
                );
            }

        # Draw the number of living and non-living (temporary) objects in the room, the last time it
        #   was visited (if known)
        } elsif ($mode eq 'temp_count') {

            # Retrieve the counts
            $livingCount = 0;
            $nonLivingCount = 0;

            if ($self->drawRegionmap->ivExists('livingCountHash', $roomObj->number)) {

                $livingCount = $self->drawRegionmap->ivShow('livingCountHash', $roomObj->number);
            }

            if ($self->drawRegionmap->ivExists('nonLivingCountHash', $roomObj->number)) {

                $nonLivingCount = $self->drawRegionmap->ivShow(
                    'nonLivingCountHash',
                    $roomObj->number,
                );
            }

            if ($livingCount || $nonLivingCount) {

                $self->drawInteriorCounts(
                    $roomObj,
                    $canvasWidget,
                    $borderCornerXPosPixels,
                    $borderCornerYPosPixels,
                    $livingCount,
                    $nonLivingCount,
                );
            }

        # Draw the number of recognised nouns and adjectives in the room
        } elsif ($mode eq 'word_count' && ($roomObj->nounList || $roomObj->adjList)) {

            $self->drawInteriorCounts(
                $roomObj,
                $canvasWidget,
                $borderCornerXPosPixels,
                $borderCornerYPosPixels,



( run in 0.655 second using v1.01-cache-2.11-cpan-39bf76dae61 )