Skip to content

Commit

Permalink
fix(ecs-gestalt): Migrate Components to gestalt's Components. (#26)
Browse files Browse the repository at this point in the history
Ref: MovingBlocks/Terasology#4753

Co-authored-by: Michael Pollind <mpollind@gmail.com>
Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
  • Loading branch information
3 people committed Aug 25, 2021
1 parent 00e272d commit 0943cc9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.inferno.generator.providers;

import org.joml.Vector3f;
import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.utilities.procedural.AbstractNoise;
import org.terasology.engine.utilities.procedural.Noise;
import org.terasology.engine.utilities.procedural.PerlinNoise;
Expand All @@ -15,6 +14,7 @@
import org.terasology.engine.world.generation.GeneratingRegion;
import org.terasology.engine.world.generation.Produces;
import org.terasology.engine.world.generation.Requires;
import org.terasology.gestalt.entitysystem.component.Component;
import org.terasology.inferno.generator.facets.CaveFacet;
import org.terasology.inferno.generator.facets.InfernoSurfaceHeightFacet;
import org.terasology.nui.properties.Range;
Expand Down Expand Up @@ -95,7 +95,7 @@ public void setConfiguration(Component configuration) {
this.configuration = (CaveFacetProviderConfiguration) configuration;
}

private static class CaveFacetProviderConfiguration implements Component {
private static class CaveFacetProviderConfiguration implements Component<CaveFacetProviderConfiguration> {
@Range(min = 0, max = 1f, increment = 0.05f, precision = 2, description = "Amount of Caves")
public float amountOfCaves = 0.75f;
@Range(min = 0, max = 2f, increment = 0.05f, precision = 2, description = "Width")
Expand All @@ -109,6 +109,15 @@ private static class CaveFacetProviderConfiguration implements Component {
@Range(min = -1f, max = 1, increment = 0.05f, precision = 2, description = "Raw Amount (use at own risk)")
public float rawAmount = 0.3f;

@Override
public void copyFrom(CaveFacetProviderConfiguration other) {
this.amountOfCaves = other.amountOfCaves;
this.width = other.width;
this.height = other.height;
this.amountofCavesNearSurface = other.amountofCavesNearSurface;
this.gradualIncreaseOverDepth = other.gradualIncreaseOverDepth;
this.rawAmount = other.rawAmount;
}
}

public static class RidgedNoise extends AbstractNoise {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
/*
* Copyright 2016 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.inferno.world;

import org.terasology.engine.entitySystem.Component;
import org.terasology.gestalt.entitysystem.component.Component;

public class InfernoResurrectComponent implements Component {
public class InfernoResurrectComponent implements Component<InfernoResurrectComponent> {
@Override
public void copyFrom(InfernoResurrectComponent other) {

}
}

0 comments on commit 0943cc9

Please sign in to comment.