Back to project page DolphinOES.
The source code is released under:
Apache License
If you think the Android project DolphinOES listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/******************************************************************************* * Copyright 2014 See AUTHORS file.// www. j av a 2s . c om * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.sidereal.dolphinoes.architecture.core; import com.badlogic.gdx.Files.FileType; import com.badlogic.gdx.Input; import com.badlogic.gdx.utils.ObjectMap; import com.sidereal.dolphinoes.architecture.DolphinOES; import com.sidereal.dolphinoes.architecture.GameScene; import com.sidereal.dolphinoes.architecture.Module; import com.sidereal.dolphinoes.util.DolphinOESException; /** The main settings of the Game made with DolphinOES. Has to be passed to * {@link DolphinOES} in the * {@link DolphinOES#DolphinOESGame(Class, DolphinOESConfiguration, LoadingScreenConfiguration)} * constructor. If the {@link DolphinOESConfiguration} passed is null, the * constructor will create a new instance of {@link DolphinOESConfiguration}, * holding the default values to variables. * <p> * Adding additional variables in future versions will by default make the * framework behave as before they were added, thus this class will be safe to * update from the git server. * * @author Claudiu Bele */ public class DolphinOESConfiguration { // region fields /** List of modules to add to {@link DolphinOES} when an instance of * {@link DolphinOESConfiguration} is passed to the constructor. Elements * should be added using {@link #addModule(Module)}. */ public ObjectMap<Class<? extends Module>, Module> modules; /** Whether debugging can be toggled on or off in the application. In * {@link DolphinOES#create()} the value will be applied to * {@link DolphinOES#debug} in {@link DolphinOES#create()} */ public boolean debugEnabled; /** The root path to all data related to the app. */ public String rootDataPath; /** Whether the application is an executable or not (false by default). * Affects the root path for loading assets, so people responsible with * graphics can change them and start the app to see changes instead of * assets being loaded from the jar file * <p> * If value is set to true, files will be taken using * {@link FileType#Classpath} ( from the executable ), otherwise * {@link FileType#Internal} will be used, files being handled at a location * relative to the executable. * <p> * * @see Assets#getFileType() returns the FileType used in importing tied to * the application * @see Assets#getResolver() */ public boolean isExecutable; /** Whether to prioritise external storage when saving data or not, if the * device allows. */ public boolean prioritiseExternalStorage; /** Initial scene to be displayed after the game is loaded */ public GameScene initialScene; /** Names of input processors to use in {@link Input} */ public String[] inputProcessorNames; // endregion fields // region constructors public DolphinOESConfiguration() { inputProcessorNames = new String[]{"Default"}; debugEnabled = false; prioritiseExternalStorage = false; isExecutable = false; rootDataPath = "Game made with DolphinOES"; modules = new ObjectMap<Class<? extends Module>, Module>(); } /** Adds a module to the list of modules available in the game. Modules can * also be added at runtime using {@link DolphinOES#addModule(Class)}. * <p> * The module will be accessible from game scenes, batches, objects and * behaviors through {@link DolphinOES#getModule(Class)}. * * @param module * @return */ public <T extends Module> DolphinOESConfiguration addModule(T module) { if (module == null) throw new NullPointerException( "DolphinOESConfiguration.addModule parameter 'module' of type Module is null"); if (modules.get(module.getClass()) != null) throw new DolphinOESException( "DolphinOESConfiguration.addModule parameter type " + module.getClass() + " is already in the list of modules"); modules.put(module.getClass(), module); return this; } // endregion }