From 2fab715b0adc08303f25106f5bc1cf7f29730a31 Mon Sep 17 00:00:00 2001 From: DarkWeird Date: Fri, 9 Jul 2021 16:53:19 +0300 Subject: [PATCH 1/2] fix(ecs-gestalt): Migrate Components to gestalt's Components. --- .../genome/component/GenomeComponent.java | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/terasology/genome/component/GenomeComponent.java b/src/main/java/org/terasology/genome/component/GenomeComponent.java index d89cdd5..3d4e3b5 100644 --- a/src/main/java/org/terasology/genome/component/GenomeComponent.java +++ b/src/main/java/org/terasology/genome/component/GenomeComponent.java @@ -1,32 +1,19 @@ -/* - * 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.genome.component; -import org.terasology.engine.entitySystem.Component; -import org.terasology.module.inventory.components.ItemDifferentiating; import org.terasology.engine.network.Replicate; import org.terasology.engine.world.block.ForceBlockActive; import org.terasology.engine.world.block.items.AddToBlockBasedItem; +import org.terasology.gestalt.entitysystem.component.Component; +import org.terasology.module.inventory.components.ItemDifferentiating; /** * A component that defines genome-related attributes of an entity. */ @ForceBlockActive @AddToBlockBasedItem -public class GenomeComponent implements Component, ItemDifferentiating { +public class GenomeComponent implements Component, ItemDifferentiating { /** The type of the genome. */ @Replicate public String genomeId; @@ -73,4 +60,10 @@ public int hashCode() { result = 31 * result + (genes != null ? genes.hashCode() : 0); return result; } + + @Override + public void copy(GenomeComponent other) { + this.genomeId = other.genomeId; + this.genomeId = other.genes; + } } From aba348fd7ea6a7d98b870b3c45fef259a45f4ec0 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sat, 14 Aug 2021 12:19:00 +0200 Subject: [PATCH 2/2] chore: rename copy >>> copyFrom (as per MovingBlocks/gestalt#123) --- .../java/org/terasology/genome/component/GenomeComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/terasology/genome/component/GenomeComponent.java b/src/main/java/org/terasology/genome/component/GenomeComponent.java index 3d4e3b5..3413920 100644 --- a/src/main/java/org/terasology/genome/component/GenomeComponent.java +++ b/src/main/java/org/terasology/genome/component/GenomeComponent.java @@ -62,7 +62,7 @@ public int hashCode() { } @Override - public void copy(GenomeComponent other) { + public void copyFrom(GenomeComponent other) { this.genomeId = other.genomeId; this.genomeId = other.genes; }