Move the remaining legacy item template lookups to CObjectTemplate
Dev commands, BuildingManager, ChatManager, ForgeManager, NPCManager, NPC, Warehouse, WorkOrder and ManageNPCMsg now call CObjectTemplate.lookup instead of ItemTemplate.templates.get. Forge production cost reads getItemResourceCosts(). Only the DB loader and linkCacheTemplates still use the legacy class (removed in Task 1.8). Removes the static_item_templates ParityCheck comparator. Final parity (offline p17.py, 7586 rows): every id has a cache template, 0 item_type differences, 0 item_resource_costs differences (84 ITEMs have costs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b4e9815e0
commit
566870de79
17 files changed
+67
-70
No files matched your search
@@ -13,6 +13,7 @@ import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
|
||||
public class PrintBonusesCmd extends AbstractDevCmd {
|
||||
@@ -33,8 +34,8 @@ public class PrintBonusesCmd extends AbstractDevCmd {
|
||||
if (target instanceof Item) {
|
||||
type = "Item";
|
||||
tar = (Item) target;
|
||||
ItemTemplate template = ItemTemplate.templates.get(((Item) tar).templateID);
|
||||
name = template.cacheTemplate.getItemBaseName();
|
||||
CObjectTemplate template = CObjectTemplate.lookup(((Item) tar).templateID);
|
||||
name = template.getItemBaseName();
|
||||
} else if (target instanceof AbstractCharacter) {
|
||||
tar = (AbstractCharacter) target;
|
||||
name = ((AbstractCharacter) tar).getFirstName();
|
||||
|
||||
Reference in new issue
Block a user