Add class Hierarchy

Dieser Commit ist enthalten in:
D4rkr34lm 2023-10-08 12:06:48 +02:00 committet von yoyosource
Ursprung 44f6d1c15d
Commit 077a9854a5
8 geänderte Dateien mit 50 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,8 @@
package de.steamwar.bausystem.features.simulator2.data;
import java.util.ArrayList;
import java.util.List;
public class Simulator {
private List<SimulatorGroup> elements = new ArrayList<>();
}

Datei anzeigen

@ -1,4 +1,10 @@
package de.steamwar.bausystem.features.simulator2.data;
public abstract class SimulatorElement {
import java.util.ArrayList;
import java.util.List;
public abstract class SimulatorElement<T extends SimulatorSetting> {
protected List<T> settings = new ArrayList<>();
}

Datei anzeigen

@ -1,4 +1,8 @@
package de.steamwar.bausystem.features.simulator2.data;
import java.util.ArrayList;
import java.util.List;
public class SimulatorGroup {
private List<SimulatorElement<?>> elements = new ArrayList<>();
}

Datei anzeigen

@ -0,0 +1,23 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.features.simulator2.data;
public interface SimulatorSetting {
}

Datei anzeigen

@ -1,5 +1,7 @@
package de.steamwar.bausystem.features.simulator2.data.redstone;
public class RedstoneElement {
import de.steamwar.bausystem.features.simulator2.data.SimulatorElement;
public class RedstoneElement extends SimulatorElement<RedstoneSetting> {
}

Datei anzeigen

@ -1,4 +1,6 @@
package de.steamwar.bausystem.features.simulator2.data.redstone;
public class RedstoneSetting {
import de.steamwar.bausystem.features.simulator2.data.SimulatorSetting;
public class RedstoneSetting implements SimulatorSetting {
}

Datei anzeigen

@ -1,4 +1,6 @@
package de.steamwar.bausystem.features.simulator2.data.tnt;
public class TNTElement {
import de.steamwar.bausystem.features.simulator2.data.SimulatorElement;
public class TNTElement extends SimulatorElement<TNTSetting> {
}

Datei anzeigen

@ -1,4 +1,6 @@
package de.steamwar.bausystem.features.simulator2.data.tnt;
public class TNTSetting {
import de.steamwar.bausystem.features.simulator2.data.SimulatorSetting;
public class TNTSetting implements SimulatorSetting {
}