-
Notifications
You must be signed in to change notification settings - Fork 6
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. (#56)
Ref: MovingBlocks/Terasology#4753 Co-authored-by: Tobias Nett <[email protected]>
- Loading branch information
1 parent
c7d9604
commit f29f2be
Showing
8 changed files
with
79 additions
and
78 deletions.
There are no files selected for viewing
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
29 changes: 12 additions & 17 deletions
29
src/main/java/org/terasology/climateConditions/HumidityGeneratorComponent.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,27 +1,22 @@ | ||
/* | ||
* 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.climateConditions; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.world.block.ForceBlockActive; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
@ForceBlockActive | ||
public class HumidityGeneratorComponent implements Component { | ||
public class HumidityGeneratorComponent implements Component<HumidityGeneratorComponent> { | ||
public float humidity; | ||
public float flatRange; | ||
public float maxRange; | ||
public boolean humidifier; | ||
|
||
@Override | ||
public void copyFrom(HumidityGeneratorComponent other) { | ||
this.humidity = other.humidity; | ||
this.flatRange = other.flatRange; | ||
this.maxRange = other.maxRange; | ||
this.humidifier = other.humidifier; | ||
} | ||
} |
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
29 changes: 12 additions & 17 deletions
29
src/main/java/org/terasology/climateConditions/TemperatureGeneratorComponent.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,27 +1,22 @@ | ||
/* | ||
* 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.climateConditions; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.world.block.ForceBlockActive; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
@ForceBlockActive | ||
public class TemperatureGeneratorComponent implements Component { | ||
public class TemperatureGeneratorComponent implements Component<TemperatureGeneratorComponent> { | ||
public float temperature; | ||
public float flatRange; | ||
public float maxRange; | ||
public boolean heater; | ||
|
||
@Override | ||
public void copyFrom(TemperatureGeneratorComponent other) { | ||
this.temperature = other.temperature; | ||
this.flatRange = other.flatRange; | ||
this.maxRange = other.maxRange; | ||
this.heater = other.heater; | ||
} | ||
} |
12 changes: 10 additions & 2 deletions
12
src/main/java/org/terasology/climateConditions/VisibleBreathComponent.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,13 +1,21 @@ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.climateConditions; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.entitySystem.entity.EntityRef; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Augments the world with a visible breath particle effect. Has a desired effect only if the entity has a {@link | ||
* org.terasology.engine.logic.location.LocationComponent} which determines the location and direction of the effect. | ||
* Is added/updated by the {@link VisibleBreathingSystem} periodically. | ||
*/ | ||
public class VisibleBreathComponent implements Component { | ||
public class VisibleBreathComponent implements Component<VisibleBreathComponent> { | ||
public EntityRef particleEntity = EntityRef.NULL; | ||
|
||
@Override | ||
public void copyFrom(VisibleBreathComponent other) { | ||
this.particleEntity = other.particleEntity; | ||
} | ||
} |
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