Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2008, 9:53:12 PM (16 years ago)
Author:
landauf
Message:

merged changes from pickups1 to pickups2, not merged (probably) accidentally added files

Location:
code/branches/pickups2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickups2

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.cc

    r2094 r2136  
    5757                }
    5858                break;
    59             default:;
    6059            }
    6160        case Useable:
    6261            return CheckifSpace();
    63         case default:;
    6462        }
    6563        return true;
     
    9088        }
    9189    }
     90
     91    /*Adds the Item to the Ship*/
     92    void ShipEquipment::AddItem(Shipitem* toAddItem)
     93    {
     94        if(CheckifValid(toAddItem)==true)
     95        {
     96            switch(toAddItem.CheckType()){
     97                case Permanent:
     98                    Equipment.insert ( pair<std::string, ShipItem*>(toAddItem.itemname,toAddItem) );
     99                    break;
     100                case Usable:
     101                    Usable.insert ( pair<std::string, ShipItem*>(toAddItem.itemname,toAddItem) );
     102                    break;
     103                case Trunk:
     104                    Trunk.insert ( pair<std::string, ShipItem*>(toAddItem.itemname,toAddItem) );
     105                    break;
     106            }
     107        }
     108        else if(toAddItem.CheckType()==Permanent)
     109        {
     110            if(CheckifSpace()==true)
     111                Trunk.insert ( pair<std::string, ShipItem*>(toAddItem.itemname,toAddItem) );
     112        }
     113    }
     114
     115    void ShipEquipment::SwitchItem(Permanent* toSwitchItem)
     116    {
     117        multimap<string, ShipItem*>::iterator it;
     118        string equippedname;
     119        equippedname=GetNameofPermanent(toSwitchItem.CheckSubType());
     120        it=Equipment.find(equippedname);
     121        Trunk.insert (find(equippedname));
     122        Equipment.erase (it);
     123        Equipment.insert(pair<std::string, ShipItem*>(toSwitchItem.itemname,toSwitchItem)
     124    }
     125
     126    string ShipEquipment::GetNameofPermanent (subItemTypePermanent NametoGet)
     127    {
     128        multimap<string, ShipItem*>::iterator it;
     129        for ( it=Equipment.begin() ; it != Equipment.end(); it++ ){
     130            if((*it).second->CheckSubType()==NametoGet){
     131                return (*it).first.itemname;
     132            }
     133        }
     134        return 0;
     135    }
    92136}
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.h

    r2094 r2136  
    2727            bool CheckifValid(Shipitem* toBeChecked);
    2828            bool CheckifSpace();
     29            void SwitchItem(Permanent* toSwitchItem);
     30            string GetNameofPermanent (subItemTypePermanent NametoGet); //holt den Namen des getragenen Items im jeweiligen Slot.
    2931
    3032        private:
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipItem.cc

    r2089 r2136  
    55    itemtype ShipItem::CheckType()
    66    {
    7         return this.type;
     7        return this->type;
    88    }
    99
    1010    subItemTypePermanent CheckSubType()
    1111    {
    12         return this.subtype_permanent;
     12        return this->subtype_permanent;
    1313    }
     14
     15    subItemTypePowerups CheckSubType()
     16    {
     17        return this->subtype_powerups;
     18    }
     19    subItemTypeUsable CheckSubType()
     20    {
     21        return this->subtype_usables;
     22    }
     23
    1424}
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipItem.h

    r2094 r2136  
    2121        public:
    2222            itemType CheckType();
    23             virtual
     23            //virtual ChecksubType();
    2424
    2525        private:
     
    2727            string itemname;
    2828    };
    29 
    3029
    3130    /* Useables are Items the Player can choose when to activate and then show an instant action/effect
     
    3736            Rockets,
    3837            Repairkits,
    39             Triggers,           //trigger events usable by the player (Quests f.exp.)
     38            Triggers,       //trigger events usable by the player (Quests f.exp.)
    4039            Boosters,
    4140            Shields,
  • code/branches/pickups2/src/orxonox/objects/pickup/Usable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/pickups2/src/orxonox/objects/weaponSystem/WeaponSystem.h

Note: See TracChangeset for help on using the changeset viewer.