Changeset 2136 for code/branches/pickups2/src/orxonox
- Timestamp:
- Nov 4, 2008, 9:53:12 PM (16 years ago)
- 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 57 57 } 58 58 break; 59 default:;60 59 } 61 60 case Useable: 62 61 return CheckifSpace(); 63 case default:;64 62 } 65 63 return true; … … 90 88 } 91 89 } 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 } 92 136 } -
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.h
r2094 r2136 27 27 bool CheckifValid(Shipitem* toBeChecked); 28 28 bool CheckifSpace(); 29 void SwitchItem(Permanent* toSwitchItem); 30 string GetNameofPermanent (subItemTypePermanent NametoGet); //holt den Namen des getragenen Items im jeweiligen Slot. 29 31 30 32 private: -
code/branches/pickups2/src/orxonox/objects/pickup/ShipItem.cc
r2089 r2136 5 5 itemtype ShipItem::CheckType() 6 6 { 7 return this .type;7 return this->type; 8 8 } 9 9 10 10 subItemTypePermanent CheckSubType() 11 11 { 12 return this .subtype_permanent;12 return this->subtype_permanent; 13 13 } 14 15 subItemTypePowerups CheckSubType() 16 { 17 return this->subtype_powerups; 18 } 19 subItemTypeUsable CheckSubType() 20 { 21 return this->subtype_usables; 22 } 23 14 24 } -
code/branches/pickups2/src/orxonox/objects/pickup/ShipItem.h
r2094 r2136 21 21 public: 22 22 itemType CheckType(); 23 virtual23 //virtual ChecksubType(); 24 24 25 25 private: … … 27 27 string itemname; 28 28 }; 29 30 29 31 30 /* Useables are Items the Player can choose when to activate and then show an instant action/effect … … 37 36 Rockets, 38 37 Repairkits, 39 Triggers, 38 Triggers, //trigger events usable by the player (Quests f.exp.) 40 39 Boosters, 41 40 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
- Property svn:mergeinfo changed
/code/branches/pickups/src/orxonox/objects/weaponSystem/WeaponSystem.h (added) merged: 2127
- Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.