ScreenAxis.java

net.minecraft.client.gui.navigation.ScreenAxis

信息

  • 全限定名:net.minecraft.client.gui.navigation.ScreenAxis
  • 类型:public enum
  • 包:net.minecraft.client.gui.navigation
  • 源码路径:src/main/java/net/minecraft/client/gui/navigation/ScreenAxis.java
  • 起始行号:L7
  • 职责:

    TODO

字段/常量

  • HORIZONTAL, VERTICAL
    • 类型: ScreenAxis
    • 修饰符: package-private
    • 源码定位: L8
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public ScreenAxis orthogonal() @ L11

  • 方法名:orthogonal
  • 源码定位:L11
  • 返回类型:ScreenAxis
  • 修饰符:public

参数:

说明:

TODO

public ScreenDirection getPositive() @ L18

  • 方法名:getPositive
  • 源码定位:L18
  • 返回类型:ScreenDirection
  • 修饰符:public

参数:

说明:

TODO

public ScreenDirection getNegative() @ L25

  • 方法名:getNegative
  • 源码定位:L25
  • 返回类型:ScreenDirection
  • 修饰符:public

参数:

说明:

TODO

public ScreenDirection getDirection(boolean positive) @ L32

  • 方法名:getDirection
  • 源码定位:L32
  • 返回类型:ScreenDirection
  • 修饰符:public

参数:

  • positive: boolean

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public enum ScreenAxis {
    HORIZONTAL,
    VERTICAL;
 
    public ScreenAxis orthogonal() {
        return switch (this) {
            case HORIZONTAL -> VERTICAL;
            case VERTICAL -> HORIZONTAL;
        };
    }
 
    public ScreenDirection getPositive() {
        return switch (this) {
            case HORIZONTAL -> ScreenDirection.RIGHT;
            case VERTICAL -> ScreenDirection.DOWN;
        };
    }
 
    public ScreenDirection getNegative() {
        return switch (this) {
            case HORIZONTAL -> ScreenDirection.LEFT;
            case VERTICAL -> ScreenDirection.UP;
        };
    }
 
    public ScreenDirection getDirection(boolean positive) {
        return positive ? this.getPositive() : this.getNegative();
    }
}

引用的其他类