Get the value of the supplied output token. @param tokenSource The full source of the token @param pc The character to retrieve the value for. @param eh The ExportHandler that is managing the export (may be null for a once off conversion). @return The value of the token.
(String tokenSource, PlayerCharacter pc, ExportHandler eh)
| 58 | * @return The value of the token. |
| 59 | */ |
| 60 | @Override |
| 61 | public String getToken(String tokenSource, PlayerCharacter pc, ExportHandler eh) |
| 62 | { |
| 63 | StringTokenizer aTok = new StringTokenizer(tokenSource, ".", false); |
| 64 | //Weapono Token |
| 65 | aTok.nextToken(); |
| 66 | |
| 67 | final String ind = aTok.nextToken(); |
| 68 | final int index = Integer.parseInt(ind); |
| 69 | Equipment eq = getWeaponEquipment(pc.getDisplay(), index); |
| 70 | |
| 71 | if (eq != null) |
| 72 | { |
| 73 | return getWeaponToken(pc, eq, aTok, tokenSource); |
| 74 | } |
| 75 | else if (eh != null && eh.getExistsOnly()) |
| 76 | { |
| 77 | eh.setNoMoreItems(true); |
| 78 | if (eh.getCheckBefore()) |
| 79 | { |
| 80 | eh.setCanWrite(false); |
| 81 | } |
| 82 | } |
| 83 | return ""; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Creates equipment based on the first Secondary Weapon. |
nothing calls this directly
no test coverage detected