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

Method getMasterPC

code/src/java/pcgen/core/PlayerCharacter.java:1641–1668  ·  view source on GitHub ↗

Get the PlayerCharacter that is the "master" for this object. @return master PC

()

Source from the content-addressed store, hash-verified

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.

Callers 8

runMethod · 0.95
setMasterMethod · 0.95
getAttackStringMethod · 0.95
getBaseCheckMethod · 0.95
baseAttackBonusMethod · 0.95
hitPointsMethod · 0.95
getFollowerOfTokenMethod · 0.80

Calls 7

getPCListMethod · 0.95
getFileNameMethod · 0.95
getNameMethod · 0.95
getMethod · 0.65
equalsMethod · 0.65
getNameMethod · 0.65
getFileNameMethod · 0.45

Tested by

no test coverage detected