本文整理汇总了Java中com.badlogic.gdx.utils.Sort类的典型用法代码示例。如果您正苦于以下问题:Java Sort类的具体用法?Java Sort怎么用?Java Sort使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sort类属于com.badlogic.gdx.utils包,在下文中一共展示了Sort类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortDrawablesOldest
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Sorts by modified date with oldest first.
*/
private void sortDrawablesOldest() {
Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> {
if (o1.file.lastModified() < o2.file.lastModified()) {
return -1;
} else if (o1.file.lastModified() > o2.file.lastModified()) {
return 1;
} else {
return 0;
}
});
refreshDrawableDisplay();
}
示例2: sortDrawablesNewest
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Sorts by modified date with newest first.
*/
private void sortDrawablesNewest() {
Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> {
if (o1.file.lastModified() < o2.file.lastModified()) {
return 1;
} else if (o1.file.lastModified() > o2.file.lastModified()) {
return -1;
} else {
return 0;
}
});
refreshDrawableDisplay();
}
示例3: sortFontsOldest
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsOldest() {
Sort.instance().sort(fonts, (FontData o1, FontData o2) -> {
if (o1.file.lastModified() < o2.file.lastModified()) {
return -1;
} else if (o1.file.lastModified() > o2.file.lastModified()) {
return 1;
} else {
return 0;
}
});
refreshTable();
}
示例4: sortFontsNewest
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsNewest() {
Sort.instance().sort(fonts, (FontData o1, FontData o2) -> {
if (o1.file.lastModified() < o2.file.lastModified()) {
return 1;
} else if (o1.file.lastModified() > o2.file.lastModified()) {
return -1;
} else {
return 0;
}
});
refreshTable();
}
示例5: sortFontsAZ
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsAZ() {
Sort.instance().sort(colors, new Comparator<ColorData>() {
@Override
public int compare(ColorData o1, ColorData o2) {
return o1.toString().compareToIgnoreCase(o2.toString());
}
});
refreshTable();
}
示例6: sortFontsZA
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsZA() {
Sort.instance().sort(colors, new Comparator<ColorData>() {
@Override
public int compare(ColorData o1, ColorData o2) {
return o1.toString().compareToIgnoreCase(o2.toString()) * -1;
}
});
refreshTable();
}
示例7: beforeGroup
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
@Override
public void beforeGroup (int group, Array<Decal> contents) {
if (group == GROUP_BLEND) {
Sort.instance().sort(contents, comparator);
Gdx.gl.glEnable(GL20.GL_BLEND);
// no need for writing into the z buffer if transparent decals are the last thing to be rendered
// and they are rendered back to front
Gdx.gl.glDepthMask(false);
} else {
// FIXME sort by material
}
}
示例8: beforeGroup
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
public void beforeGroup(int paramInt, Array<Decal> paramArray)
{
if (paramInt == 1)
{
Sort.instance().sort(paramArray, this.comparator);
Gdx.gl10.glEnable(3042);
Gdx.gl10.glDepthMask(false);
}
}
示例9: sortDrawablesAZ
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Sorts alphabetically from A to Z.
*/
private void sortDrawablesAZ() {
Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> o1.toString().compareToIgnoreCase(o2.toString()));
refreshDrawableDisplay();
}
示例10: sortDrawablesZA
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Sorts alphabetically from Z to A.
*/
private void sortDrawablesZA() {
Sort.instance().sort(drawables, (DrawableData o1, DrawableData o2) -> o1.toString().compareToIgnoreCase(o2.toString()) * -1);
refreshDrawableDisplay();
}
示例11: sortFontsAZ
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsAZ() {
Sort.instance().sort(fonts, (FontData o1, FontData o2) -> o1.toString().compareToIgnoreCase(o2.toString()));
refreshTable();
}
示例12: sortFontsZA
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
private void sortFontsZA() {
Sort.instance().sort(fonts, (FontData o1, FontData o2) -> o1.toString().compareToIgnoreCase(o2.toString()) * -1);
refreshTable();
}
示例13: getCommands
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Returns a sorted list of render commands stored in this buffer.
*/
public List<? extends BaseRenderCommand> getCommands() {
Sort.instance().sort(contents.items, 0, contents.size);
return Arrays.asList(contents.items).subList(0, contents.size);
}
示例14: sort
import com.badlogic.gdx.utils.Sort; //导入依赖的package包/类
/**
* Sorts this array. The array elements must implement {@link Comparable}.
* This method is not thread safe (uses {@link Sort#instance()}).
*/
public void sort() {
Sort.instance().sort(items, 0, size);
}