Exemple #1
0
    /*
     * 0 uuid
     * 1 place_id  1-12 100 101 200
     * 2 type
     * 3 stage
     * 4 happiness_level
     * 5 water_level
     * 6 happiness_desc
     * 7 water_desc
     * 8 dust_give
     * 9 stage_timer
     */
    private void CheckHappinessReduce()
    {
        //happens every minute for every plant
        var start   = DateTime.Now;
        var oldDate = DateTime.Parse(plantStats[6]);

        if ((start - oldDate).TotalMinutes >= 1)
        {
            plantStats[4] = (Int16.Parse(plantStats[4]) - love_down_per_minute).ToString();
            plantStats[6] = DateTime.Now.ToString();
            //database

            db.ChangeHappinessLevel(transform.name, plantStats[4]);
            db.ChangeHappinessDate(transform.name, plantStats[6]);
        }
    }