📄 wrstatusevent.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: WRStatusEvent.java
package wiiremotej.event;
import wiiremotej.WiiRemote;
// Referenced classes of package wiiremotej.event:
// WREvent
public class WRStatusEvent extends WREvent
{
private static final double MAX_BATTERY_LEVEL = 200D;
private boolean extensionConnected;
private boolean speakerEnabled;
private boolean continuousEnabled;
private boolean LEDStatus[];
private double batteryLevel;
public WRStatusEvent(WiiRemote wiiremote, byte abyte0[])
{
super(wiiremote);
if ((abyte0[4] & 2) == 2)
extensionConnected = true;
else
extensionConnected = false;
if ((abyte0[4] & 4) == 4)
speakerEnabled = true;
else
speakerEnabled = false;
if ((abyte0[4] & 8) == 8)
continuousEnabled = true;
else
continuousEnabled = false;
boolean aflag[] = new boolean[4];
if ((abyte0[4] & 0x10) == 16)
aflag[0] = true;
else
aflag[0] = false;
if ((abyte0[4] & 0x20) == 32)
aflag[1] = true;
else
aflag[1] = false;
if ((abyte0[4] & 0x40) == 64)
aflag[2] = true;
else
aflag[2] = false;
if ((abyte0[4] & 0x80) == 128)
aflag[3] = true;
else
aflag[3] = false;
batteryLevel = (double)(abyte0[7] & 0xff) / 200D;
}
public WRStatusEvent(WiiRemote wiiremote, boolean flag, boolean flag1, boolean flag2, boolean aflag[], double d)
{
super(wiiremote);
extensionConnected = flag;
speakerEnabled = flag1;
continuousEnabled = flag2;
LEDStatus = aflag;
batteryLevel = d;
}
public boolean isExtensionConnected()
{
return extensionConnected;
}
public boolean isSpeakerEnabled()
{
return speakerEnabled;
}
public boolean isContinuousEnabled()
{
return continuousEnabled;
}
public boolean[] getLEDStatus()
{
return LEDStatus;
}
public boolean getLEDStatus(int i)
throws IllegalArgumentException
{
if (i < 0 || i > 3)
throw new IllegalArgumentException("The four lights are 0, 1, 2, and 3!");
else
return LEDStatus[i];
}
public double getBatteryLevel()
{
return batteryLevel;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -