[Maintenance]: Replace Token imageAssetMap

Open
#6,186 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
desktop

Research direction

Start in the Token model class and find imageAssetMap with a project-wide search, since the payload does not list the call sites. Add an MD5Key field for the token image, deprecate the map accessor, and move each caller to the new field, using the portrait and charsheet fields as the pattern. Done when the map is deprecated, no remaining code relies on the null key, and the existing tests still pass.

Written by the indexing model from the issue text.

Description

code-maintenance
Describe the problem

Currently, Token contains an entire map to manage assets. Only the null key is ever used, representing the main token image. The intended purpose of the map has never been made clear.

The improvement you'd like to see
  • Deprecate Token#imageAssetMap.
  • Add a new field of type MD5Key to represent the token image.
  • Update uses of Token#imageAssetMap to instead use the new field.
Expected Benefits

Clearer intent in the Token class, including a closer parallel with the portrait and charsheet assets.

Additional Context

No response

Dominant language
Java
Stars
927
Forks
286
Avg merge
3d 17h
Merged PRs (30d)
94

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RPTools/maptool

All issues in RPTools/maptool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.