-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ecs-gestalt): Migrate Components to gestalt's Components. (#15)
Ref: MovingBlocks/Terasology#4753 Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
- Loading branch information
1 parent
c9196bf
commit 4f6c174
Showing
8 changed files
with
100 additions
and
132 deletions.
There are no files selected for viewing
19 changes: 3 additions & 16 deletions
19
src/main/java/org/terasology/oreGeneration/OreGenRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 10 additions & 16 deletions
26
src/main/java/org/terasology/oreGeneration/components/DepthPocketOreGenComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
/* | ||
* Copyright 2014 MovingBlocks | ||
* | ||
* 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. | ||
*/ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.terasology.oreGeneration.components; | ||
|
||
public class DepthPocketOreGenComponent extends BasePocketOreGenComponent { | ||
public class DepthPocketOreGenComponent extends BasePocketOreGenComponent<DepthPocketOreGenComponent> { | ||
public int minDepth; | ||
public int maxDepth; | ||
|
||
@Override | ||
public void copyFrom(DepthPocketOreGenComponent other) { | ||
super.copyFrom(other); | ||
this.minDepth = other.minDepth; | ||
this.maxDepth = other.maxDepth; | ||
} | ||
} |
21 changes: 4 additions & 17 deletions
21
src/main/java/org/terasology/oreGeneration/components/OreGenDefinitionComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
/* | ||
* Copyright 2014 MovingBlocks | ||
* | ||
* 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. | ||
*/ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.terasology.oreGeneration.components; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.EmptyComponent; | ||
|
||
/** | ||
* Add this to a prefab to allow import of all CustomOreGen component triggers into the registry | ||
*/ | ||
public class OreGenDefinitionComponent implements Component { | ||
public class OreGenDefinitionComponent extends EmptyComponent<OreGenDefinitionComponent> { | ||
} |
28 changes: 10 additions & 18 deletions
28
src/main/java/org/terasology/oreGeneration/components/PocketDensityOreGenComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
/* | ||
* Copyright 2014 MovingBlocks | ||
* | ||
* 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. | ||
*/ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.terasology.oreGeneration.components; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
|
||
public class PocketDensityOreGenComponent extends BasePocketOreGenComponent implements Component { | ||
public class PocketDensityOreGenComponent extends BasePocketOreGenComponent<PocketDensityOreGenComponent> { | ||
public int minDensity = 2; | ||
public int maxDensity = Integer.MAX_VALUE; | ||
|
||
@Override | ||
public void copyFrom(PocketDensityOreGenComponent other) { | ||
super.copyFrom(other); | ||
this.minDensity = other.minDensity; | ||
this.maxDensity = other.maxDensity; | ||
} | ||
} |
28 changes: 11 additions & 17 deletions
28
src/main/java/org/terasology/oreGeneration/components/VeinsDensityOreGenComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
/* | ||
* Copyright 2015 MovingBlocks | ||
* | ||
* 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. | ||
*/ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.terasology.oreGeneration.components; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
public class VeinsDensityOreGenComponent extends BaseVeinsOreGenComponent implements Component { | ||
public class VeinsDensityOreGenComponent extends BaseVeinsOreGenComponent implements Component<VeinsDensityOreGenComponent> { | ||
public int minDensity = 2; | ||
public int maxDensity = Integer.MAX_VALUE; | ||
|
||
@Override | ||
public void copyFrom(VeinsDensityOreGenComponent other) { | ||
super.copy(other); | ||
this.minDensity = other.minDensity; | ||
this.maxDensity = other.maxDensity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters