-
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. (#21)
Ref: MovingBlocks/Terasology#4753 Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
- Loading branch information
1 parent
692b8c6
commit 841e731
Showing
6 changed files
with
53 additions
and
102 deletions.
There are no files selected for viewing
26 changes: 9 additions & 17 deletions
26
src/main/java/org/terasology/herbalism/component/GeneratedHerbComponent.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,26 +1,18 @@ | ||
/* | ||
* 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.herbalism.component; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* This component is used for storing the base genome of a generated herb. | ||
*/ | ||
public final class GeneratedHerbComponent implements Component { | ||
public final class GeneratedHerbComponent implements Component<GeneratedHerbComponent> { | ||
/** A string description of this herb's base genome. */ | ||
public String herbBaseGenome; | ||
|
||
@Override | ||
public void copyFrom(GeneratedHerbComponent other) { | ||
this.herbBaseGenome = other.herbBaseGenome; | ||
} | ||
} |
21 changes: 4 additions & 17 deletions
21
src/main/java/org/terasology/herbalism/component/HerbComponent.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.herbalism.component; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.EmptyComponent; | ||
|
||
/** | ||
* Add this component to an item to indicate that it is a herb. | ||
*/ | ||
public class HerbComponent implements Component { | ||
public class HerbComponent extends EmptyComponent<HerbComponent> { | ||
} |
27 changes: 10 additions & 17 deletions
27
src/main/java/org/terasology/herbalism/component/HerbHueComponent.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,20 @@ | ||
/* | ||
* 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.herbalism.component; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import com.google.common.collect.Lists; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This component is used for storing the hue ranges of a particular herb. | ||
*/ | ||
public class HerbHueComponent implements Component { | ||
public class HerbHueComponent implements Component<HerbHueComponent> { | ||
public List<String> hueRanges; | ||
|
||
@Override | ||
public void copyFrom(HerbHueComponent other) { | ||
this.hueRanges = Lists.newArrayList(other.hueRanges); | ||
} | ||
} |
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
21 changes: 4 additions & 17 deletions
21
src/main/java/org/terasology/herbalism/component/PollinatingHerbComponent.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.herbalism.component; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.EmptyComponent; | ||
|
||
/** | ||
* Add this component to an item (specficially an herb) to indicate that it's pollinating. | ||
*/ | ||
public class PollinatingHerbComponent implements Component { | ||
public class PollinatingHerbComponent extends EmptyComponent<PollinatingHerbComponent> { | ||
} |
26 changes: 9 additions & 17 deletions
26
src/main/java/org/terasology/herbalism/component/PredefinedHerbComponent.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,26 +1,18 @@ | ||
/* | ||
* 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.herbalism.component; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Add this component to an item to indicate that it is a predefined herb. That is, a prefab was directly used to generate | ||
* this. | ||
*/ | ||
public final class PredefinedHerbComponent implements Component { | ||
public final class PredefinedHerbComponent implements Component<PredefinedHerbComponent> { | ||
public String herbBaseGenome; | ||
|
||
@Override | ||
public void copyFrom(PredefinedHerbComponent other) { | ||
this.herbBaseGenome = other.herbBaseGenome; | ||
} | ||
} |