In AbstractDefaultCard's source code, the constructor starts with:
public AbstractDefaultCard(final String id, final String name, final String img, final int cost, final String rawDescription, final CardType type, final CardColor color, final CardRarity rarity, final CardTarget target) { super(id, name, img, cost, rawDescription, type, color, rarity, target); super(id, name, img, cost, rawDescription, type, color, rarity, target);
To make hardcoding the name and description a more difficult and less tempting course of action, I propose we do that following:
Copy the class currently named AbstractDefaultCard to AbstractDynamicCard
Delete the dynamic variables and related methods from AbstractDefaultCard
Delete the name and rawDescription parameters from AbstractDefaultCard's ctor's declaration.
In the super call replace name and rawDescription with CardCrawlGame.languagePack.getCardStrings(id).NAME and CardCrawlGame.languagePack.getCardStrings(id).DESCRIPTION.
Turn all cards into child classes that extend AbstractDefaultCard. If they already did, make them extend AbstractDynamicCard instead.
Delete the text declaration code below from all cards, and delete the now-undefined ctor parameters
public static final String ID = DefaultMod.makeID("DefaultCommonAttack");
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
This idea synergizes with #34 in nudging people to check the jsons for any name or description-related errors.
In AbstractDefaultCard's source code, the constructor starts with:
public AbstractDefaultCard(final String id, final String name, final String img, final int cost, final String rawDescription, final CardType type, final CardColor color, final CardRarity rarity, final CardTarget target) { super(id, name, img, cost, rawDescription, type, color, rarity, target); super(id, name, img, cost, rawDescription, type, color, rarity, target);
To make hardcoding the name and description a more difficult and less tempting course of action, I propose we do that following:
name
andrawDescription
withCardCrawlGame.languagePack.getCardStrings(id).NAME
andCardCrawlGame.languagePack.getCardStrings(id).DESCRIPTION
.This idea synergizes with #34 in nudging people to check the jsons for any name or description-related errors.