Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ecs-gestalt): Migrate Components to gestalt's Components. #17

Merged
merged 3 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 copy(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