Rename Rule methods
This commit is contained in:
@@ -3,7 +3,7 @@ package com.bartlomiejpluta.base.api.game.rule;
|
|||||||
import com.bartlomiejpluta.base.api.game.entity.Entity;
|
import com.bartlomiejpluta.base.api.game.entity.Entity;
|
||||||
|
|
||||||
public interface Rule {
|
public interface Rule {
|
||||||
boolean test(Entity entity);
|
boolean when(Entity entity);
|
||||||
|
|
||||||
void invoke(Entity entity);
|
void then(Entity entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ public class DefaultObjectLayer implements ObjectLayer {
|
|||||||
public void update(float dt) {
|
public void update(float dt) {
|
||||||
for (var entity : entities) {
|
for (var entity : entities) {
|
||||||
for (var rule : rules) {
|
for (var rule : rules) {
|
||||||
if (rule.test(entity)) {
|
if (rule.when(entity)) {
|
||||||
rule.invoke(entity);
|
rule.then(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user