Games-Axmud

 view release on metacpan or  search on metacpan

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

                $inferiorName = $inferiorObj->name;
            } else {
                $inferiorName = '';
            }

            $session->writeText(
                ' x ' . sprintf(
                    '%-32.32s %-32.32s',
                    $unsortedHash{$cage}->name,
                    $inferiorName,
                )
            );
        }

        # Display footer
        if (@sortedList == 1) {

            return $self->complete($session, $standardCmd, 'List displayed (1 cage found)');

        } else {

            return $self->complete(
                $session, $standardCmd,
                'List displayed (' . @sortedList . ' cages found)',
            );
        }

    }
}

{ package Games::Axmud::Cmd::SetCageMask;

    use strict;
    use warnings;
#   use diagnostics;

    use Glib qw(TRUE FALSE);

    our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);

    ##################
    # Constructors

    sub new {

        # Create a new instance of this command object (there should only be one)
        #
        # Expected arguments
        #   (none besides $class)
        #
        # Return values
        #   'undef' if GA::Generic::Cmd->new reports an error
        #   Blessed reference to the new object on success

        my ($class, $check) = @_;

        # Setup
        my $self = Games::Axmud::Generic::Cmd->new('setcagemask', TRUE, FALSE);
        if (! $self) {return undef}

        $self->{defaultUserCmdList} = ['smk', 'setmask', 'setcagemask'];
        $self->{userCmdList} = \@{$self->{defaultUserCmdList}};
        $self->{descrip} = 'Manages cage masks';

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    ##################
    # Methods

    sub do {

        my (
            $self, $session, $inputString, $userCmd, $standardCmd,
            @args,
        ) = @_;

        # Local variables
        my (
            $initialFlagCount, $switch, $string, $addFlag, $iv, $unsetFlag, $listFlag, $taskName,
            $applyNowFlag, $flagCount, $worldFlag, $guildFlag, $raceFlag, $charFlag, $category,
            $customFlag, $profName, $profFlag, $profObj, $cage, $cageType, $taskObj,
        );

        # Extract switches
        $initialFlagCount = 0;
        ($switch, $string, @args) = $self->extract('-a', 1, @args);
        if (defined $switch) {

            $addFlag = TRUE;
            $initialFlagCount++;
            $iv = $string;
        }

        ($switch, $string, @args) = $self->extract('-u', 1, @args);
        if (defined $switch) {

            $unsetFlag = TRUE;
            $initialFlagCount++;
            $iv = $string;
        }

        ($switch, @args) = $self->extract('-l', 0, @args);
        if (defined $switch) {

            $listFlag = TRUE;
            $initialFlagCount++;
        }

        ($switch, $taskName, @args) = $self->extract('-n', 1, @args);
        if (defined $switch) {

            $applyNowFlag = TRUE;
            $initialFlagCount++;
        }

        $flagCount = 0;
        ($switch, @args) = $self->extract('-w', 0, @args);
        if (defined $switch) {



( run in 5.278 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )