Rev 112 |
Rev 129 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
package com.gebauz.pingK.common.game;
import java.util.Random;
/** This class uses the Service Locator pattern to provide required globally accessible objects.
*/
public class GameServices
{
private static Font mFont =
null;
// private static Context mContext = null;
private static Random mRandomizer =
new Random();
private static boolean mAdsEnabled =
false;
public static void initServices
()
{
// mContext = context;
mFont =
new Font();
}
/* static public Context getContext()
{
return mContext;
}*/
public static Font getFont
()
{
return mFont
;
}
public static Random getRandomizer
()
{
return mRandomizer
;
}
public static float getRandomFloat
(float min,
float max
)
{
return min + mRandomizer.
nextFloat() * (max-min
);
}
public static boolean areAdsEnabled
()
{
return mAdsEnabled
;
}
public static void setAdsEnabled
(boolean adsEnabled
)
{
mAdsEnabled = adsEnabled
;
}
}