Example usage for com.badlogic.gdx.utils SharedLibraryLoader isWindows

List of usage examples for com.badlogic.gdx.utils SharedLibraryLoader isWindows

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils SharedLibraryLoader isWindows.

Prototype

boolean isWindows

To view the source code for com.badlogic.gdx.utils SharedLibraryLoader isWindows.

Click Source Link

Usage

From source file:es.danirod.rectball.desktop.DesktopPlatform.java

License:Open Source License

protected DesktopPlatform() {
    sharing = new DesktopSharing();
    score = new LegacyScores() {
        @Override/*ww  w  . j  av a 2 s  . com*/
        protected FileHandle getScoresFile() {
            if (SharedLibraryLoader.isWindows) {
                String location = System.getenv("AppData") + "/rectball/scores";
                return Gdx.files.absolute(location);
            } else if (SharedLibraryLoader.isLinux) {
                return Gdx.files.external(".rectball/scores");
            } else if (SharedLibraryLoader.isMac) {
                return Gdx.files.external("/Library/Application Support/rectball/scores");
            } else {
                return Gdx.files.local("scores");
            }
        }
    };
    preferences = new LwjglPreferences("rectball", ".prefs/");
    statistics = new LegacyStatistics() {
        @Override
        protected FileHandle getStatistics() {
            if (SharedLibraryLoader.isWindows) {
                String location = System.getenv("AppData") + "/rectball/stats";
                return Gdx.files.absolute(location);
            } else if (SharedLibraryLoader.isLinux) {
                return Gdx.files.external(".rectball/stats");
            } else if (SharedLibraryLoader.isMac) {
                return Gdx.files.external("/Library/Application Support/rectball/stats");
            } else {
                return Gdx.files.local("stats");
            }
        }
    };
}