mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-04 00:46:01 +02:00
Improve code formatting
This commit is contained in:
@@ -1,45 +0,0 @@
|
|||||||
package com.yes.yes.behaviours;
|
|
||||||
|
|
||||||
import com.yes.yes.utils.BlockContainer;
|
|
||||||
import com.yes.yes.utils.Component;
|
|
||||||
import com.yes.yes.utils.Entity;
|
|
||||||
|
|
||||||
public class TestBehaviour extends Component {
|
|
||||||
|
|
||||||
public TestBehaviour(Entity entity, BlockContainer blockContainer) {
|
|
||||||
super(entity, blockContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onNeighborPlaced(Entity entity) {
|
|
||||||
System.out.println(parent.getClass().getSimpleName() + " > \"" + entity.getClass().getSimpleName() + "\" got placed in the radius.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
parent.addListener("placed", this, this::onNeighborPlaced);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update() {
|
|
||||||
/*System.out.println("Updating " + parent.getClass().getSimpleName());
|
|
||||||
for (int x = -1; x < 2; x++) {
|
|
||||||
for (int y = -1; y < 2; y++) {
|
|
||||||
try {
|
|
||||||
System.out.println("Offset: X:" + x + " Y:" + y);
|
|
||||||
Entity entity = blockContainer.getBlock(new Coordinate(x, y));
|
|
||||||
|
|
||||||
if (entity != null) {
|
|
||||||
System.out.println(entity.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
} catch (IllegalAccessException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() {
|
|
||||||
parent.removeListener("placed", this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user