Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2010, 1:22:26 PM (14 years ago)
Author:
dafrick
Message:

Added DistanceTriggerBeacon, which is a device which can be attached to objects to trigger a DistanceTrigger (both the (single) DistanceTrigger and DistanceMultiTrigger) based on the name of the DistanceTri$
Also some minor adjustements in QuestEffectBeacon: Removed some output and adjusted the outputlevel of some other output.
And started working on PickupInventory again (though no significant changes yet).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h

    r6864 r6906  
    4848    /**
    4949    @brief
    50         The DistanceMultiTrigger is a trigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger.
     50        The DistanceMultiTrigger is a trigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger. The object can be specified further by adding a DistanceTriggerBeacon (just attaching it) to the objects that can trigger this DistanceMultiTrigger and specify the name of the DistanceTriggerBeacon with the parameter targetname and only objects that hav a DistanceTriggerBeacon with that name attached will trigger the DistanceMultiTrigger.
    5151    @see MultiTrigger.h
    5252        For more information on MultiTriggers.
     
    6363            void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a DistanceMultiTrigger object through XML.
    6464
     65            /**
     66            @brief Set the target name of DistanceTriggerBeacons that triggers this DistanceMultiTrigger.
     67            @param targename The name of the DistanceTriggerBeacon as a string.
     68            */
     69            inline void setTargetName(const std::string& targetname)
     70                { if(targetname.compare(BLANKSTRING) != 0) this->singleTargetMode_ = true; else this->singleTargetMode_ = false; this->targetName_ = targetname; }
     71            /**
     72            @brief Get the target name of the DistanceTriggerbeacon, that triggers this DistanceMultiTrigger.
     73            @return Returns the target name as a string.
     74            */
     75            inline const std::string& getTargetName(void)
     76                { return this->targetName_; }
     77           
    6578            /**
    6679            @brief Set the distance at which the DistanceMultiTrigger triggers.
     
    96109        private:
    97110            float distance_; //!< The distance at which the DistanceMultiTrigger triggers.
     111            std::string targetName_; //!< The target name, used in singleTargetMode.
     112            bool singleTargetMode_; //!< To indicate whe the MultiDistanceTrigger is in single-target-mode.
     113           
    98114            std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
    99115       
Note: See TracChangeset for help on using the changeset viewer.