public OCObjectMapInfo(int chunkX, int chunkY, int chunkZ, int blockGlobalX, int blockGlobalY, int blockGlobalZ, OpenCog.Map.OCBlockData blockData)
		{
			string blockName = "BLOCK_" + blockData.GetHashCode();
			
			_height = 1;
			_width = 1;
			_length = 1;
			_type = OCEmbodimentXMLTags.STRUCTURE_OBJECT_TYPE;
			_id = blockName;//blockData.ID.ToString();
			_name = blockName;
			//this.Velocity = UnityEngine.Vector3.zero;
			this.position = new UnityEngine.Vector3(blockGlobalX, blockGlobalY, blockGlobalZ);
			_rotation = new OpenCog.Utility.Rotation(0, 0, 0);

			// Add block properties
//			AddTag ("class", "block", System.Type.GetType("System.String"));
//			AddTag ("visibility-status", "visible", System.Type.GetType("System.String"));
//			AddTag ("detector", "true", System.Type.GetType("System.Boolean"));
			
			AddProperty ("class", "block", System.Type.GetType("System.String"));
			AddProperty ("visibility-status", "visible", System.Type.GetType("System.String"));
			AddProperty ("detector", "true", System.Type.GetType("System.Boolean"));
			
			if (blockGlobalX == 9 && blockGlobalY == 140 && blockGlobalZ == 10)
			{
				UnityEngine.Debug.Log ("Break here plz...");	
			}
			
			try {
				string blockType = blockData.block.GetName();
				
				if (blockType.ToLower() != "air")
				{
					string balls = "lol";
					string lol = balls + "lol";	
				}
				
				//UnityEngine.Debug.Log ("BlockData.GetType = " + blockType);	
			} catch (System.Exception ex) {
				
			}
			
			if (blockData.block == null)
			{
				// Report air
//				this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
				this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
			}
			else
			{
				this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, blockData.block.GetName().ToLower (), System.Type.GetType("System.String"));
//				if (blockData.block.GetName().ToLower () == "air")
//				{
////					this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
//					this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
//				}
//				else
//				{
////					this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "13", System.Type.GetType("System.String"));
//					this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "13", System.Type.GetType("System.String"));
//				}
			}
			//mapinfo.AddProperty("color_name", "green", PropertyType.STRING);
		}
        public OCObjectMapInfo(int chunkX, int chunkY, int chunkZ, int blockGlobalX, int blockGlobalY, int blockGlobalZ, OpenCog.Map.OCBlockData blockData)
        {
            string blockName = "BLOCK_" + blockData.GetHashCode();

            _height = 1;
            _width  = 1;
            _length = 1;
            _type   = OCEmbodimentXMLTags.STRUCTURE_OBJECT_TYPE;
            _id     = blockName;        //blockData.ID.ToString();
            _name   = blockName;
            //this.Velocity = UnityEngine.Vector3.zero;
            this.position = new UnityEngine.Vector3(blockGlobalX, blockGlobalY, blockGlobalZ);
            _rotation     = new OpenCog.Utility.Rotation(0, 0, 0);

            // Add block properties
//			AddTag ("class", "block", System.Type.GetType("System.String"));
//			AddTag ("visibility-status", "visible", System.Type.GetType("System.String"));
//			AddTag ("detector", "true", System.Type.GetType("System.Boolean"));

            AddProperty("class", "block", System.Type.GetType("System.String"));
            AddProperty("visibility-status", "visible", System.Type.GetType("System.String"));
            AddProperty("detector", "true", System.Type.GetType("System.Boolean"));

            if (blockGlobalX == 9 && blockGlobalY == 140 && blockGlobalZ == 10)
            {
                UnityEngine.Debug.Log("Break here plz...");
            }

            try {
                string blockType = blockData.block.GetName();

                if (blockType.ToLower() != "air")
                {
                    string balls = "lol";
                    string lol   = balls + "lol";
                }

                //UnityEngine.Debug.Log ("BlockData.GetType = " + blockType);
            } catch (System.Exception ex) {
            }

            if (blockData.block == null)
            {
                // Report air
//				this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
                this.AddProperty(OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
            }
            else
            {
                this.AddProperty(OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, blockData.block.GetName().ToLower(), System.Type.GetType("System.String"));
//				if (blockData.block.GetName().ToLower () == "air")
//				{
////					this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
//					this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "0", System.Type.GetType("System.String"));
//				}
//				else
//				{
////					this.AddTag (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "13", System.Type.GetType("System.String"));
//					this.AddProperty (OCEmbodimentXMLTags.MATERIAL_ATTRIBUTE, "13", System.Type.GetType("System.String"));
//				}
            }
            //mapinfo.AddProperty("color_name", "green", PropertyType.STRING);
        }
		public OCObjectMapInfo (UnityEngine.GameObject gameObject)
		{
			UnityEngine.Debug.Log ("OCObjectMapInfo::OCObjectMapInfo, passed object is of type: " + gameObject.GetType().ToString () + ", and name " + gameObject.name);
			
			_id = gameObject.GetInstanceID().ToString();
			
//			// Get id of a game object
//			_id = gameObject.GetInstanceID ().ToString ();
			// Get name
			_name = gameObject.name;
			// TODO: By default, we are using object type.
			_type = OCEmbodimentXMLTags.ORDINARY_OBJECT_TYPE;

			// Convert from unity coordinate to OAC coordinate.

			this.position = Utility.VectorUtil.ConvertToOpenCogCoord (gameObject.transform.position);
			// Get rotation
			_rotation = new Utility.Rotation (gameObject.transform.rotation);
			// Calculate the velocity later
			_velocity = UnityEngine.Vector3.zero;

			// Get size
			if (gameObject.collider != null) {
				// Get size information from collider.
				_width = gameObject.collider.bounds.size.z;
				_height = gameObject.collider.bounds.size.y;
				_length = gameObject.collider.bounds.size.x;
			} else {
				OCLogger.Warn ("No collider for gameobject " + gameObject.name + ", assuming a point.");

				// Set default value of the size.
				_width = 0.1f;
				_height = 0.1f;
				_length = 0.1f;
			}

			if (gameObject.tag == "OCAGI") {
				// This is an OC avatar, we will use the brain id instead of unity id.
				OCConnectorSingleton connector = OCConnectorSingleton.Instance;

				if (connector != null)
				{
					_id = connector.BrainID;
					_type = OCEmbodimentXMLTags.PET_OBJECT_TYPE;
				}
				
				UnityEngine.Debug.Log ("Just made an OCObjectMapInfo stating the AGI is at [" + this.position.x + ", " + this.position.y + ", " + this.position.z + "]");

			} else if (gameObject.tag == "OCNPC") {
				// This is a human player avatar.
				_type = OCEmbodimentXMLTags.AVATAR_OBJECT_TYPE;
				_length = OCObjectMapInfo.DEFAULT_AVATAR_LENGTH;
				_width = OCObjectMapInfo.DEFAULT_AVATAR_WIDTH;
				_height = OCObjectMapInfo.DEFAULT_AVATAR_HEIGHT;
			}

			if (gameObject.tag == "OCNPC" || gameObject.tag == "OCAGI" || gameObject.tag == "Player")
			{
				if (_height > 1.1f) // just to make sure that the center point of the character will not be in the block where the feet are
				{
					this.position = new UnityEngine.Vector3(this.position.x, this.position.y, this.position.z + 1.0f);	
				}
			}

						
			if (gameObject.name == "Hearth")
			{
				this.AddProperty("petHome", "TRUE", System.Type.GetType("System.Boolean"));	
			}

			// Get weight
			if (gameObject.rigidbody != null) {
				_weight = gameObject.rigidbody.mass;
			} else {
				_weight = 0.0f;
			}
			
			if (gameObject.GetComponent<OpenCog.Extensions.OCConsumableData>() != null)
			{
				UnityEngine.Debug.Log ("Adding edible and foodbowl tags to '" + gameObject.name + "' with ID " + gameObject.GetInstanceID());
				this.AddProperty ("edible", "TRUE", System.Type.GetType ("System.Boolean"));
				this.AddProperty ("pickupable", "TRUE", System.Type.GetType ("System.Boolean"));
				this.AddProperty ("holder", "none", System.Type.GetType ("System.String"));
			}

			// Get a property manager instance
			// TODO: may need to re-enable this for other object types.
//			OCPropertyManager manager = gameObject.GetComponent<OCPropertyManager> () as OCPropertyManager;
//			if (manager != null) {
//				// Copy all OC properties from the manager, if any.
//				foreach (OpenCog.Serialization.OCPropertyField ocp in manager.propertyList) {
//					this.AddProperty (ocp.Key, ocp.value, ocp.valueType);
//				}
//			}

			this.AddProperty ("visibility-status", "visible", System.Type.GetType("System.String"));
			this.AddProperty ("detector", "true", System.Type.GetType("System.Boolean"));
			
			string gameObjectName = gameObject.name;
			if (gameObjectName.Contains ("("))
				gameObjectName = gameObjectName.Remove (gameObjectName.IndexOf ('('));



			// For Einstein puzzle
			if (gameObject.name.Contains("_man"))
			{
				_id = _name;
				this.AddProperty ("class", "people", System.Type.GetType("System.String"));
			}
			else
			    this.AddProperty ("class", gameObjectName, System.Type.GetType("System.String"));
		}
        public OCObjectMapInfo(UnityEngine.GameObject gameObject)
        {
            UnityEngine.Debug.Log("OCObjectMapInfo::OCObjectMapInfo, passed object is of type: " + gameObject.GetType().ToString() + ", and name " + gameObject.name);

            _id = gameObject.GetInstanceID().ToString();

//			// Get id of a game object
//			_id = gameObject.GetInstanceID ().ToString ();
            // Get name
            _name = gameObject.name;
            // TODO: By default, we are using object type.
            _type = OCEmbodimentXMLTags.ORDINARY_OBJECT_TYPE;

            // Convert from unity coordinate to OAC coordinate.

            this.position = Utility.VectorUtil.ConvertToOpenCogCoord(gameObject.transform.position);
            // Get rotation
            _rotation = new Utility.Rotation(gameObject.transform.rotation);
            // Calculate the velocity later
            _velocity = UnityEngine.Vector3.zero;

            // Get size
            if (gameObject.collider != null)
            {
                // Get size information from collider.
                _width  = gameObject.collider.bounds.size.z;
                _height = gameObject.collider.bounds.size.y;
                _length = gameObject.collider.bounds.size.x;
            }
            else
            {
                OCLogger.Warn("No collider for gameobject " + gameObject.name + ", assuming a point.");

                // Set default value of the size.
                _width  = 0.1f;
                _height = 0.1f;
                _length = 0.1f;
            }

            if (gameObject.tag == "OCAGI")
            {
                // This is an OC avatar, we will use the brain id instead of unity id.
                OCConnectorSingleton connector = OCConnectorSingleton.Instance;

                if (connector != null)
                {
                    _id   = connector.BrainID;
                    _type = OCEmbodimentXMLTags.PET_OBJECT_TYPE;
                }

                UnityEngine.Debug.Log("Just made an OCObjectMapInfo stating the AGI is at [" + this.position.x + ", " + this.position.y + ", " + this.position.z + "]");
            }
            else if (gameObject.tag == "OCNPC")
            {
                // This is a human player avatar.
                _type   = OCEmbodimentXMLTags.AVATAR_OBJECT_TYPE;
                _length = OCObjectMapInfo.DEFAULT_AVATAR_LENGTH;
                _width  = OCObjectMapInfo.DEFAULT_AVATAR_WIDTH;
                _height = OCObjectMapInfo.DEFAULT_AVATAR_HEIGHT;
            }

            if (gameObject.tag == "OCNPC" || gameObject.tag == "OCAGI" || gameObject.tag == "Player")
            {
                if (_height > 1.1f)                 // just to make sure that the center point of the character will not be in the block where the feet are
                {
                    this.position = new UnityEngine.Vector3(this.position.x, this.position.y, this.position.z + 1.0f);
                }
            }


            if (gameObject.name == "Hearth")
            {
                this.AddProperty("petHome", "TRUE", System.Type.GetType("System.Boolean"));
            }

            // Get weight
            if (gameObject.rigidbody != null)
            {
                _weight = gameObject.rigidbody.mass;
            }
            else
            {
                _weight = 0.0f;
            }

            if (gameObject.GetComponent <OpenCog.Extensions.OCConsumableData>() != null)
            {
                UnityEngine.Debug.Log("Adding edible and foodbowl tags to '" + gameObject.name + "' with ID " + gameObject.GetInstanceID());
                this.AddProperty("edible", "TRUE", System.Type.GetType("System.Boolean"));
                this.AddProperty("pickupable", "TRUE", System.Type.GetType("System.Boolean"));
                this.AddProperty("holder", "none", System.Type.GetType("System.String"));
            }

            // Get a property manager instance
            // TODO: may need to re-enable this for other object types.
//			OCPropertyManager manager = gameObject.GetComponent<OCPropertyManager> () as OCPropertyManager;
//			if (manager != null) {
//				// Copy all OC properties from the manager, if any.
//				foreach (OpenCog.Serialization.OCPropertyField ocp in manager.propertyList) {
//					this.AddProperty (ocp.Key, ocp.value, ocp.valueType);
//				}
//			}

            this.AddProperty("visibility-status", "visible", System.Type.GetType("System.String"));
            this.AddProperty("detector", "true", System.Type.GetType("System.Boolean"));

            string gameObjectName = gameObject.name;

            if (gameObjectName.Contains("("))
            {
                gameObjectName = gameObjectName.Remove(gameObjectName.IndexOf('('));
            }



            // For Einstein puzzle
            if (gameObject.name.Contains("_man"))
            {
                _id = _name;
                this.AddProperty("class", "people", System.Type.GetType("System.String"));
            }
            else
            {
                this.AddProperty("class", gameObjectName, System.Type.GetType("System.String"));
            }
        }