mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 08:25:21 +01:00
Rename excel classes
This commit is contained in:
@@ -2,6 +2,8 @@ package emu.grasscutter.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.net.proto.VectorOuterClass.Vector;
|
||||
|
||||
@@ -9,8 +11,13 @@ import emu.grasscutter.net.proto.VectorOuterClass.Vector;
|
||||
public class Position implements Serializable {
|
||||
private static final long serialVersionUID = -2001232313615923575L;
|
||||
|
||||
@SerializedName(value="x", alternate={"_x", "X"})
|
||||
private float x;
|
||||
|
||||
@SerializedName(value="y", alternate={"_y", "Y"})
|
||||
private float y;
|
||||
|
||||
@SerializedName(value="z", alternate={"_z", "Z"})
|
||||
private float z;
|
||||
|
||||
public Position() {
|
||||
|
||||
@@ -273,43 +273,6 @@ public final class Utils {
|
||||
} return stringBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch properties from upper case to lower case?
|
||||
*/
|
||||
public static Map<String, Object> switchPropertiesUpperLowerCase(Map<String, Object> objMap, Class<?> cls) {
|
||||
Map<String, Object> map = new HashMap<>(objMap.size());
|
||||
for (String key : objMap.keySet()) {
|
||||
try {
|
||||
char c = key.charAt(0);
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
try {
|
||||
cls.getDeclaredField(key);
|
||||
map.put(key, objMap.get(key));
|
||||
} catch (NoSuchFieldException e) {
|
||||
String s1 = String.valueOf(c).toUpperCase();
|
||||
String after = key.length() > 1 ? s1 + key.substring(1) : s1;
|
||||
cls.getDeclaredField(after);
|
||||
map.put(after, objMap.get(key));
|
||||
}
|
||||
} else if (c >= 'A' && c <= 'Z') {
|
||||
try {
|
||||
cls.getDeclaredField(key);
|
||||
map.put(key, objMap.get(key));
|
||||
} catch (NoSuchFieldException e) {
|
||||
String s1 = String.valueOf(c).toLowerCase();
|
||||
String after = key.length() > 1 ? s1 + key.substring(1) : s1;
|
||||
cls.getDeclaredField(after);
|
||||
map.put(after, objMap.get(key));
|
||||
}
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
map.put(key, objMap.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a linear interpolation using a table of fixed points to create an effective piecewise f(x) = y function.
|
||||
* @param x
|
||||
|
||||
Reference in New Issue
Block a user