Skip to content

Commit

Permalink
Fix ShapeModifier generic type bug
Browse files Browse the repository at this point in the history
  • Loading branch information
iamoscarliang committed Nov 23, 2023
1 parent 44608c6 commit 2551c82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.nativegame.natyengine.entity.modifier;

import com.nativegame.natyengine.entity.Entity;
import com.nativegame.natyengine.entity.Updatable;
import com.nativegame.natyengine.util.modifier.BaseModifier;

/**
* Created by Oscar Liang on 2022/12/11
*/

public class DurationModifier extends BaseModifier<Entity> {
public class DurationModifier extends BaseModifier<Updatable> {

private boolean mIsAutoRemove = false;

Expand Down Expand Up @@ -39,22 +39,22 @@ public void setAutoRemove(boolean autoRemove) {
// Overriding methods
//--------------------------------------------------------
@Override
protected void onStartModifier(Entity entity) {
protected void onStartModifier(Updatable entity) {
}

@Override
protected void onUpdateModifier(Entity entity, float durationPercentage) {
protected void onUpdateModifier(Updatable entity, float durationPercentage) {
}

@Override
protected void onEndModifier(Entity entity) {
protected void onEndModifier(Updatable entity) {
if (mIsAutoRemove) {
entity.removeFromGame();
}
}

@Override
protected void onResetModifier(Entity entity) {
protected void onResetModifier(Updatable entity) {
}
//========================================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

import com.nativegame.natyengine.camera.Camera;
import com.nativegame.natyengine.entity.Drawable;
import com.nativegame.natyengine.entity.Updatable;

/**
* Created by Oscar Liang on 2022/12/11
*/

public interface Shape extends Drawable {
public interface Shape extends Updatable, Drawable {

Camera.CoordinateType getCoordinateType();

Expand Down

0 comments on commit 2551c82

Please sign in to comment.