Refactoring X
This commit is contained in:
parent
ce996b8e1e
commit
9ec104f518
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxAssetInterface {
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxAudioInterface {
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxInputInterface {
|
||||
|
||||
}
|
@ -30,5 +30,11 @@ public interface FBoxInterface {
|
||||
void exit();
|
||||
Platform getPlatform();
|
||||
FBoxGraphicsInterface graphics();
|
||||
FBoxAudioInterface audio();
|
||||
FBoxInputInterface input();
|
||||
FBoxNetInterface net();
|
||||
FBoxAssetInterface asset();
|
||||
FBoxStorageInterface storage();
|
||||
FBoxUtilsInterface utils();
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxNetInterface {
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxStorageInterface {
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FBoxUtilsInterface {
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.core;
|
||||
|
||||
import com.openeggbert.core.fbox.impl.libgdx.FBoxLibGdxImpl;
|
||||
import com.openeggbert.core.fbox.impl.libgdx.FBoxLibGDXImpl;
|
||||
import com.openeggbert.core.fbox.api.FBoxInterface;
|
||||
|
||||
/**
|
||||
@ -34,7 +34,7 @@ public class FBox {
|
||||
}
|
||||
public static FBoxInterface get() {
|
||||
if(INSTANCE == null) {
|
||||
INSTANCE = new FBoxLibGdxImpl();
|
||||
INSTANCE = new FBoxLibGDXImpl();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.core;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public abstract class FBoxGame extends com.badlogic.gdx.Game {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.core;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public abstract class FBoxScreen extends com.badlogic.gdx.ScreenAdapter {
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxAssetInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxAssetLibGDXImpl implements FBoxAssetInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxAudioInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxAudioLibGDXImpl implements FBoxAudioInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -32,7 +32,7 @@ import com.openeggbert.core.fbox.api.FBoxGraphicsInterface;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxGraphicsLibGdxImpl implements FBoxGraphicsInterface {
|
||||
public class FBoxGraphicsLibGDXImpl implements FBoxGraphicsInterface {
|
||||
|
||||
|
||||
@Override
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxInputInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxInputLibGDXImpl implements FBoxInputInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import static com.badlogic.gdx.Application.ApplicationType.Desktop;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.openeggbert.core.fbox.api.FBoxAssetInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxAudioInterface;
|
||||
import com.openeggbert.core.fbox.core.DefinitiveFrameworkException;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
import com.openeggbert.core.fbox.api.FBoxGraphicsInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxInputInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxNetInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxStorageInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxUtilsInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxLibGDXImpl implements FBoxInterface {
|
||||
|
||||
private FBoxGraphicsInterface fBoxGraphicsLibGdxImpl = null;
|
||||
private FBoxAudioInterface fBoxAudioLibGdxImpl = null;
|
||||
private FBoxInputInterface fBoxInputLibGdxImpl = null;
|
||||
private FBoxNetInterface fBoxNetLibGdxImpl = null;
|
||||
private FBoxAssetInterface fBoxAssetLibGdxImpl = null;
|
||||
private FBoxStorageInterface fBoxStorageLibGdxImpl = null;
|
||||
private FBoxUtilsInterface fBoxUtilsLibGdxImpl = null;
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public Platform getPlatform() {
|
||||
Application.ApplicationType applicationType = Gdx.app.getType();
|
||||
switch (applicationType) {
|
||||
case Desktop:
|
||||
return Platform.DESKTOP;
|
||||
case Android:
|
||||
return Platform.ANDROID;
|
||||
case WebGL:
|
||||
return Platform.WEB;
|
||||
default:
|
||||
throw new DefinitiveFrameworkException("Unsupported platform: " + applicationType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxGraphicsInterface graphics() {
|
||||
if (fBoxGraphicsLibGdxImpl == null) {
|
||||
fBoxGraphicsLibGdxImpl = new FBoxGraphicsLibGDXImpl();
|
||||
}
|
||||
return fBoxGraphicsLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxAudioInterface audio() {
|
||||
|
||||
if (fBoxAudioLibGdxImpl == null) {
|
||||
fBoxAudioLibGdxImpl = new FBoxAudioLibGDXImpl();
|
||||
}
|
||||
return fBoxAudioLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxInputInterface input() {
|
||||
|
||||
if (fBoxInputLibGdxImpl == null) {
|
||||
fBoxInputLibGdxImpl = new FBoxInputLibGDXImpl();
|
||||
}
|
||||
return fBoxInputLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxNetInterface net() {
|
||||
|
||||
if (fBoxNetLibGdxImpl == null) {
|
||||
fBoxNetLibGdxImpl = new FBoxNetLibGDXImpl();
|
||||
}
|
||||
return fBoxNetLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxAssetInterface asset() {
|
||||
|
||||
if (fBoxAssetLibGdxImpl == null) {
|
||||
fBoxAssetLibGdxImpl = new FBoxAssetLibGDXImpl();
|
||||
}
|
||||
return fBoxAssetLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxStorageInterface storage() {
|
||||
|
||||
if (fBoxStorageLibGdxImpl == null) {
|
||||
fBoxStorageLibGdxImpl = new FBoxStorageLibGDXImpl();
|
||||
}
|
||||
return fBoxStorageLibGdxImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxUtilsInterface utils() {
|
||||
|
||||
if (fBoxUtilsLibGdxImpl == null) {
|
||||
fBoxUtilsLibGdxImpl = new FBoxUtilsLibGDXImpl();
|
||||
}
|
||||
return fBoxUtilsLibGdxImpl; }
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import static com.badlogic.gdx.Application.ApplicationType.Desktop;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.openeggbert.core.fbox.core.DefinitiveFrameworkException;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
import com.openeggbert.core.fbox.api.FBoxGraphicsInterface;
|
||||
import com.openeggbert.core.fbox.api.FBoxInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxLibGdxImpl implements FBoxInterface {
|
||||
|
||||
private FBoxGraphicsLibGdxImpl fBoxGraphicsLibGdxImpl = null;
|
||||
@Override
|
||||
public void exit() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public Platform getPlatform() {
|
||||
Application.ApplicationType applicationType = Gdx.app.getType();
|
||||
switch(applicationType) {
|
||||
case Desktop: return Platform.DESKTOP;
|
||||
case Android: return Platform.ANDROID;
|
||||
case WebGL: return Platform.WEB;
|
||||
default: throw new DefinitiveFrameworkException("Unsupported platform: " + applicationType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FBoxGraphicsInterface graphics() {
|
||||
if(fBoxGraphicsLibGdxImpl == null) {
|
||||
fBoxGraphicsLibGdxImpl = new FBoxGraphicsLibGdxImpl();
|
||||
}
|
||||
return fBoxGraphicsLibGdxImpl;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxNetInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxNetLibGDXImpl implements FBoxNetInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxStorageInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxStorageLibGDXImpl implements FBoxStorageInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Open Eggbert: Free recreation of the computer game Speedy Eggbert.
|
||||
// Copyright (C) 2024 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.fbox.impl.libgdx;
|
||||
|
||||
import com.openeggbert.core.fbox.api.FBoxUtilsInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class FBoxUtilsLibGDXImpl implements FBoxUtilsInterface {
|
||||
|
||||
|
||||
|
||||
}
|
@ -20,7 +20,6 @@
|
||||
package com.openeggbert.core.main;
|
||||
|
||||
import com.openeggbert.core.utils.AssetsTxt;
|
||||
import com.badlogic.gdx.Game;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Camera;
|
||||
@ -40,6 +39,7 @@ import com.openeggbert.core.screen.InitScreen;
|
||||
import com.openeggbert.gdx.storage.Storage;
|
||||
import com.openeggbert.gdx.storage.StorageImplementationLoader;
|
||||
import com.openeggbert.core.configuration.OpenEggbertDisplayMode;
|
||||
import com.openeggbert.core.fbox.core.FBoxGame;
|
||||
import com.openeggbert.core.utils.OpenEggbertUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -51,7 +51,7 @@ import lombok.Data;
|
||||
* platforms.
|
||||
*/
|
||||
@Data
|
||||
public class OpenEggbertGame extends Game {
|
||||
public class OpenEggbertGame extends FBoxGame {
|
||||
|
||||
private Texture image;
|
||||
private GameSpace gameSpace = null;
|
||||
|
@ -19,8 +19,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.core.music;
|
||||
|
||||
import com.openeggbert.core.image.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
package com.openeggbert.core.music;
|
||||
|
||||
import com.openeggbert.core.release.Release;
|
||||
|
@ -22,12 +22,11 @@ package com.openeggbert.core.screen;
|
||||
import com.badlogic.gdx.Application;
|
||||
import static com.badlogic.gdx.Application.LOG_INFO;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.ScreenAdapter;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.openeggbert.core.fbox.core.FBoxScreen;
|
||||
import com.openeggbert.core.gamespace.GameFileType;
|
||||
import com.openeggbert.core.main.OpenEggbertException;
|
||||
import com.openeggbert.core.main.OpenEggbertGame;
|
||||
import com.openeggbert.core.utils.OpenEggbertUtils;
|
||||
import java.util.List;
|
||||
@ -37,7 +36,7 @@ import java.util.Optional;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public abstract class AbstractOpenEggbertScreen extends ScreenAdapter {
|
||||
public abstract class AbstractOpenEggbertScreen extends FBoxScreen {
|
||||
|
||||
protected OpenEggbertGame game;
|
||||
protected SpriteBatch batch;
|
||||
@ -48,7 +47,7 @@ public abstract class AbstractOpenEggbertScreen extends ScreenAdapter {
|
||||
loadBackgroundTextureIfNeeded();
|
||||
}
|
||||
|
||||
private final String getBackgroundFileName() {
|
||||
private String getBackgroundFileName() {
|
||||
//return "INIT.BLP.BMP";
|
||||
return getScreenType().isPresent() ? getScreenType().get().getFileNameWithoutExtension(): "";
|
||||
}
|
||||
|
@ -95,29 +95,29 @@ public class InitScreen extends AbstractOpenEggbertScreen {
|
||||
Gdx.input.setInputProcessor(new InputAdapter() {
|
||||
|
||||
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
|
||||
timeSeconds = 0f;
|
||||
// timeSeconds = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean touchCancelled(int screenX, int screenY, int pointer, int button) {
|
||||
timeSeconds = 0f;
|
||||
// timeSeconds = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean touchDragged(int screenX, int screenY, int pointer) {
|
||||
timeSeconds = 0f;
|
||||
// timeSeconds = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseMoved(int screenX, int screenY) {
|
||||
timeSeconds = 0f;
|
||||
//timeSeconds = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyDown(int keyCode) {
|
||||
timeSeconds = 0f;
|
||||
// timeSeconds = 0f;
|
||||
|
||||
if (keyCode == Input.Keys.ESCAPE) {
|
||||
Gdx.app.exit();
|
||||
@ -145,7 +145,8 @@ public class InitScreen extends AbstractOpenEggbertScreen {
|
||||
public void renderOpenEggbertScreen(float delta) {
|
||||
timeSeconds += Gdx.graphics.getRawDeltaTime();
|
||||
|
||||
if (timeSeconds >= 60) {
|
||||
if (timeSeconds >= 50) {
|
||||
timeSeconds = 0;
|
||||
game.setScreen(new DemoScreen(game));
|
||||
}
|
||||
ScreenUtils.clear(0f, 0f, 0f, 1f);
|
||||
|
@ -20,8 +20,6 @@
|
||||
package com.openeggbert.core.sprite;
|
||||
|
||||
import com.openeggbert.core.main.OpenEggbertException;
|
||||
import com.openeggbert.core.utils.OpenEggbertUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.openeggbert.core.sprite;
|
||||
|
||||
import com.openeggbert.core.main.OpenEggbertException;
|
||||
import com.openeggbert.core.utils.OpenEggbertUtils;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import lombok.Getter;
|
||||
|
@ -19,7 +19,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.gdx.storage;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface Storage {
|
||||
|
||||
Application.ApplicationType getApplicationType();
|
||||
Platform getPlatform();
|
||||
|
||||
public String cd(String path);
|
||||
|
||||
|
@ -23,8 +23,8 @@ import com.openeggbert.gdx.storage.map.WebGLStorage;
|
||||
import com.openeggbert.gdx.storage.map.MemoryStorage;
|
||||
import com.openeggbert.gdx.storage.filesystem.AndroidStorage;
|
||||
import com.openeggbert.gdx.storage.filesystem.DesktopStorage;
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.openeggbert.core.fbox.core.FBox;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -38,24 +38,24 @@ public class StorageImplementationLoader {
|
||||
private static Storage storage = null;
|
||||
|
||||
public static Storage getStorage() {
|
||||
final Application.ApplicationType type = Gdx.app.getType();
|
||||
final Platform platform = FBox.get().getPlatform();
|
||||
if (storage == null) {
|
||||
storage = new MemoryStorage();
|
||||
}
|
||||
if (storage == null) {
|
||||
|
||||
if (type == Application.ApplicationType.Desktop) {
|
||||
if (platform.isDesktop()) {
|
||||
storage = new DesktopStorage();
|
||||
}
|
||||
if (type == Application.ApplicationType.Android) {
|
||||
if (platform.isAndroid()) {
|
||||
storage = new AndroidStorage();
|
||||
}
|
||||
if (type == Application.ApplicationType.WebGL) {
|
||||
if (platform.isWeb()) {
|
||||
storage = new WebGLStorage();
|
||||
}
|
||||
}
|
||||
if (storage == null) {
|
||||
throw new GdxStorageException("Platform is not supported: " + type);
|
||||
throw new GdxStorageException("Platform is not supported: " + platform);
|
||||
}
|
||||
return storage;
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.gdx.storage.filesystem;
|
||||
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
@ -27,5 +29,8 @@ public class AndroidStorage extends DesktopAndroidStorage {
|
||||
|
||||
public AndroidStorage() {
|
||||
}
|
||||
|
||||
|
||||
public Platform getPlatform() {
|
||||
return Platform.ANDROID;
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
package com.openeggbert.gdx.storage.filesystem;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
import com.openeggbert.gdx.storage.Storage;
|
||||
import java.util.List;
|
||||
|
||||
@ -33,7 +34,7 @@ public abstract class DesktopAndroidStorage implements Storage {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application.ApplicationType getApplicationType() {
|
||||
public Platform getPlatform() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.gdx.storage.filesystem;
|
||||
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
@ -27,5 +29,8 @@ public class DesktopStorage extends DesktopAndroidStorage {
|
||||
|
||||
public DesktopStorage() {
|
||||
}
|
||||
|
||||
|
||||
public Platform getPlatform() {
|
||||
return Platform.DESKTOP;
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ package com.openeggbert.gdx.storage.map;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
import com.openeggbert.gdx.storage.GdxStorageException;
|
||||
import com.openeggbert.gdx.storage.GdxStorageUtils;
|
||||
import com.openeggbert.gdx.storage.Storage;
|
||||
@ -49,7 +50,7 @@ public class MapStorage implements Storage {
|
||||
private String workingDirectory = "/";
|
||||
|
||||
@Override
|
||||
public Application.ApplicationType getApplicationType() {
|
||||
public Platform getPlatform() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.openeggbert.gdx.storage.map;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -28,7 +28,7 @@ import com.badlogic.gdx.Application;
|
||||
public class MemoryStorage extends MapStorage {
|
||||
|
||||
@Override
|
||||
public Application.ApplicationType getApplicationType() {
|
||||
public Platform getPlatform() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,16 @@ package com.openeggbert.gdx.storage.map;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Preferences;
|
||||
import com.openeggbert.core.fbox.entity.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class WebGLStorage extends MapStorage {
|
||||
public Platform getPlatform() {
|
||||
return Platform.WEB;
|
||||
}
|
||||
public WebGLStorage() {
|
||||
this("open-eggbert.webGL.Local-Storage");
|
||||
}
|
||||
|
Reference in New Issue
Block a user