Skip to content

Commit

Permalink
fix(ecs-gestalt): Migrate Components to gestalt's Components. (#17)
Browse files Browse the repository at this point in the history
Ref: MovingBlocks/Terasology#4753

Co-authored-by: Michael Pollind <mpollind@gmail.com>
Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
  • Loading branch information
3 people committed Aug 25, 2021
1 parent f1a6ea1 commit 9c66040
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
/*
* 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.smithing.component;

import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.network.Replicate;
import org.terasology.gestalt.entitysystem.component.Component;

public class CharcoalPitComponent implements Component {
public class CharcoalPitComponent implements Component<CharcoalPitComponent> {

/** The time in milliseconds in-game when the charcoal pit begins to burn, otherwise holds the last time the charcoal pit began to burn */
/**
* The time in milliseconds in-game when the charcoal pit begins to burn, otherwise holds the last time the charcoal pit began to burn
*/
@Replicate
public long burnStartWorldTime;

/** The time in milliseconds in-game when the charcoal pit stops burning, otherwise holds the last time the charcoal pit finished burning */
/**
* The time in milliseconds in-game when the charcoal pit stops burning, otherwise holds the last time the charcoal pit finished
* burning
*/
@Replicate
public long burnFinishWorldTime;

/** Minimum number of logs */
/**
* Minimum number of logs
*/
@Replicate
public int minimumLogCount;

/** Maximum number of logs */
/**
* Maximum number of logs
*/
@Replicate
public int maximumLogCount;

/** Number of input slots for fuel */
/**
* Number of input slots for fuel
*/
@Replicate
public int inputSlotCount;

/** Number of output slots for charcoal */
/**
* Number of output slots for charcoal
*/
@Replicate
public int outputSlotCount;

@Override
public void copyFrom(CharcoalPitComponent other) {
this.burnStartWorldTime = other.burnStartWorldTime;
this.burnFinishWorldTime = other.burnFinishWorldTime;
this.minimumLogCount = other.minimumLogCount;
this.maximumLogCount = other.maximumLogCount;
this.inputSlotCount = other.inputSlotCount;
this.outputSlotCount = other.outputSlotCount;
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.smithing.system;

import org.joml.Vector3f;
import org.terasology.engine.core.Time;
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.entitySystem.entity.EntityManager;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.ReceiveEvent;
Expand All @@ -17,14 +16,15 @@
import org.terasology.engine.logic.common.ActivateEvent;
import org.terasology.engine.logic.delay.DelayManager;
import org.terasology.engine.logic.delay.DelayedActionTriggeredEvent;
import org.terasology.module.inventory.components.InventoryComponent;
import org.terasology.module.inventory.systems.InventoryManager;
import org.terasology.module.inventory.systems.InventoryUtils;
import org.terasology.engine.logic.inventory.ItemComponent;
import org.terasology.engine.logic.location.LocationComponent;
import org.terasology.engine.particles.components.ParticleEmitterComponent;
import org.terasology.engine.registry.In;
import org.terasology.engine.world.block.regions.BlockRegionComponent;
import org.terasology.gestalt.entitysystem.component.Component;
import org.terasology.module.inventory.components.InventoryComponent;
import org.terasology.module.inventory.systems.InventoryManager;
import org.terasology.module.inventory.systems.InventoryUtils;
import org.terasology.smithing.component.CharcoalPitComponent;
import org.terasology.smithing.event.OpenCharcoalPitRequest;
import org.terasology.smithing.event.ProduceCharcoalRequest;
Expand Down

0 comments on commit 9c66040

Please sign in to comment.