Exemplo n.º 1
0
    public string getStringTouchInformation()
    {
        string str = "";

        foreach (GameObject obj in touchInTouch)
        {
            str += SEPARATOR;
            str += "\nPosition: " + obj.transform.position;
            TouchProperties auxTouchProperties = obj.GetComponent <TouchProperties>();
            if (auxTouchProperties != null)
            {
                str += "\n" + auxTouchProperties.getTouchStatus();
            }
            else
            {
                str += "\nTemperature: " + Constants.ROOM_TEMPERATURE + " ºC";
                str += "\nPressure: " + 0;
                str += "\nPressure: " + 0;
                str += "\nRoughness: " + 0;
                str += "\nMoistness: " + 0;
                str += "\nHardness: " + 0;
            }
            str += "\n";
        }
        foreach (GameObject obj in knowObjInTouch)
        {
            str += SEPARATOR;
            str += "\nID: " + uIDD.getID(obj);
            TouchProperties auxTouchProperties = obj.GetComponent <TouchProperties>();
            if (auxTouchProperties != null)
            {
                str += "\n" + auxTouchProperties.getTouchStatus();
            }
            else
            {
                str += "\nTemperature: " + Constants.ROOM_TEMPERATURE + " ºC";
                str += "\nPressure: " + 0;
                str += "\nPressure: " + 0;
                str += "\nRoughness: " + 0;
                str += "\nMoistness: " + 0;
                str += "\nHardness: " + 0;
            }
            str += "\n";
        }
        return(str);
    }
Exemplo n.º 2
0
    private string buildPropertiesString(GameObject gO)
    {
        string          sensesProperty     = "";
        string          especificProperty  = "";
        string          emotionProperty    = "";
        SmellProperties auxSmellProperties = gO.GetComponent <SmellProperties>();

        if (auxSmellProperties != null)
        {
            sensesProperty += auxSmellProperties.getSmellStatus();
        }

        TasteProperties auxTasteProperties = gO.GetComponent <TasteProperties>();

        if (auxTasteProperties != null)
        {
            sensesProperty += "\n" + auxTasteProperties.getTasteStatus();
        }

        HearingProperties auxHearingProperties = gO.GetComponent <HearingProperties>();

        if (auxHearingProperties != null)
        {
            sensesProperty += "\n" + auxHearingProperties.getHearingStatus();
        }

        TouchProperties auxTouchProperties = gO.GetComponent <TouchProperties>();

        if (auxTouchProperties != null)
        {
            sensesProperty += "\n" + auxTouchProperties.getTouchStatus();
        }

        VisionProperties auxVisionProperties = gO.GetComponent <VisionProperties>();

        if (auxVisionProperties != null)
        {
            sensesProperty += "\n" + auxVisionProperties.getVisionStatus();
        }
        EmotionStatus auxEmotionStatus = gO.GetComponent <EmotionStatus>();

        if (auxEmotionStatus != null)
        {
            emotionProperty = auxEmotionStatus.getEmotion().ToString();
        }
        Status auxStatus = gO.GetComponent <Status>();

        if (auxStatus != null)
        {
            especificProperty = auxStatus.getStringStatus();
        }



        string auxText = "ID: " + gO.GetInstanceID() + "\n" + gO.tag + ": " + gO.name +
                         "\nPosition: " + gO.transform.position;

        if (!sensesProperty.Equals("None"))
        {
            auxText += "\n" + sensesProperty;
        }
        if (emotionProperty.Equals(""))
        {
            emotionProperty = "None";
        }
        if (especificProperty.Equals(""))
        {
            especificProperty = "None";
        }
        auxText += "\nStatus: " + especificProperty;
        auxText += "\nEmotion: " + emotionProperty;

        return(auxText);
    }