Initial commit
This commit is contained in:
19
sources/com/ubt/jimu/controller/data/keymap/ButtonKey.java
Normal file
19
sources/com/ubt/jimu/controller/data/keymap/ButtonKey.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.ubt.jimu.controller.data.keymap;
|
||||
|
||||
import com.ubt.jimu.controller.data.keymap.entity.Key;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ButtonKey extends Key {
|
||||
public ButtonKey(String str) {
|
||||
super(str, 1);
|
||||
}
|
||||
|
||||
public static ButtonKey a(int i) {
|
||||
for (PhysicalButton physicalButton : PhysicalButton.values()) {
|
||||
if (physicalButton.getKeyCode() == i) {
|
||||
return new ButtonKey(physicalButton.getName());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
10
sources/com/ubt/jimu/controller/data/keymap/JoyStick.java
Normal file
10
sources/com/ubt/jimu/controller/data/keymap/JoyStick.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.ubt.jimu.controller.data.keymap;
|
||||
|
||||
import com.ubt.jimu.controller.data.keymap.entity.Key;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class JoyStick extends Key {
|
||||
public JoyStick(String str) {
|
||||
super(str, 2);
|
||||
}
|
||||
}
|
50
sources/com/ubt/jimu/controller/data/keymap/KeyMap.java
Normal file
50
sources/com/ubt/jimu/controller/data/keymap/KeyMap.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.ubt.jimu.controller.data.keymap;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import com.ubt.jimu.controller.data.keymap.entity.Key;
|
||||
|
||||
@XStreamAlias("KeyMap")
|
||||
/* loaded from: classes.dex */
|
||||
public class KeyMap {
|
||||
|
||||
@XStreamAlias("ActionId")
|
||||
private String a;
|
||||
|
||||
@XStreamAlias("Key")
|
||||
private String b;
|
||||
|
||||
@XStreamOmitField
|
||||
private int c;
|
||||
|
||||
public KeyMap() {
|
||||
this.c = 1;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "keyName:" + this.b + " actionId:" + this.a + "keyType:" + this.c;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.c = i;
|
||||
}
|
||||
|
||||
public KeyMap(Key key, String str) {
|
||||
this.c = 1;
|
||||
this.b = key.a();
|
||||
this.c = key.b();
|
||||
this.a = str;
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.ubt.jimu.controller.data.keymap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum PhysicalButton {
|
||||
A(96),
|
||||
B(97),
|
||||
X(99),
|
||||
Y(100),
|
||||
L1(102),
|
||||
L2(104),
|
||||
R1(103),
|
||||
R2(105),
|
||||
DPAD_UP(19),
|
||||
DPAD_DOWN(20),
|
||||
DPAD_LEFT(21),
|
||||
DPAD_RIGHT(22);
|
||||
|
||||
private int keyCode;
|
||||
|
||||
PhysicalButton(int i) {
|
||||
this.keyCode = i;
|
||||
}
|
||||
|
||||
public static PhysicalButton fromKeyCode(int i) {
|
||||
for (PhysicalButton physicalButton : values()) {
|
||||
if (physicalButton.getKeyCode() == i) {
|
||||
return physicalButton;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getKeyCode() {
|
||||
return this.keyCode;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.ubt.jimu.controller.data.keymap.entity;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@XStreamAlias("GameControllerConfigData")
|
||||
/* loaded from: classes.dex */
|
||||
public class GameControllerConfigData {
|
||||
|
||||
@XStreamImplicit
|
||||
private List<KeyMapData> a = new ArrayList();
|
||||
|
||||
public List<KeyMapData> a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(List<KeyMapData> list) {
|
||||
this.a = list;
|
||||
}
|
||||
}
|
21
sources/com/ubt/jimu/controller/data/keymap/entity/Key.java
Normal file
21
sources/com/ubt/jimu/controller/data/keymap/entity/Key.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.ubt.jimu.controller.data.keymap.entity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Key {
|
||||
private int a;
|
||||
private String b;
|
||||
|
||||
public Key(String str, int i) {
|
||||
this.a = 1;
|
||||
this.b = str;
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.ubt.jimu.controller.data.keymap.entity;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.ubt.jimu.controller.data.keymap.KeyMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@XStreamAlias("KeyMapData")
|
||||
/* loaded from: classes.dex */
|
||||
public class KeyMapData {
|
||||
|
||||
@XStreamAlias("ButtonKeyMap")
|
||||
private List<KeyMap> a = new ArrayList();
|
||||
|
||||
@XStreamAlias("JoystickKeyMap")
|
||||
private List<KeyMap> b = new ArrayList();
|
||||
|
||||
public List<KeyMap> a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public List<KeyMap> b() {
|
||||
Iterator<KeyMap> it = this.b.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(2);
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void a(List<KeyMap> list) {
|
||||
this.a = list;
|
||||
}
|
||||
|
||||
public void b(List<KeyMap> list) {
|
||||
this.b = list;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user