mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 20:29:06 +07:00
Cleanup
This commit is contained in:
parent
277e4fa553
commit
7784c8f35e
@ -445,52 +445,4 @@ public class CommandAI extends AIController{
|
||||
this.stopAtTarget = stopAtTarget;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
//TODO ひどい
|
||||
(does not work)
|
||||
|
||||
public static float cohesionScl = 0.3f;
|
||||
public static float cohesionRad = 3f, separationRad = 1.1f, separationScl = 1f, flockMult = 0.5f;
|
||||
|
||||
Vec2 calculateFlock(){
|
||||
if(local.isEmpty()) return flockVec.setZero();
|
||||
|
||||
flockVec.setZero();
|
||||
separation.setZero();
|
||||
cohesion.setZero();
|
||||
massCenter.set(unit);
|
||||
|
||||
float rad = unit.hitSize;
|
||||
float sepDst = rad * separationRad, cohDst = rad * cohesionRad;
|
||||
|
||||
//"cohesed" isn't even a word smh
|
||||
int separated = 0, cohesed = 1;
|
||||
|
||||
for(var other : local){
|
||||
float dst = other.dst(unit);
|
||||
if(dst < sepDst){
|
||||
separation.add(Tmp.v1.set(unit).sub(other).scl(1f / sepDst));
|
||||
separated ++;
|
||||
}
|
||||
|
||||
if(dst < cohDst){
|
||||
massCenter.add(other);
|
||||
cohesed ++;
|
||||
}
|
||||
}
|
||||
|
||||
if(separated > 0){
|
||||
separation.scl(1f / separated);
|
||||
flockVec.add(separation.scl(separationScl));
|
||||
}
|
||||
|
||||
if(cohesed > 1){
|
||||
massCenter.scl(1f / cohesed);
|
||||
flockVec.add(Tmp.v1.set(massCenter).sub(unit).limit(cohesionScl * unit.type.speed));
|
||||
//seek mass center?
|
||||
}
|
||||
|
||||
return flockVec;
|
||||
}*/
|
||||
}
|
||||
|
6
core/src/mindustry/game/CampaignRules.java
Normal file
6
core/src/mindustry/game/CampaignRules.java
Normal file
@ -0,0 +1,6 @@
|
||||
package mindustry.game;
|
||||
|
||||
public class CampaignRules{
|
||||
public boolean fog;
|
||||
public boolean sectorInvasions;
|
||||
}
|
Loading…
Reference in New Issue
Block a user