Basic AI defending
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user