Java 类com.badlogic.gdx.ai.fma.FormationPattern 实例源码

项目:GDXJam    文件:SquadComponent.java   
public FormationPattern<Vector2> getFormationPattern (FormationPatternType pattern) {
    switch (pattern) {
    case Line:
        return new LineFormationPattern(Constants.unitRadius + PATTERN_SPACING);
    case Column:
        return new ColumnFormationPattern(Constants.unitRadius + PATTERN_SPACING);
    case Square:
        return new SquareFormationPattern(Constants.unitRadius + PATTERN_SPACING);
    default:
    case Ring:
        return new OffensiveCircleFormationPattern<Vector2>(Constants.unitRadius + PATTERN_SPACING);
    case V:
        return new VFormationPattern(60 * MathUtils.degreesToRadians, Constants.unitRadius + PATTERN_SPACING);
    case Wedge:
        return new WedgeFormationPattern(Constants.unitRadius + PATTERN_SPACING);
    }
}
项目:GDXJam    文件:SquadComponent.java   
public void setFormationPattern (FormationPatternType pattern) {
    FormationPattern<Vector2> formationPattern = getFormationPattern(pattern);
    formation.changePattern(formationPattern);
}