MCPcopy Create free account
hub / github.com/PCGen/pcgen / moveString

Method moveString

code/src/java/pcgen/core/Equipment.java:3063–3122  ·  view source on GitHub ↗

Process and return a movement string @return the Movement string

()

Source from the content-addressed store, hash-verified

3061 * @return the Movement string
3062 */
3063 public String moveString()
3064 {
3065 if (!moveString.isEmpty())
3066 {
3067 final Load eqLoad;
3068
3069 if (isHeavy())
3070 {
3071 eqLoad = Load.HEAVY;
3072 }
3073 else if (isMedium())
3074 {
3075 eqLoad = Load.MEDIUM;
3076 }
3077 else if (isLight())
3078 {
3079 eqLoad = Load.LIGHT;
3080 }
3081 else
3082 {
3083 eqLoad = Load.OVERLOAD;
3084 }
3085
3086 //
3087 // This will generate a list for base moves 30,20
3088 // or 60,50,40 depending on how many tokens are
3089 // in the original tag
3090 //
3091 final StringTokenizer aTok = new StringTokenizer(moveString, ",");
3092 int baseMove = -1;
3093 int tokenCount = aTok.countTokens();
3094
3095 switch (tokenCount)
3096 {
3097 case 2 -> baseMove = 30;
3098 case 3 -> baseMove = 60;
3099 default -> tokenCount = -1;
3100 }
3101
3102 if (tokenCount > 0)
3103 {
3104 final StringBuilder retString = new StringBuilder(moveString.length());
3105
3106 for (int i = 0; i < tokenCount; ++i)
3107 {
3108 if (i != 0)
3109 {
3110 retString.append(',');
3111 }
3112
3113 retString.append(eqLoad.calcEncumberedMove(baseMove));
3114 baseMove -= 10;
3115 }
3116
3117 return retString.toString();
3118 }
3119 }
3120

Callers 7

cloneMethod · 0.95
getMoveTokenMethod · 0.80
getMoveTokenMethod · 0.80
getMoveTokenMethod · 0.80
writeArmorPropertyMethod · 0.80
getEquipmentHtmlInfoMethod · 0.80
getMoveTokenMethod · 0.80

Calls 7

isHeavyMethod · 0.95
isMediumMethod · 0.95
isLightMethod · 0.95
calcEncumberedMoveMethod · 0.95
isEmptyMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected