Get the PlayerCharacter that is the "master" for this object. @return master PC
()
| 1639 | * @return master PC |
| 1640 | */ |
| 1641 | public PlayerCharacter getMasterPC() |
| 1642 | { |
| 1643 | Follower followerMaster = masterFacet.get(id); |
| 1644 | if (followerMaster == null) |
| 1645 | { |
| 1646 | return null; |
| 1647 | } |
| 1648 | |
| 1649 | for (PlayerCharacter nPC : Globals.getPCList()) |
| 1650 | { |
| 1651 | if (followerMaster.getFileName().equals(nPC.getFileName())) |
| 1652 | { |
| 1653 | return nPC; |
| 1654 | } |
| 1655 | } |
| 1656 | |
| 1657 | // could not find a filename match, let's try the Name |
| 1658 | for (PlayerCharacter nPC : Globals.getPCList()) |
| 1659 | { |
| 1660 | if (followerMaster.getName().equals(nPC.getName())) |
| 1661 | { |
| 1662 | return nPC; |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | // no Name and no FileName match, so must not be loaded |
| 1667 | return null; |
| 1668 | } |
| 1669 | |
| 1670 | /** |
| 1671 | * Sets the character's name. |
no test coverage detected