Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
package com.ubt.jimu.controller.data.action;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public class Action {
private int a;
private int b;
private int c;
private Map<Integer, Integer> d;
private Map<Integer, TurnData> e;
private Map<Integer, MotorData> f;
public void a(int i) {
this.a = i;
}
public void a(List<Integer> list) {
}
public void b(int i) {
this.b = i;
}
public void c(int i) {
this.c = i;
}
public int d() {
return this.b;
}
public Map<Integer, TurnData> e() {
return this.e;
}
public int f() {
return this.c;
}
public String toString() {
return "Action{index=" + this.a + ", sportTime=" + this.b + ", waitTime=" + this.c + ", rotas=" + this.d + ", turns=" + this.e + ", motors=" + this.f + '}';
}
public void a(Map<Integer, MotorData> map) {
this.f = map;
}
public void b(Map<Integer, Integer> map) {
this.d = map;
}
public Map<Integer, Integer> c() {
return this.d;
}
public int a() {
return this.c + this.b;
}
public Map<Integer, MotorData> b() {
return this.f;
}
public void c(Map<Integer, TurnData> map) {
this.e = map;
}
}

View File

@@ -0,0 +1,14 @@
package com.ubt.jimu.controller.data.action;
/* loaded from: classes.dex */
public class ActionIcon {
private int a;
public ActionIcon(String str, int i) {
this.a = i;
}
public int a() {
return this.a;
}
}

View File

@@ -0,0 +1,210 @@
package com.ubt.jimu.controller.data.action;
import android.text.TextUtils;
import android.util.SparseArray;
import com.ubt.jimu.base.data.Engine;
import com.ubt.jimu.base.data.Motor;
import com.ubt.jimu.base.data.Servo;
import com.ubt.jimu.base.data.ServoMode;
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/* loaded from: classes.dex */
public class ActionSequence {
private static final HashMap<String, Integer> k = new HashMap<>();
private String a;
private String b;
private String c;
private List<Action> d;
private String e;
private SparseArray<String> f;
private long g;
private boolean h = false;
private int i;
private String j;
static {
k.put(Locale.CHINESE.getLanguage(), 0);
k.put("zh-hans", 0);
k.put(Locale.ENGLISH.getLanguage(), 1);
k.put(Locale.JAPANESE.getLanguage(), 2);
k.put(Locale.KOREAN.getLanguage(), 3);
k.put(Locale.GERMAN.getLanguage(), 4);
k.put(Locale.ITALIAN.getLanguage(), 5);
k.put(Locale.FRENCH.getLanguage(), 6);
k.put("es", 7);
k.put("pt", 8);
k.put("zh-hant", 9);
k.put("ar", 10);
k.put("ru", 11);
k.put("pl", 12);
k.put("tr", 13);
k.put("da", 14);
k.put("th", 15);
k.put(JockstickDataConverter.ID, 16);
}
public void a(int i) {
this.i = i;
}
public void b(String str) {
this.e = str;
}
public void c(String str) {
this.c = str;
}
public int d() {
return this.i;
}
public void e(String str) {
this.a = str;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ActionSequence)) {
return false;
}
ActionSequence actionSequence = (ActionSequence) obj;
String str = this.a;
if (str == null ? actionSequence.a != null : !str.equals(actionSequence.a)) {
return false;
}
String str2 = this.c;
String str3 = actionSequence.c;
return str2 != null ? str2.equals(str3) : str3 == null;
}
public void f(String str) {
this.b = str;
}
public String g() {
return this.j;
}
public String h() {
return this.a;
}
public int hashCode() {
String str = this.a;
int hashCode = (str != null ? str.hashCode() : 0) * 31;
String str2 = this.c;
return hashCode + (str2 != null ? str2.hashCode() : 0);
}
public List<Servo> i() {
List<Action> list = this.d;
if (list == null || list.size() <= 0) {
return null;
}
HashMap hashMap = new HashMap();
Iterator<Action> it = this.d.iterator();
while (it.hasNext()) {
Map<Integer, TurnData> e = it.next().e();
if (e != null && e.size() > 0) {
Iterator<Integer> it2 = e.keySet().iterator();
while (it2.hasNext()) {
int intValue = it2.next().intValue();
hashMap.put(Integer.valueOf(intValue), new Servo(intValue, ServoMode.SERVO_MODE_TURN));
}
}
}
if (hashMap.size() > 0) {
return new ArrayList(hashMap.values());
}
return null;
}
public boolean j() {
return this.h;
}
public String toString() {
return "ActionSequence{name='" + this.a + "', robotID='" + this.b + "', id='" + this.c + "', actions=" + this.d + ", icon='" + this.e + "', showName=" + this.f + ", createTime=" + this.g + ", isOfficial=" + this.h + ", iconResID=" + this.i + ", musicPath='" + this.j + "'}";
}
public List<Action> a() {
return this.d;
}
public long b() {
return this.g;
}
public String c() {
return this.e;
}
public void d(String str) {
this.j = str;
}
public String e() {
return this.c;
}
public List<Engine> f() {
List<Action> list = this.d;
if (list == null || list.size() <= 0) {
return null;
}
HashMap hashMap = new HashMap();
Iterator<Action> it = this.d.iterator();
while (it.hasNext()) {
Map<Integer, MotorData> b = it.next().b();
if (b != null && b.size() > 0) {
Iterator<Integer> it2 = b.keySet().iterator();
while (it2.hasNext()) {
int intValue = it2.next().intValue();
hashMap.put(Integer.valueOf(intValue), new Motor(intValue));
}
}
}
if (hashMap.size() > 0) {
return new ArrayList(hashMap.values());
}
return null;
}
public void a(Action action) {
if (this.d == null) {
this.d = new ArrayList();
}
this.d.add(action);
}
public void a(long j) {
this.g = j;
}
public void a(boolean z) {
this.h = z;
}
public void a(SparseArray<String> sparseArray) {
this.f = sparseArray;
}
public String a(String str) {
SparseArray<String> sparseArray;
Integer num = k.get(str);
if (num == null || (sparseArray = this.f) == null) {
return null;
}
String str2 = sparseArray.get(num.intValue());
return TextUtils.isEmpty(str2) ? this.f.get(k.get(Locale.ENGLISH.getLanguage()).intValue()) : str2;
}
}

