-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make ClimateConditions completely optional
- Loading branch information
Showing
4 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/java/org/terasology/gf/EnvironmentParametersSystem.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.gf; | ||
|
||
import org.joml.Vector3ic; | ||
import org.terasology.climateConditions.ClimateConditionsSystem; | ||
import org.terasology.engine.entitySystem.systems.BaseComponentSystem; | ||
import org.terasology.engine.entitySystem.systems.RegisterSystem; | ||
import org.terasology.engine.registry.In; | ||
import org.terasology.engine.registry.Share; | ||
import org.terasology.gf.util.EnvironmentLocalParameters; | ||
import org.terasology.gf.util.LocalParameters; | ||
|
||
@RegisterSystem | ||
@Share(EnvironmentParametersSystem.class) | ||
public class EnvironmentParametersSystem extends BaseComponentSystem { | ||
@In | ||
private ClimateConditionsSystem climateConditionsSystem; | ||
|
||
public LocalParameters createLocalParameters(Vector3ic position) { | ||
return new EnvironmentLocalParameters(climateConditionsSystem, position); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/org/terasology/gf/util/StaticLocalParameters.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.gf.util; | ||
|
||
public class StaticLocalParameters implements LocalParameters { | ||
|
||
@Override | ||
public float getTemperature() { | ||
return 0.5f; | ||
} | ||
|
||
@Override | ||
public float getHumidity() { | ||
return 0.5f; | ||
} | ||
} |