Ejemplo n.º 1
0
    public void Init()
    {
        //create some dummy data

        var date = new DateTime(2019, 1, 1, 8, 0, 0);

        data = new Dictionary <DateTime, UserRecord>();

        while (date < DateTime.Now)
        {
            var record = new UserRecord(date);

            //foreach (var label in dimensionLabels)
            foreach (UserData.Dimensions label in Enum.GetValues(typeof(Dimensions)))
            {
                var res = new UserRecord.Response();

                res.narrative = date.ToString() + "\n" + label + "\n" + "Here's my narrative";
                record.AddResponse(label, res);
            }

            data.Add(record.date, record);

            date = date.AddDays(UserData.rand.Next(2, 4));

            date = date.AddHours(UserData.rand.Next(3, 14));
        }
    }
Ejemplo n.º 2
0
    public void OnCommit()
    {
        GameObject.Find("Canvas").GetComponent <UITestbed>().OnHamburgerSelect("splash");

        var userData = GameObject.Find("Canvas").GetComponent <UITestbed>().userData;

        var record = new UserRecord(DateTime.Now);

        for (var i = 0; i < responses.Length; i++)
        {
            var res = new UserRecord.Response();
            res.narrative = "";
            res.response  = responses[i];
            record.AddResponse(userData.GetDimensionEnum(i), res);
        }

        userData.data.Add(record.date, record);
        userData.Save();
    }