Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 10:44:10 PM (14 years ago)
Author:
dafrick
Message:

Loads of changes.
1) PickupInventory should now be working even for extreme cases.
2) Added support for inactive Spawnpoints in Gametype.
3) Made Pickupable rewardble. meaning from now on any Pickupable can be given as a reward for completing Quests.
4) Added some keybinds to KeybindMenu, such as PickupInventory, QuestGUI and Chat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/pickup/PickupManager.h

    r6965 r6996  
    3939#include <map>
    4040#include "util/Singleton.h"
     41#include "core/WeakPtr.h"
    4142#include "pickup/PickupIdentifier.h"
    4243#include "PickupRepresentation.h"
     
    7273            // tolua_begin
    7374            int getNumPickups(void);
    74             orxonox::Pickupable* popPickup(void) { this->pickupsIndex_++; return *(this->pickupsIterator_++); }
    75             int getPickupIndex(void) { return this->pickupsIndex_-1; }
     75            orxonox::Pickupable* popPickup(void) { return (this->pickupsIterator_++)->first; }
    7676            orxonox::PickupRepresentation* getPickupRepresentation(orxonox::Pickupable* pickup) { if(pickup != NULL) return this->getRepresentation(pickup->getPickupIdentifier()); return NULL; }
    7777
    7878            void dropPickup(orxonox::Pickupable* pickup);
    7979            void usePickup(orxonox::Pickupable* pickup, bool use);
     80            bool isValidPickup(orxonox::Pickupable* pickup) { std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); if(it == this->pickupsList_.end()) return false; return it->second.get() != NULL; }
    8081            // tolua_end
    8182           
     
    8788            std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
    8889
    89             std::set<Pickupable*> pickupsList_;
    90             std::set<Pickupable*>::iterator pickupsIterator_;
    91             int pickupsIndex_;
     90            std::map<Pickupable*, WeakPtr<Pickupable> > pickupsList_;
     91            std::map<Pickupable*, WeakPtr<Pickupable> >::iterator pickupsIterator_;
    9292
    9393            std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier);
Note: See TracChangeset for help on using the changeset viewer.