Skip to content
Snippets Groups Projects
AvatarPanelDrawer.java 40.8 KiB
Newer Older
					type = TAttribute.TIMER;
				}
				if (attr.hasInitialValue()) {
					bl.addAttribute(new TAttribute(0, attr.getName(), attr.getInitialValue(), type));
				} else {
					bl.addAttribute(new TAttribute(0, attr.getName(), attr.getType().getDefaultInitialValue(), type));
				}
				if (attr.getName().contains("key_") || attr.getName().contains("privKey_")) {
					hasCrypto = true;
					bl.addCryptoElements();
				}
			}
		}

		for (AvatarAttribute attr : ab.getConstants()) {
			int type = 5;
			if (attr.getType() == AvatarType.BOOLEAN) {
				type = 4;
			}
			if (attr.getType() == AvatarType.INTEGER) {
				type = 0;
			}
			if (attr.hasInitialValue()) {
				bl.addAttribute(new TAttribute(0, attr.getName(), attr.getInitialValue(), type));
			} else {
				bl.addAttribute(new TAttribute(0, attr.getName(), attr.getType().getDefaultInitialValue(), type));
			}
			if (attr.getName().contains("key_") || attr.getName().contains("privKey_")) {
				hasCrypto = true;
				bl.addCryptoElements();
			}
		}

		for (avatartranslator.AvatarMethod method : ab.getMethods()) {
			String methodId = "";
			if (useOriginalValues) {
				methodId = method.toOriginalString().replaceAll(" = 0", "");
			} else {
				methodId = method.toString().replaceAll(" = 0", "");
			}
			String result = methodId.replaceAll(" = false", "");
			TraceManager.addDev("Adding method:" + result);

			//TraceManager.addDev("Extra types are:" + as.getExtraTypes().toString());
			bl.addMethodIfApplicable(result, as.getExtraTypes());
		}
	}

	public String getLastKeyword(String s) {
		return s.split("__")[s.split("__").length - 1];
	}



     
}