Example #1
0
    private void insertTaste(GameObject go, DateTime dt)
    {
        TasteProperties auxTasteProperties = go.GetComponent <TasteProperties>();
        float           bitter             = 0;
        float           salt  = 0;
        float           sour  = 0;
        float           sweet = 0;
        float           umami = 0;

        if (auxTasteProperties != null)
        {
            bitter = auxTasteProperties.getBitterness();
            salt   = auxTasteProperties.getSaltiness();
            sour   = auxTasteProperties.getSourness();
            sweet  = auxTasteProperties.getSweetness();
            umami  = auxTasteProperties.getUmami();
        }
        RobotTaste rTaste = new RobotTaste(
            dt,                          // the event occurs now
            uIDD.getID(go),              // object  identifier
            bitter,                      // bitter level
            salt,                        // salt level
            sour,                        // sour level
            sweet,                       // sweet level
            umami);                      // umani level

        try                              // Try to access a resource.
        {
            rTaste.insert();             // using dotNetRDF library inserts the information in the triple store
        }
        catch (Exception e)
        {
            Debug.Log("System>>> " + e.Message);                  // change for your: LogError(e);     // Call a custom error logging procedure.
        }
    }
Example #2
0
    public string getStringTasteInformation()
    {
        string str = "";

        foreach (GameObject obj in objectsInTaste)
        {
            str += SEPARATOR;
            str += "\nID: " + uIDD.getID(obj);
            TasteProperties auxTasteProperties = obj.GetComponent <TasteProperties>();
            if (auxTasteProperties != null)
            {
                str += "\n" + auxTasteProperties.getTasteStatus();
            }
            else
            {
                str += "\nSwetness: " + 0;
                str += "\nSourness: " + 0;
                str += "\nSaltiness: " + 0;
                str += "\nBitterness: " + 0;
                str += "\nUmami: " + 0;
            }
            str += "\n";
        }

        return(str);
    }
Example #3
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);
    }