package com.example.apretamemm import android.content.Context import android.content.SharedPreferences class Prefs(context: Context) { val PREFS_NAME = "com.example.apretamemm" val SHARED_NAME = "shared_name" val SHARED_POINTS = "shared_points" val SHARED_POINTS2 = "shared_points2" val prefs: SharedPreferences = context.getSharedPreferences(PREFS_NAME, 0) var name: String? get() = prefs.getString(SHARED_NAME, "") set(value) = prefs.edit().putString(SHARED_NAME, value).apply() var points: Int get() = prefs.getInt(SHARED_POINTS, 0) set(value) = prefs.edit().putInt(SHARED_POINTS, value).apply() var points2: Int get() = prefs.getInt(SHARED_POINTS2, 0) set(value) = prefs.edit().putInt(SHARED_POINTS2, value).apply() }