Rename Rule methods

This commit is contained in:
2021-03-05 11:00:59 +01:00
parent f8190a9d46
commit 682a77ca38
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ package com.bartlomiejpluta.base.api.game.rule;
import com.bartlomiejpluta.base.api.game.entity.Entity;
public interface Rule {
boolean test(Entity entity);
boolean when(Entity entity);
void invoke(Entity entity);
void then(Entity entity);
}

View File

@@ -105,8 +105,8 @@ public class DefaultObjectLayer implements ObjectLayer {
public void update(float dt) {
for (var entity : entities) {
for (var rule : rules) {
if (rule.test(entity)) {
rule.invoke(entity);
if (rule.when(entity)) {
rule.then(entity);
}
}