Android Open Source - jmjuanesFramework Game Data






From Project

Back to project page jmjuanesFramework.

License

The source code is released under:

MIT License

If you think the Android project jmjuanesFramework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jmjuanes.core;
//from ww w  . j ava2s  . c  om
import jmjuanes.Config;
import android.content.Context;
import android.content.SharedPreferences;

//Subclase para manejar los records
public class GameData
{
  //Context
  private final Context context;
  
  //Nombre del contenedor de records
  public static final String PREFS_NAME = Config.ID;
  
  //Constructor
  public GameData(Context context)
  {
    this.context = context;
  }
  
  //Para obener el record
  public int Get(String name)
  {
    SharedPreferences sp = context.getSharedPreferences(PREFS_NAME, 0);
     return sp.getInt(name, 0);
  }
  
  //Para guardar el record
  public void Set(String name, int value)
  {
    SharedPreferences sp = context.getSharedPreferences(PREFS_NAME, 0);
    SharedPreferences.Editor editor = sp.edit();
    editor.putInt(name, value);
    editor.commit();
  }
}




Java Source Code List

jmjuanes.Config.java
jmjuanes.GameMain.java
jmjuanes.Screen.java
jmjuanes.core.GameData.java
jmjuanes.core.GameFrames.java
jmjuanes.core.GameLoad.java
jmjuanes.core.GameThread.java
jmjuanes.core.GameTouch.java
jmjuanes.core.GameView.java
jmjuanes.util.Mathm.java
jmjuanes.util.Ui.java