-
Notifications
You must be signed in to change notification settings - Fork 18
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. (#68)
Ref: MovingBlocks/Terasology#4753 Co-authored-by: Michael Pollind <mpollind@gmail.com> Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
- Loading branch information
1 parent
7dd1972
commit abfccce
Showing
10 changed files
with
89 additions
and
171 deletions.
There are no files selected for viewing
26 changes: 9 additions & 17 deletions
26
src/main/java/org/terasology/gooeysQuests/GooeyComponent.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,29 +1,21 @@ | ||
/* | ||
* 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.gooeysQuests; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.entitySystem.entity.EntityRef; | ||
import org.terasology.engine.network.FieldReplicateType; | ||
import org.terasology.engine.network.Replicate; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Used to find the character "Gooey". | ||
*/ | ||
public class GooeyComponent implements Component { | ||
public class GooeyComponent implements Component<GooeyComponent> { | ||
@Replicate(FieldReplicateType.SERVER_TO_CLIENT) | ||
public EntityRef offeredQuest = EntityRef.NULL; | ||
|
||
@Override | ||
public void copyFrom(GooeyComponent other) { | ||
this.offeredQuest = other.offeredQuest; | ||
} | ||
} |
25 changes: 8 additions & 17 deletions
25
src/main/java/org/terasology/gooeysQuests/SpawnPrefabOnPlayerCollisionComponent.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,28 +1,19 @@ | ||
/* | ||
* 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.gooeysQuests; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.entitySystem.prefab.Prefab; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Destroys this entity when a player collides with the current entity and spawns the specified prefab. | ||
*/ | ||
public class SpawnPrefabOnPlayerCollisionComponent implements Component { | ||
public class SpawnPrefabOnPlayerCollisionComponent implements Component<SpawnPrefabOnPlayerCollisionComponent> { | ||
|
||
public Prefab prefab; | ||
|
||
@Override | ||
public void copyFrom(SpawnPrefabOnPlayerCollisionComponent other) { | ||
this.prefab = other.prefab; | ||
} | ||
} |
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
28 changes: 10 additions & 18 deletions
28
src/main/java/org/terasology/gooeysQuests/api/SpawnMagicBuildParticlesComponent.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,29 +1,21 @@ | ||
/* | ||
* 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.gooeysQuests.api; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.engine.world.block.BlockRegion; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
import org.terasology.structureTemplates.events.SpawnStructureEvent; | ||
import org.terasology.structureTemplates.events.StructureBlocksSpawnedEvent; | ||
|
||
/** | ||
* If a entity with this component gets a {@link SpawnStructureEvent} (that triggers a | ||
* {@link StructureBlocksSpawnedEvent}) then particles will be spawned in the given region. | ||
*/ | ||
public class SpawnMagicBuildParticlesComponent implements Component { | ||
public BlockRegion region; | ||
public class SpawnMagicBuildParticlesComponent implements Component<SpawnMagicBuildParticlesComponent> { | ||
public BlockRegion region = new BlockRegion(BlockRegion.INVALID); | ||
|
||
@Override | ||
public void copyFrom(SpawnMagicBuildParticlesComponent other) { | ||
this.region.set(other.region); | ||
} | ||
} |
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
25 changes: 8 additions & 17 deletions
25
src/main/java/org/terasology/gooeysQuests/quests/dungeon/DungeonQuestComponent.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,25 +1,16 @@ | ||
/* | ||
* 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.gooeysQuests.quests.dungeon; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Owned by the entity that represents a dungeon quest. | ||
*/ | ||
public class DungeonQuestComponent implements Component { | ||
public class DungeonQuestComponent implements Component<DungeonQuestComponent> { | ||
|
||
@Override | ||
public void copyFrom(DungeonQuestComponent other) { | ||
|
||
} | ||
} |
25 changes: 8 additions & 17 deletions
25
src/main/java/org/terasology/gooeysQuests/quests/dwarfhalls/DwarfHallsQuestComponent.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,25 +1,16 @@ | ||
/* | ||
* 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.gooeysQuests.quests.dwarfhalls; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Owned by the entity that represents a dwarf halls quest. | ||
*/ | ||
public class DwarfHallsQuestComponent implements Component { | ||
public class DwarfHallsQuestComponent implements Component<DwarfHallsQuestComponent> { | ||
|
||
@Override | ||
public void copyFrom(DwarfHallsQuestComponent other) { | ||
|
||
} | ||
} |
25 changes: 8 additions & 17 deletions
25
...ava/org/terasology/gooeysQuests/quests/fortressvillage/FortressVillageQuestComponent.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,25 +1,16 @@ | ||
/* | ||
* 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.gooeysQuests.quests.fortressvillage; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Owned by the entity that represents a fortressvillage quest. | ||
*/ | ||
public class FortressVillageQuestComponent implements Component { | ||
public class FortressVillageQuestComponent implements Component<FortressVillageQuestComponent> { | ||
|
||
@Override | ||
public void copyFrom(FortressVillageQuestComponent other) { | ||
|
||
} | ||
} |
25 changes: 8 additions & 17 deletions
25
src/main/java/org/terasology/gooeysQuests/quests/mines/MinesQuestComponent.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,25 +1,16 @@ | ||
/* | ||
* Copyright 2018 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.gooeysQuests.quests.mines; | ||
|
||
import org.terasology.engine.entitySystem.Component; | ||
import org.terasology.gestalt.entitysystem.component.Component; | ||
|
||
/** | ||
* Owned by the entity that represents a mines quest. | ||
*/ | ||
public class MinesQuestComponent implements Component { | ||
public class MinesQuestComponent implements Component<MinesQuestComponent> { | ||
@Override | ||
public void copyFrom(MinesQuestComponent other) { | ||
|
||
} | ||
} |