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

Method getLoadType

code/src/java/pcgen/cdom/facet/analysis/LoadFacet.java:57–85  ·  view source on GitHub ↗

Returns the Load for the Player Character identified by the given CharID. @param id The CharID identifying the Player Character for which the Load should be returned @return The Load for the Player Character identified by the given CharID

(CharID id)

Source from the content-addressed store, hash-verified

55 * @return The Load for the Player Character identified by the given CharID
56 */
57 public Load getLoadType(CharID id)
58 {
59 Float weight = totalWeightFacet.getTotalWeight(id);
60 double dbl = weight / getMaxLoad(id).doubleValue();
61
62 if (!Globals.checkRule(RuleConstants.SYS_LDPACSK))
63 {
64 return Load.LIGHT;
65 }
66 Float lightMult = SettingsHandler.getGameAsProperty().get().getLoadInfo().getLoadMultiplier("LIGHT");
67 if (lightMult != null && dbl <= lightMult.doubleValue())
68 {
69 return Load.LIGHT;
70 }
71
72 Float mediumMult = SettingsHandler.getGameAsProperty().get().getLoadInfo().getLoadMultiplier("MEDIUM");
73 if (mediumMult != null && dbl <= mediumMult.doubleValue())
74 {
75 return Load.MEDIUM;
76 }
77
78 Float heavyMult = SettingsHandler.getGameAsProperty().get().getLoadInfo().getLoadMultiplier("HEAVY");
79 if (heavyMult != null && dbl <= heavyMult.doubleValue())
80 {
81 return Load.HEAVY;
82 }
83
84 return Load.OVERLOAD;
85 }
86
87 /**
88 * Returns the maximum Load for the Player Character identified by the given

Callers 2

movementOfTypeMethod · 0.45
calculateMinMethod · 0.45

Calls 8

getMaxLoadMethod · 0.95
checkRuleMethod · 0.95
getGameAsPropertyMethod · 0.95
getTotalWeightMethod · 0.80
doubleValueMethod · 0.80
getLoadMultiplierMethod · 0.80
getLoadInfoMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected