// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.entity.damage;

import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import com.hypixel.hytale.component.ComponentType;
import javax.annotation.Nullable;
import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.WieldingInteraction;
import javax.annotation.Nonnull;
import java.time.Instant;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public class DamageDataComponent implements Component<EntityStore>
{
    @Nonnull
    private Instant lastCombatAction;
    @Nonnull
    private Instant lastDamageTime;
    @Nullable
    private WieldingInteraction currentWielding;
    @Nullable
    private Instant lastChargeTime;
    
    public DamageDataComponent() {
        this.lastCombatAction = Instant.MIN;
        this.lastDamageTime = Instant.MIN;
    }
    
    @Nonnull
    public static ComponentType<EntityStore, DamageDataComponent> getComponentType() {
        return EntityModule.get().getDamageDataComponentType();
    }
    
    @Nonnull
    public Instant getLastCombatAction() {
        return this.lastCombatAction;
    }
    
    public void setLastCombatAction(@Nonnull final Instant lastCombatAction) {
        this.lastCombatAction = lastCombatAction;
    }
    
    @Nonnull
    public Instant getLastDamageTime() {
        return this.lastDamageTime;
    }
    
    public void setLastDamageTime(@Nonnull final Instant lastDamageTime) {
        this.lastDamageTime = lastDamageTime;
    }
    
    @Nullable
    public Instant getLastChargeTime() {
        return this.lastChargeTime;
    }
    
    public void setLastChargeTime(@Nonnull final Instant lastChargeTime) {
        this.lastChargeTime = lastChargeTime;
    }
    
    @Nullable
    public WieldingInteraction getCurrentWielding() {
        return this.currentWielding;
    }
    
    public void setCurrentWielding(@Nullable final WieldingInteraction currentWielding) {
        this.currentWielding = currentWielding;
    }
    
    @Nonnull
    @Override
    public Component<EntityStore> clone() {
        final DamageDataComponent damageDataComponent = new DamageDataComponent();
        damageDataComponent.lastCombatAction = this.lastCombatAction;
        damageDataComponent.lastDamageTime = this.lastDamageTime;
        damageDataComponent.currentWielding = this.currentWielding;
        damageDataComponent.lastChargeTime = this.lastChargeTime;
        return damageDataComponent;
    }
}
