diff engine/core/model/structures/layer.cpp @ 255:51cc05d862f2

Merged editor_rewrite branch to trunk. This contains changes that may break compatibility against existing clients. For a list of changes that may affect your client, see: http://wiki.fifengine.de/Changes_to_pychan_and_FIFE_in_editor_rewrite_branch
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 08 Jun 2009 16:00:02 +0000
parents 56ac89189bc4
children ab41334e8a57
line wrap: on
line diff
--- a/engine/core/model/structures/layer.cpp	Wed Jun 03 19:29:52 2009 +0000
+++ b/engine/core/model/structures/layer.cpp	Mon Jun 08 16:00:02 2009 +0000
@@ -145,6 +145,25 @@
 		return matching_instances;
 	}
 
+	std::vector<Instance*> Layer::getInstancesAt(Location& loc, bool use_exactcoordinates) {
+		std::vector<Instance*> matching_instances;
+		std::vector<Instance*>::iterator it = m_instances.begin();
+
+		for(; it != m_instances.end(); ++it) {
+			if (use_exactcoordinates) {
+				if ((*it)->getLocationRef().getExactLayerCoordinatesRef() == loc.getExactLayerCoordinatesRef()) {
+					matching_instances.push_back(*it);
+				}
+			} else {
+				if ((*it)->getLocationRef().getLayerCoordinates() == loc.getLayerCoordinates()) {
+					matching_instances.push_back(*it);
+				}
+			}
+		}
+
+		return matching_instances;
+	}
+
 	void Layer::getMinMaxCoordinates(ModelCoordinate& min, ModelCoordinate& max, const Layer* layer) const {
 		if (!layer) {
 			layer = this;