Public GameSettings getNewSettings()? How do I fill it out?

I'm trying to change a BaseGame to a FixedFrameRateGame, and It's saying I need a public GameSettings getNewSettings() method. Now I tried filling out like this:



public GameSettings getNewSettings(){
      return null;
   }

it gives me a nullpointerexception when I try to run it.

So how do I fill this method out?

bump

Well thanks for completely ******* ignoring me. I'm not going to use this shitty engine anyway. Later.



Edit: censored

Do you really expect people to sit around answering questions on christmas eve?



And if you define something as "null", it is most likely going to cause a null pointer exception.



You should have a look at GameSetting's constructor, and see what parameters you need to pass, then return "new GameSettings()", with the parameters inside.



Merry christmas, and good luck with your new engine.

rickard said:


You should have a look at GameSetting's constructor, and see what parameters you need to pass, then return "new GameSettings()", with the parameters inside.



I am trying to return new GameSettings but I get this error Cannot instantiate the type GameSettings

GameSettings is an interface, so it cannot be instantiated.

AbstractGameSettings is an abstract class that implements GameSettings.

The two classes in JME that currently extend AbstractGameSettings (that I'm aware of anyhow) are PreferencesGameSettings and PropertiesGameSettings.

They use different systems for saving the settings, but are very similar otherwise.

Try instantiating and returning one of those instead.

To see how things like that are done, its easiest look at the different already existing implementations.

If you know your IDE its really easy to see what already exists. (CTRL-T on any type in eclipse for example)



PropertiesGameSettings uses a property file 'properties.cfg' to save the settings

PreferencesGameSettings uses the preference system which is the registry in windows or ~/.java/.userPrefs in linux

Thank you guys! I'll try to implement you suggestions.