View File

@@ -0,0 +1,31 @@
package com.ubt.jimu.controller.data.action;
import com.twitter.sdk.android.core.TwitterAuthConfig;
/* loaded from: classes.dex */
public class MotorData extends TurnData {
private int c;
public MotorData(int i, int i2, int i3) {
super(i, i2);
this.c = i3;
}
public static int e() {
return TwitterAuthConfig.DEFAULT_AUTH_REQUEST_CODE;
}
@Override // com.ubt.jimu.controller.data.action.TurnData
public boolean d() {
return super.d() || this.c == 0;
}
public int f() {
return this.c;
}
@Override // com.ubt.jimu.controller.data.action.TurnData
public String toString() {
return super.toString() + " duration=" + this.c;
}
}

View File

@@ -0,0 +1,77 @@
package com.ubt.jimu.controller.data.action;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes.dex */
public class RunningData {
private CopyOnWriteArrayList<RunningItem> a = new CopyOnWriteArrayList<>();
public synchronized void a(RunningItem runningItem) {
if (runningItem == null) {
return;
}
if (this.a.size() > 0) {
Iterator<RunningItem> it = this.a.iterator();
while (it.hasNext()) {
RunningItem next = it.next();
if (runningItem.b().equals(next.b()) && runningItem.a() == next.a()) {
next.b(runningItem.c());
return;
}
}
}
this.a.add(runningItem);
}
public synchronized boolean b(RunningItem runningItem) {
if (runningItem == null) {
return false;
}
int i = -1;
int i2 = 0;
while (true) {
if (i2 >= this.a.size()) {
break;
}
RunningItem runningItem2 = this.a.get(i2);
if (runningItem.b().equals(runningItem2.b()) && runningItem.a() == runningItem2.a()) {
i = i2;
break;
}
i2++;
}
if (i < 0) {
return false;
}
this.a.remove(i);
return true;
}
public synchronized boolean a(long j) {
boolean z;
z = true;
if (this.a != null && this.a.size() > 0) {
CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();
Iterator<RunningItem> it = this.a.iterator();
while (it.hasNext()) {
RunningItem next = it.next();
if (next.a(j)) {
copyOnWriteArrayList.add(next);
} else {
z = false;
}
}
if (copyOnWriteArrayList.size() > 0) {
this.a.removeAll(copyOnWriteArrayList);
}
}
return z;
}
public synchronized void a() {
if (this.a != null) {
this.a.clear();
}
}
}

View File

@@ -0,0 +1,38 @@
package com.ubt.jimu.controller.data.action;
import com.ubt.jimu.base.data.CtrlMotionType;
/* loaded from: classes.dex */
public class RunningItem {
private int a;
private CtrlMotionType b;
private long c;
private long d;
public RunningItem(int i, CtrlMotionType ctrlMotionType, long j, long j2) {
this.a = i;
this.b = ctrlMotionType;
this.c = j;
this.d = j2;
}
public boolean a(long j) {
return j - this.d > this.c;
}
public CtrlMotionType b() {
return this.b;
}
public long c() {
return this.d;
}
public int a() {
return this.a;
}
public void b(long j) {
this.d = j;
}
}

View File

@@ -0,0 +1,45 @@
package com.ubt.jimu.controller.data.action;
/* loaded from: classes.dex */
public class TurnData {
private int a;
private int b;
public TurnData(int i, int i2) {
this.a = i;
this.b = i2;
}
public static int e() {
return 658;
}
public int a() {
if (b() == 0) {
return 0;
}
if (b() == 1) {
return c();
}
if (b() == -1) {
return -c();
}
return 0;
}
public int b() {
return this.a;
}
public int c() {
return this.b;
}
public boolean d() {
return this.b * this.a == 0;
}
public String toString() {
return "TurnData{direction=" + this.a + ", speed=" + this.b + '}';
}
}