Basic AI defending

This commit is contained in:
Anuken
2022-02-18 11:27:20 -05:00
parent 520b60770c
commit 027d037233
7 changed files with 210 additions and 57 deletions

View File

@@ -249,6 +249,21 @@ public class EventType{
}
}
/**
* Called when a bullet damages a building. May not be called for all damage events!
* This event is re-used! Never do anything to re-raise this event in the listener.
* */
public static class BuildDamageEvent{
public Building build;
public Bullet source;
public BuildDamageEvent set(Building build, Bullet source){
this.build = build;
this.source = source;
return this;
}
}
/**
* Called *before* a tile has changed.
* WARNING! This event is special: its instance is reused! Do not cache or use with a timer.

View File

@@ -237,8 +237,7 @@ public class Rules{
public TeamRule get(Team team){
TeamRule out = values[team.id];
if(out == null) values[team.id] = (out = new TeamRule());
return out;
return out == null ? (values[team.id] = new TeamRule()) : out;
}
@Override