Games-Axmud

 view release on metacpan or  search on metacpan

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

            name                        => $name,           # Max 32 chars
            stimulus                    => $stimulus,       # A pattern
            response                    => $response,       # Instruction (or pattern/substitution)
            enabledFlag                 => $flag,

            # Trigger attributes
            # ------------------

            # Current values for each trigger attribute (initially set to defaults)
            attribHash                  => {
                'ignore_response'       => FALSE,
                'splitter'              => FALSE,
                'split_after'           => FALSE,
                'keep_splitting'        => FALSE,
                'rewriter'              => FALSE,
                'rewrite_global'        => FALSE,
                'ignore_case'           => TRUE,
                'gag'                   => FALSE,
                'gag_log'               => FALSE,
                'need_prompt'           => FALSE,
                'need_login'            => FALSE,
                'keep_checking'         => TRUE,
                'default_pane'          => TRUE,
                'pane_name'             => '',
                'temporary'             => FALSE,
                'cooldown'              => 0,
                'style_mode'            => 0,
                'style_text'            => '',
                'style_underlay'        => '',
                'style_italics'         => 0,
                'style_underline'       => 0,
                'style_blink_slow'      => 0,
                'style_blink_fast'      => 0,
                'style_strike'          => 0,
                'style_link'            => 0,
            },

            # Ordering
            # --------

            # A hash of inactive trigger names. When this trigger becomes active, all other active
            #   triggers are checked. If their corresponding inactive triggers have names which
            #   appear in this list, then the active trigger corresponding to this object is
            #   placed BEFORE them in the ordered list of active triggers. Hash in the form
            #       $beforeHash{inactive_trigger_name} = undef
            beforeHash                  => {},
            # Hash of inactive trigger names; if corresponding active triggers exist, this object's
            #   active trigger is placed AFTER them. (NB If ->beforeHash and ->afterHash conflict,
            #   then ->beforeHash is ignored and ->afterHash is used)
            afterHash                   => {},
        };

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

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

        # Check for improper arguments
        if (! defined $profName || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clone', @_);
        }

        # Setup
        my $clone = {
            _objName                    => $self->_objName,
            _objClass                   => $self->_objClass,
            _parentFile                 => 'otherprof',
            _parentWorld                => $profName,
            _privFlag                   => TRUE,            # All IVs are private

            # Interface category
            # ------------------

            category                    => $self->category,

            # Standard interface attributes
            # -----------------------------

            name                        => $self->name,
            stimulus                    => $self->stimulus,
            response                    => $self->response,
            enabledFlag                 => $self->enabledFlag,

            # Trigger attributes
            # ------------------

            attribHash                  => {$self->attribHash},

            # Ordering
            # --------

            beforeHash                  => {$self->beforeHash},
            afterHash                   => {$self->afterHash},
        };

        # Bless the cloned object into existence
        bless $clone, $self->_objClass;
        return $clone;
    }

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

    ##################
    # Accessors - set

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

        if (! defined $enabledFlag || $enabledFlag) {
            $flag = TRUE;      # Default is TRUE
        } else {
            $flag = FALSE;
        }

        # Setup
        my $self = {
            _objName                    => $name,
            _objClass                   => $class,
            _parentFile                 => 'otherprof',
            _parentWorld                => $session->currentWorld->name,
            _privFlag                   => TRUE,        # All IVs are private

            # Interface category
            # ------------------

            category                    => 'alias',     # Shortcut to $self->_objClass

            # Standard interface attributes
            # -----------------------------

            name                        => $name,       # Max 32 chars
            stimulus                    => $stimulus,   # A pattern
            response                    => $response,   # A substitution
            enabledFlag                 => $flag,

            # Alias attributes
            # ----------------

            # Current values for each alias attribute (initially set to defaults)
            attribHash                  => {
                'ignore_case'           => TRUE,
                'keep_checking'         => FALSE,
                'temporary'             => FALSE,
                'cooldown'              => 0,
            },

            # Ordering
            # --------

            # A hash of inactive alias names. When this alias becomes active, all other active
            #   aliases are checked. If their corresponding inactive aliases have names which
            #   appear in this list, then the active alias corresponding to this object is
            #   placed BEFORE them in the ordered list of active aliases. Hash in the form
            #       $beforeHash{inactive_trigger_name} = undef
            beforeHash                  => {},
            # Hash of inactive alias names; if corresponding active aliases exist, this object's
            #   active alias is placed AFTER them
            afterHash                   => {},
        };

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

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

        # Check for improper arguments
        if (! defined $profName || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clone', @_);
        }

        # Setup
        my $clone = {
            _objName                    => $self->_objName,
            _objClass                   => $self->_objClass,
            _parentFile                 => 'otherprof',
            _parentWorld                => $profName,
            _privFlag                   => TRUE,            # All IVs are private

            # Interface category
            # ------------------

            category                    => $self->category,

            # Standard interface attributes
            # -----------------------------

            name                        => $self->name,
            stimulus                    => $self->stimulus,
            response                    => $self->response,
            enabledFlag                 => $self->enabledFlag,

            # Alias attributes
            # ----------------

            attribHash                  => {$self->attribHash},

            # Ordering
            # --------

            beforeHash                  => {$self->beforeHash},
            afterHash                   => {$self->afterHash},
        };

        # Bless the cloned object into existence
        bless $clone, $self->_objClass;
        return $clone;
    }

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

    ##################
    # Accessors - set

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


        # Translate all values of $enabledFlag into TRUE of FALSE
        if (! defined $enabledFlag || $enabledFlag) {
            $flag = TRUE;      # Default is TRUE
        } else {
            $flag = FALSE;
        }

        # Setup
        my $self = {
            _objName                    => $name,
            _objClass                   => $class,
            _parentFile                 => 'otherprof',
            _parentWorld                => $session->currentWorld->name,
            _privFlag                   => TRUE,        # All IVs are private

            # Interface category
            # ------------------

            category                    => 'macro',     # Shortcut to $self->_objClass

            # Standard interface attributes
            # -----------------------------

            name                        => $name,       # Max 32 chars
            stimulus                    => $stimulus,   # An Axmud standard keycode
            response                    => $response,   # An instruction
            enabledFlag                 => $flag,

            # Macro attributes
            # ----------------

            # Current values for each macro attribute (initially set to defaults)
            attribHash                  => {
                'temporary'             => FALSE,
                'cooldown'              => 0,
            },

            # Ordering
            # --------

            # A hash of inactive macro names. When this macro becomes active, all other active mac
            #   macros are checked. If their corresponding inactive macros have names which appear
            #   in this list, then the active macro corresponding to this object is placed BEFORE
            #   them in the ordered list of active macros. Hash in the form
            #       $beforeHash{inactive_macro_name} = undef
            beforeHash                  => {},
            # Hash of inactive macro names; if corresponding active macros exist, this object's
            #   active macro is placed AFTER them
            afterHash                   => {},
        };

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

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

        # Check for improper arguments
        if (! defined $profName || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clone', @_);
        }

        # Setup
        my $clone = {
            _objName                    => $self->_objName,
            _objClass                   => $self->_objClass,
            _parentFile                 => 'otherprof',
            _parentWorld                => $profName,
            _privFlag                   => TRUE,            # All IVs are private

            # Interface category
            # ------------------

            category                    => $self->category,

            # Standard interface attributes
            # -----------------------------

            name                        => $self->name,
            stimulus                    => $self->stimulus,
            response                    => $self->response,
            enabledFlag                 => $self->enabledFlag,

            # Macro attributes
            # ----------------

            attribHash                  => {$self->attribHash},

            # Ordering
            # --------

            beforeHash                  => {$self->beforeHash},
            afterHash                   => {$self->afterHash},
        };

        # Bless the cloned object into existence
        bless $clone, $self->_objClass;
        return $clone;
    }

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

    ##################
    # Accessors - set

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

        } else {
            $flag = FALSE;
        }

        # Setup
        my $self = {
            _objName                    => $name,
            _objClass                   => $class,
            _parentFile                 => 'otherprof',
            _parentWorld                => $session->currentWorld->name,
            _privFlag                   => TRUE,        # All IVs are private

            # Interface category
            # ------------------

            category                    => 'timer',    # Shortcut to $self->_objClass

            # Standard interface attributes
            # -----------------------------

            name                        => $name,       # Max 32 chars
            stimulus                    => $stimulus,   # An interval or 24-hour clock time
            response                    => $response,   # An instruction
            enabledFlag                 => $flag,

            # Timer attributes
            # ------------------

            # Current values for each timer attribute (initially set to defaults)
            attribHash                  => {
                'count'                 => -1,
                'initial_delay'         => 0,
                'random_delay'          => FALSE,
                'random_min'            => 0,
                'wait_login'            => TRUE,
                'temporary'             => FALSE,
            },

            # Ordering
            # --------

            # A hash of inactive timer names. When this timer becomes active, all other active
            #   timers are checked. If their corresponding inactive timers have names which appear
            #   in this list, then the active timer corresponding to this object is placed BEFORE
            #   them in the ordered list of active timers. Hash in the form
            #       $beforeHash{inactive_timer_name} = undef
            beforeHash                  => {},
            # Hash of inactive timer names; if corresponding active timers exist, this object's
            #   active timer is placed AFTER them
            afterHash                   => {},
        };

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

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

        # Check for improper arguments
        if (! defined $profName || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clone', @_);
        }

        # Setup
        my $clone = {
            _objName                    => $self->_objName,
            _objClass                   => $self->_objClass,
            _parentFile                 => 'otherprof',
            _parentWorld                => $profName,
            _privFlag                   => TRUE,            # All IVs are private

            # Interface category
            # ------------------

            category                    => $self->category,

            # Standard interface attributes
            # -----------------------------

            name                        => $self->name,
            stimulus                    => $self->stimulus,
            response                    => $self->response,
            enabledFlag                 => $self->enabledFlag,

            # Timer attributes
            # ----------------

            attribHash                  => {$self->attribHash},

            # Ordering
            # --------

            beforeHash                  => {$self->beforeHash},
            afterHash                   => {$self->afterHash},
        };

        # Bless the cloned object into existence
        bless $clone, $self->_objClass;
        return $clone;
    }

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

    ##################
    # Accessors - set

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


        # Translate all values of $enabledFlag into TRUE of FALSE
        if (! defined $enabledFlag || $enabledFlag) {
            $flag = TRUE;      # Default is TRUE
        } else {
            $flag = FALSE;
        }

        # Setup
        my $self = {
            _objName                    => $name,
            _objClass                   => $class,
            _parentFile                 => 'otherprof',
            _parentWorld                => $session->currentWorld->name,
            _privFlag                   => TRUE,        # All IVs are private

            # Interface category
            # ------------------

            category                    => 'hook',      # Shortcut to $self->_objClass

            # Standard interface attributes
            # -----------------------------

            name                        => $name,       # Max 32 chars
            stimulus                    => $stimulus,   # A hook event
            response                    => $response,   # An instruction
            enabledFlag                 => $flag,

            # Hook attributes
            # ---------------

            # Current values for each hook attribute (initially set to defaults)
            attribHash                  => {
                'temporary'             => FALSE,
                'cooldown'              => 0,
            },

            # Ordering
            # --------

            # A hash of inactive hook names. When this hook becomes active, all other active hooks
            #   are checked. If their corresponding inactive hooks have names which appear in this
            #   list, then the active hook corresponding to this object is placed BEFORE them in the
            #   ordered list of active hooks. Hash in the form
            #       $beforeHash{inactive_hook_name} = undef
            beforeHash                  => {},
            # Hash of inactive hook names; if corresponding active hooks exist, this object's
            #   active hook is placed AFTER them
            afterHash                   => {},
        };

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

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

        # Check for improper arguments
        if (! defined $profName || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clone', @_);
        }

        # Setup
        my $clone = {
            _objName                    => $self->_objName,
            _objClass                   => $self->_objClass,
            _parentFile                 => 'otherprof',
            _parentWorld                => $profName,
            _privFlag                   => TRUE,            # All IVs are private

            # Interface category
            # ------------------

            category                    => $self->category,

            # Standard interface attributes
            # -----------------------------

            name                        => $self->name,
            stimulus                    => $self->stimulus,
            response                    => $self->response,
            enabledFlag                 => $self->enabledFlag,

            # Hook attributes
            # ---------------

            attribHash                  => {$self->attribHash},

            # Ordering
            # --------

            beforeHash                  => {$self->beforeHash},
            afterHash                   => {$self->afterHash},
        };

        # Bless the cloned object into existence
        bless $clone, $self->_objClass;
        return $clone;
    }

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

    ##################
    # Accessors - set



( run in 0.741 second using v1.01-cache-2.11-cpan-84e82930d8c )