Returns 0 on object error, 1 on can fit, 2 on too heavy, 3 on properties problem (unimplemented), 4 on capacity error @param aPC The PC that has the Equipment @param obj The equipment to check @return 0 on object error, 1 on can fit, 2 on too heavy, 3 on properties problem
(final PlayerCharacter aPC, final Object obj)
| 2616 | * problem (unimplemented), 4 on capacity error |
| 2617 | */ |
| 2618 | public int canContain(final PlayerCharacter aPC, final Object obj) |
| 2619 | { |
| 2620 | |
| 2621 | if (obj instanceof final Equipment anEquip) |
| 2622 | { |
| 2623 | |
| 2624 | Float f = (float) (anEquip.getWeightAsDouble(aPC) * anEquip.numberCarried()); |
| 2625 | |
| 2626 | if (checkChildWeight(aPC, f)) |
| 2627 | { |
| 2628 | |
| 2629 | // canHold(my HashMap())) //quick hack since the properties |
| 2630 | // hashmap doesn't exist |
| 2631 | if (checkContainerCapacity(anEquip.eqTypeList(), anEquip.numberCarried())) |
| 2632 | { |
| 2633 | |
| 2634 | // the qty value is a temporary hack - insert all or |
| 2635 | // nothing. should reset person to be a container, with |
| 2636 | // capacity=capacity |
| 2637 | return 1; |
| 2638 | } |
| 2639 | return 4; |
| 2640 | } |
| 2641 | return 2; |
| 2642 | } |
| 2643 | return 0; |
| 2644 | } |
| 2645 | |
| 2646 | /** |
| 2647 | * Description of the Method |
no test coverage detected