Instructions Jenkins Doxygen

[change] Arrangement Descriptors 07/1007/4
authorMack W <stanton510@googlemail.com>
Sun, 27 Oct 2013 17:00:41 +0000 (17:00 +0000)
committerVictor Popovici <theanswer@swgemu.com>
Sun, 27 Oct 2013 22:13:15 +0000 (23:13 +0100)
Change-Id: I9d8c946908768a1be182f06e10aa28f8d1724f96

15 files changed:
MMOCoreORB/src/server/zone/managers/creature/CreatureManagerImplementation.cpp
MMOCoreORB/src/server/zone/managers/player/PlayerManagerImplementation.cpp
MMOCoreORB/src/server/zone/objects/creature/CreatureObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/creature/commands/CreateSpawningElementCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/ServerDestroyObjectCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/TransferItemArmorCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/TransferItemMiscCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/TransferItemWeaponCommand.h
MMOCoreORB/src/server/zone/objects/player/components/PlayerContainerComponent.cpp
MMOCoreORB/src/server/zone/objects/player/sessions/vendor/CreateVendorSessionImplementation.cpp
MMOCoreORB/src/server/zone/objects/scene/SceneObject.idl
MMOCoreORB/src/server/zone/objects/scene/SceneObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/scene/components/ContainerComponent.cpp
MMOCoreORB/src/server/zone/templates/SharedObjectTemplate.h
MMOCoreORB/src/server/zone/templates/slots/ArrangementDescriptor.h

index 38dd7af..44a7fe7 100644 (file)
@@ -867,12 +867,15 @@ bool CreatureManagerImplementation::addWearableItem(CreatureObject* creature, Ta
                return false;
 
        for (int i = 0; i < clothing->getArrangementDescriptorSize(); ++i) {
-               String arrangementDescriptor = clothing->getArrangementDescriptor(i);
-               ManagedReference<SceneObject*> slot = creature->getSlottedObject(arrangementDescriptor);
+               Vector<String> descriptors = clothing->getArrangementDescriptor(i);
 
-               if (slot != NULL) {
-                       slot->destroyObjectFromWorld(true);
-                       slot->destroyObjectFromDatabase(true);
+               for (int j = 0; j < descriptors.size(); ++j) {
+                       ManagedReference<SceneObject*> slot = creature->getSlottedObject(descriptors.get(j));
+
+                       if (slot != NULL) {
+                               slot->destroyObjectFromWorld(true);
+                               slot->destroyObjectFromDatabase(true);
+                       }
                }
        }
 
index 22c87e1..a37d087 100644 (file)
@@ -453,7 +453,7 @@ Reference<TangibleObject*> PlayerManagerImplementation::createHairObject(const S
                return NULL;
        }
 
-       if (hair->getGameObjectType() != SceneObjectType::GENERICITEM || hair->getArrangementDescriptor(0) != "hair") {
+       if (hair->getGameObjectType() != SceneObjectType::GENERICITEM || hair->getArrangementDescriptor(0).get(0) != "hair") {
                ManagedReference<SceneObject*> clearRef = hair;
 
                return NULL;
index d89e66a..6209229 100644 (file)
@@ -389,17 +389,29 @@ void CreatureObjectImplementation::sendSlottedObjectsTo(SceneObject* player) {
 
                        bool sendWithoutContents = false;
 
-                       for (int i = 0; i < arrangementSize; ++i) {
-                               String childArrangement = object->getArrangementDescriptor(i);
-
-                               if (player != _this.get() && ((childArrangement == "bank")
-                                               || (childArrangement == "inventory") || (childArrangement
-                                                               == "datapad") || (childArrangement == "mission_bag"))) {
-                                       sendWithoutContents = true;
-                                       break;
+                       if (arrangementSize > 0) {
+                               Vector<String> descriptors = object->getArrangementDescriptor(0);
+
+                               if (descriptors.size() > 0) {
+                                       String childArrangement = descriptors.get(0);
+
+                                       if (player != _this.get() && ((childArrangement == "bank")
+                                                       || (childArrangement == "inventory") || (childArrangement
+                                                                       == "datapad") || (childArrangement == "mission_bag"))) {
+                                               sendWithoutContents = true;
+                                               break;
+                                       }
                                }
                        }
 
+                       /*for (int i = 0; i < arrangementSize; ++i) {
+
+                               for (int j=0; j<object->getArrangementDescriptor(i).size() ;++j){
+                                       String childArrangement = getArrangementDescriptor(i).get(j);
+
+                               }
+                       }*/
+
                        if (objects.put(object) != -1) {
                                if (sendWithoutContents)
                                        object->sendWithoutContainerObjectsTo(player);
index 4d689e1..27d1a7a 100755 (executable)
@@ -154,11 +154,15 @@ public:
                                }
 
                                for (int i = 0; i < object->getArrangementDescriptorSize(); ++i) {
-                                       String descriptor = object->getArrangementDescriptor(i);
+                                       Vector<String> descriptors = object->getArrangementDescriptor(i);
 
-                                       if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
+                                       for (int j = 0; j < descriptors.size(); ++j) {
+                                               String descriptor = descriptors.get(j);
+
+                                               if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
                                                        || descriptor == "mission_bag" || descriptor == "ghost" || descriptor == "bank" || descriptor == "hair")
                                                return GENERALERROR;
+                                       }
                                }
 
                                object->destroyObjectFromWorld(true);
index cd4bb99..c889bd5 100755 (executable)
@@ -102,11 +102,14 @@ public:
                        return GENERALERROR;
 
                for (int i = 0; i < object->getArrangementDescriptorSize(); ++i) {
-                       String descriptor = object->getArrangementDescriptor(i);
-
-                       if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
-                                       || descriptor == "mission_bag" || descriptor == "ghost" || descriptor == "bank" || descriptor == "hair")
-                               return GENERALERROR;
+                       Vector<String> descriptors = object->getArrangementDescriptor(i);
+                       for (int j = 0; j < descriptors.size(); ++j) {
+                               String descriptor = descriptors.get(j);
+
+                               if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
+                                               || descriptor == "mission_bag" || descriptor == "ghost" || descriptor == "bank" || descriptor == "hair")
+                                       return GENERALERROR;
+                       }
                }
 
                if (object->isASubChildOf(creature))
index 4eeed48..0b6207e 100755 (executable)
@@ -124,8 +124,6 @@ public:
                        return GENERALERROR;
                }
 
-
-
                if (transferType == 4) {
                        ManagedReference<SceneObject*> parent = objectToTransfer->getParent();
 
@@ -144,15 +142,36 @@ public:
                                int arrangementSize = objectToTransfer->getArrangementDescriptorSize();
 
                                if (arrangementSize > 0) {
-                                       String childArrangement = objectToTransfer->getArrangementDescriptor(0);
+                                       int arrangementGroupToUse = -1;
+
+                                       for (int i = 0; i < arrangementSize && arrangementGroupToUse == -1; ++i) {
+                                               Vector<String> descriptors = objectToTransfer->getArrangementDescriptor(i);
+
+                                               for (int j = 0; j < descriptors.size(); ++j) {
+                                                       String descriptor = descriptors.get(j);
+
+                                                       if (destinationObject->getSlottedObject(descriptor) == NULL && arrangementGroupToUse == -1) {
+                                                               arrangementGroupToUse = i;
+                                                       } else if (arrangementGroupToUse != -1) {
+                                                               arrangementGroupToUse = -1;
+                                                               break;
+                                                       }
+                                               }
+                                       }
+
+                                       if (arrangementGroupToUse != -1) {
+                                               transferType += arrangementGroupToUse;
+                                       } else {
+                                               String childArrangement = objectToTransfer->getArrangementDescriptor(0).get(0);
 
-                                       ManagedReference<SceneObject*> objectToRemove = destinationObject->getSlottedObject(childArrangement);
+                                               ManagedReference<SceneObject*> objectToRemove = destinationObject->getSlottedObject(childArrangement);
 
-                                       if (objectToRemove == NULL)
-                                               return GENERALERROR;
+                                               if (objectToRemove == NULL)
+                                                       return GENERALERROR;
 
-                                       if (!objectController->transferObject(objectToRemove, parent, 0xFFFFFFFF, true))
-                                               return GENERALERROR;
+                                               if (!objectController->transferObject(objectToRemove, parent, 0xFFFFFFFF, true))
+                                                       return GENERALERROR;
+                                       }
                                }
                        } else if (transferPreProcess != 0) {
                                if (errorDescription.length() > 1)
index 01891df..f0a630c 100755 (executable)
@@ -115,11 +115,14 @@ public:
                        return GENERALERROR;
 
                for (int i = 0; i < objectToTransfer->getArrangementDescriptorSize(); ++i) {
-                       String descriptor = objectToTransfer->getArrangementDescriptor(i);
+                       Vector<String> descriptors = objectToTransfer->getArrangementDescriptor(i);
+                       for (int j = 0; j < descriptors.size(); ++j) {
+                               String descriptor = descriptors.get(j);
 
-                       if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
-                                       || descriptor == "mission_bag" || descriptor == "ghost" || descriptor == "bank" || descriptor == "hair")
-                               return GENERALERROR;
+                               if (descriptor == "inventory" || descriptor == "datapad" || descriptor == "default_weapon"
+                                               || descriptor == "mission_bag" || descriptor == "ghost" || descriptor == "bank" || descriptor == "hair")
+                                       return GENERALERROR;
+                       }
                }
 
                Zone* zoneObject = objectToTransfer->getZone();
index c861e33..61f762f 100755 (executable)
@@ -143,7 +143,7 @@ public:
                                int arrangementSize = objectToTransfer->getArrangementDescriptorSize();
 
                                if (arrangementSize > 0) {
-                                       String childArrangement = objectToTransfer->getArrangementDescriptor(0);
+                                       String childArrangement = objectToTransfer->getArrangementDescriptor(0).get(0);
 
                                        ManagedReference<SceneObject*> objectToRemove = destinationObject->getSlottedObject(childArrangement);
 
index 7e08e64..49d1c17 100644 (file)
@@ -120,8 +120,8 @@ int PlayerContainerComponent::notifyObjectInserted(SceneObject* sceneObject, Sce
        /*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
        creo->broadcastMessage(msg6, true, true);*/
 
-       if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0) {
-               String arrangement = object->getArrangementDescriptor(0);
+       if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0).size() != 0) {
+               String arrangement = object->getArrangementDescriptor(0).get(0);
 
                if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
                        creo->addWearableObject(cast<TangibleObject*>(object), true);
@@ -169,8 +169,8 @@ int PlayerContainerComponent::notifyObjectRemoved(SceneObject* sceneObject, Scen
        /*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
        creo->broadcastMessage(msg6, true, true);*/
 
-       if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0) {
-               String arrangement = object->getArrangementDescriptor(0);
+       if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0).size() != 0) {
+               String arrangement = object->getArrangementDescriptor(0).get(0); //CHK
 
                if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
                        creo->removeWearableObject(cast<TangibleObject*>(object), true);
index d0fe594..d60377a 100644 (file)
@@ -228,13 +228,16 @@ void CreateVendorSessionImplementation::randomizeVendorLooks(CreatureObject* ven
                if (obj == NULL)
                        continue;
 
-               for (int k = 0; k < obj->getArrangementDescriptorSize(); ++k) {
-                       String arrangementDescriptor = obj->getArrangementDescriptor(k);
-                       ManagedReference<SceneObject*> slot = vendor->getSlottedObject(arrangementDescriptor);
-                       if (slot != NULL) {
-                               slot->destroyObjectFromWorld(true);
+               for (int j = 0; j < obj->getArrangementDescriptorSize(); ++j) {
+                       Vector<String> descriptors = obj->getArrangementDescriptor(j);
 
-                               slot->destroyObjectFromDatabase(true);
+                       for (int k = 0; k < descriptors.size(); ++k) {
+                               ManagedReference<SceneObject*> slot = vendor->getSlottedObject(descriptors.get(k));
+
+                               if (slot != NULL) {
+                                       slot->destroyObjectFromWorld(true);
+                                       slot->destroyObjectFromDatabase(true);
+                               }
                        }
                }
 
index 680f192..46dbf19 100644 (file)
@@ -164,6 +164,7 @@ class SceneObject extends QuadTreeEntry implements Logger {
        
        @dereferenced
        protected VectorMap<string, SceneObject> slottedObjects;
+
        
        @dereferenced
        protected transient ReadWriteLock containerLock;
@@ -698,6 +699,7 @@ class SceneObject extends QuadTreeEntry implements Logger {
        @local
        @read
        public native void getSlottedObjects(@dereferenced VectorMap<string, SceneObject> objects);
+
        
        @local
        @read
@@ -1055,18 +1057,12 @@ class SceneObject extends QuadTreeEntry implements Logger {
                return;
        }
 
-       @read
-       public int getArrangementDescriptorSize() {
-               if (templateObject.getArrangementDescriptors() != null)
-                       return templateObject.getArrangementDescriptors().size();
-               
-               return 0;
-       }
+       public native int getArrangementDescriptorSize();
+       
+       @dereferenced
+       @local
+       public native Vector<string> getArrangementDescriptor(int idx);
 
-       @read
-       public string getArrangementDescriptor(int idx) {
-               return templateObject.getArrangementDescriptors().get(idx);
-       }
 
        @read
        public string getSlotDescriptor(int idx) {
@@ -1153,26 +1149,7 @@ class SceneObject extends QuadTreeEntry implements Logger {
                return containerObjects.contains(objectID);
        }
        
-       @read
-       public boolean hasObjectInSlottedContainer(SceneObject object) {
-               int arrangementSize = object.getArrangementDescriptorSize();
-               
-               if (arrangementSize == 0) {
-                       return false;
-               }
-               
-               SceneObject obj = null;
-               
-               synchronized (containerLock) {
-                       obj = slottedObjects.get(object.getArrangementDescriptor(0));
-               }
-               
-               if (object == obj) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
+       public native boolean hasObjectInSlottedContainer(SceneObject object) ;
        
        @read
        @reference
index b3741f1..dbd8080 100644 (file)
@@ -1464,65 +1464,36 @@ void SceneObjectImplementation::faceObject(SceneObject* obj) {
        direction.setHeadingDirection(directionangle);
 }
 
-void SceneObjectImplementation::getSlottedObjects(VectorMap<String, ManagedReference<SceneObject*> >& objects) {
-       bool lock = !containerLock.isLockedByCurrentThread();
-
-       containerLock.rlock(lock);
-
-       objects = slottedObjects;
-
-       containerLock.runlock(lock);
-}
-
 void SceneObjectImplementation::getContainerObjects(VectorMap<uint64, ManagedReference<SceneObject*> >& objects) {
-       bool lock = !containerLock.isLockedByCurrentThread();
-
        containerObjects.loadObjects();
 
-       containerLock.rlock(lock);
+       ReadLocker locker(&containerLock);
 
        objects = *containerObjects.getContainerObjects();
+}
+
+void SceneObjectImplementation::getSlottedObjects(VectorMap<String, ManagedReference<SceneObject*> >& objects) {
+       ReadLocker locker(&containerLock);
 
-       containerLock.runlock(lock);
+       objects = slottedObjects;
 }
 
 Reference<SceneObject*> SceneObjectImplementation::getSlottedObject(const String& slot) {
        ManagedReference<SceneObject*> obj = NULL;
 
-       bool lock = !containerLock.isLockedByCurrentThread();
-
-       containerLock.rlock(lock);
+       ReadLocker locker(&containerLock);
 
-       try {
-               obj = slottedObjects.get(slot);
-       } catch (...) {
-               containerLock.runlock(lock);
-
-               throw;
-       }
-
-       containerLock.runlock(lock);
+       obj = slottedObjects.get(slot);
 
        return obj;
 }
 
-
 Reference<SceneObject*> SceneObjectImplementation::getSlottedObject(int idx) {
        ManagedReference<SceneObject*> obj = NULL;
 
-       bool lock = !containerLock.isLockedByCurrentThread();
-
-       containerLock.rlock(lock);
-
-       try {
-               obj = slottedObjects.get(idx);
-       } catch (...) {
-               containerLock.runlock(lock);
-
-               throw;
-       }
+       ReadLocker locker(&containerLock);
 
-       containerLock.runlock(lock);
+       obj = slottedObjects.get(idx);
 
        return obj;
 }
@@ -1670,3 +1641,34 @@ Reference<SceneObject*> SceneObjectImplementation::getContainerObjectRecursive(u
 
        return obj;
 }
+
+Vector<String> SceneObjectImplementation::getArrangementDescriptor(int idx) {
+       return templateObject->getArrangementDescriptors().get(idx);
+}
+
+bool SceneObjectImplementation::hasObjectInSlottedContainer(SceneObject* object) {
+       int arrangementSize = object->getArrangementDescriptorSize();
+
+       if (arrangementSize == 0) {
+               return false;
+       }
+
+       ManagedReference<SceneObject* > obj = NULL;
+
+       Locker _locker((&containerLock));
+
+       for (int i = 0; i < arrangementSize; ++i) {
+               Vector<String> descriptors = object->getArrangementDescriptor(i);
+
+               for (int j = 0; j < descriptors.size(); ++j) {
+                       if (slottedObjects.get(descriptors.get(j)) != NULL)
+                               return true;
+               }
+       }
+
+       return false;
+}
+
+int SceneObjectImplementation::getArrangementDescriptorSize() {
+       return templateObject->getArrangementDescriptors().size();
+}
index 13da465..f496421 100644 (file)
@@ -59,18 +59,21 @@ int ContainerComponent::canAddObject(SceneObject* sceneObject, SceneObject* obje
        VectorMap<String, ManagedReference<SceneObject*> >* slottedObjects = sceneObject->getSlottedObjects();
        VectorMap<uint64, ManagedReference<SceneObject*> >* containerObjects = sceneObject->getContainerObjects();
 
-       if (containmentType == 4 || containmentType == 5) {
+       if (containmentType >= 4) {
                Locker contLocker(sceneObject->getContainerLock());
 
-               int arrangementSize = object->getArrangementDescriptorSize();
+               int arrangementGroup = containmentType - 4;
 
-               for (int i = 0; i < arrangementSize; ++i) {
-                       String childArrangement = object->getArrangementDescriptor(i);
+               if (object->getArrangementDescriptorSize() > arrangementGroup) {
+                       Vector<String> descriptors = object->getArrangementDescriptor(arrangementGroup);
 
-                       if (slottedObjects->contains(childArrangement)) {
-                               errorDescription = "@container_error_message:container04"; //This slot is already occupied.
+                       for (int i = 0; i < descriptors.size(); ++i){
+                               String childArrangement = descriptors.get(i);
 
-                               return TransferErrorCode::SLOTOCCUPIED;
+                               if (slottedObjects->contains(childArrangement)) {
+                                       errorDescription = "@container_error_message:container04"; //This slot is already occupied.
+                                       return TransferErrorCode::SLOTOCCUPIED;
+                               }
                        }
                }
        } else if (containmentType == -1) {
@@ -161,22 +164,27 @@ bool ContainerComponent::transferObject(SceneObject* sceneObject, SceneObject* o
        VectorMap<uint64, ManagedReference<SceneObject*> >* containerObjects = sceneObject->getContainerObjects();
 
        //if (containerType == 1 || containerType == 5) {
-       if (containmentType == 4 || containmentType == 5) {
+       if (containmentType >= 4) {
                Locker contLocker(sceneObject->getContainerLock());
 
-               int arrangementSize = object->getArrangementDescriptorSize();
+               int arrangementGroup = containmentType - 4;
 
-               for (int i = 0; i < arrangementSize; ++i) {
-                       String childArrangement = object->getArrangementDescriptor(i);
+               if (object->getArrangementDescriptorSize() > arrangementGroup) {
+                       Vector<String> descriptors = object->getArrangementDescriptor(arrangementGroup);
 
-                       if (slottedObjects->contains(childArrangement)) {
-                               return false;
+                       for (int i = 0; i < descriptors.size(); ++i){
+                               String childArrangement = descriptors.get(i);
+
+                               if (slottedObjects->contains(childArrangement)) {
+                                       return false;
+                               }
                        }
-               }
 
-               for (int i = 0; i < arrangementSize; ++i) {
-                       slottedObjects->put(object->getArrangementDescriptor(i), object);
-               }
+                       for (int i = 0; i < descriptors.size(); ++i)    {
+                                slottedObjects->put(descriptors.get(i), object);
+                       }
+               } else
+                       return false;
 
                object->setParent(sceneObject);
                object->setContainmentType(containmentType);
@@ -201,7 +209,7 @@ bool ContainerComponent::transferObject(SceneObject* sceneObject, SceneObject* o
                return false;
        }
 
-       if ((containmentType == 4 || containmentType == 5) && objZone == NULL)
+       if ((containmentType >= 4) && objZone == NULL)
                sceneObject->broadcastObject(object, true);
        else if (notifyClient)
                sceneObject->broadcastMessage(object->link(sceneObject->getObjectID(), containmentType), true);
@@ -252,26 +260,31 @@ bool ContainerComponent::removeObject(SceneObject* sceneObject, SceneObject* obj
 
        int arrangementSize = object->getArrangementDescriptorSize();
 
-       bool removeFromSlot = false;
+       int arrangementGroup = MAX(0, containedType - 4);
+
+       if (object->getArrangementDescriptorSize() > arrangementGroup) {
+               bool removeFromSlot = false;
 
-       for (int i = 0; i < arrangementSize; ++i) {
-               String childArrangement = object->getArrangementDescriptor(i);
-               ManagedReference<SceneObject*> obj = slottedObjects->get(childArrangement);
+               Vector<String> descriptors = object->getArrangementDescriptor(arrangementGroup);
 
-               if (obj == object) {
-                       removeFromSlot = true;
-                       //info("sloted objects contains a different object", true);
-                       //object->setParent(NULL);
+               for (int i = 0; i < descriptors.size(); ++i){
+                       String childArrangement = descriptors.get(i);
 
-                       //return false;
-                       break;
+                       ManagedReference<SceneObject*> obj = slottedObjects->get(childArrangement);
+
+                       if (slottedObjects->get(childArrangement) == object) {
+                               removeFromSlot = true;
+                               break;
+                       }
                }
-       }
 
-       if (removeFromSlot) {
-               for (int i = 0; i < arrangementSize; ++i)
-                       slottedObjects->drop(object->getArrangementDescriptor(i));
+               if (removeFromSlot) {
+                       for (int i = 0; i < descriptors.size(); ++i)
+                               slottedObjects->drop(descriptors.get(i));
+               }
        }
+
+
        //      } else if (containedType == -1) {
        //Locker contLocker(sceneObject->getContainerLock());
 
index 9c820c2..75d7185 100644 (file)
@@ -286,9 +286,9 @@ public:
        PortalLayout* getPortalLayout();
        AppearanceTemplate* getAppearanceTemplate();
 
-       inline Vector<String>* getArrangementDescriptors() {
+       Vector < Vector<String> > getArrangementDescriptors() {
                if (arrangementDescriptors == NULL)
-                       return NULL;
+                       return Vector < Vector<String> >();
                else
                        return arrangementDescriptors->getArrangementSlots();
        }
@@ -412,8 +412,18 @@ public:
                return &groupPermissions;
        }
 
-       bool hasArrangementDescriptor(String s) {
-               return arrangementDescriptors->getArrangementSlots()->contains(s);
+       bool hasArrangementDescriptor(const String& s) {
+               bool foundIt = false;
+
+               Vector < Vector <String> > hAD = arrangementDescriptors->getArrangementSlots();
+
+               for (int i = 0; i < hAD.size() && !foundIt; ++i) {
+                       Vector <String> slotItems = hAD.get(i);
+
+                       foundIt = slotItems.contains(s);
+               }
+
+               return foundIt;
        }
 
 public:
index 1eb780f..4321862 100644 (file)
@@ -12,7 +12,7 @@
 #include "../IffTemplate.h"
 
 class ArrangementDescriptor : public IffTemplate {
-       Vector<String> arrangementSlots;
+       Vector< Vector<String> > arrangementSlots;
 
 public:
        ArrangementDescriptor() {
@@ -26,16 +26,19 @@ public:
                switch (version) {
                case '0000':
                {
-                       //for (int i = 0; i < versionForm->getChunksSize(); ++i) {
-                       for (int i = 0; i < MIN(versionForm->getChunksSize(), 1); ++i) { // TODO:figure out different arrangement groups
+                       for (int i = 0; i < versionForm->getChunksSize(); ++i) {
                                Chunk* arg = iffStream->openChunk('ARG ');
+                               Vector<String>  slot;
 
                                while (arg->hasData()) {
                                        String slotName;
                                        arg->readString(slotName);
-                                       arrangementSlots.add(slotName);
+
+                                       slot.add(slotName);
                                }
 
+                               arrangementSlots.add(slot);
+
                                iffStream->closeChunk('ARG ');
                        }
                }
@@ -47,12 +50,12 @@ public:
                iffStream->closeForm('ARGD');
        }
 
-       void clone(Vector<String>& copyVec) {
+       void clone(Vector< Vector<String> >& copyVec) {
                arrangementSlots.clone(copyVec);
        }
 
-       Vector<String>* getArrangementSlots() {
-               return &arrangementSlots;
+       Vector< Vector<String> >& getArrangementSlots() {
+               return arrangementSlots;
        }
 };