Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make more dynamically generated - C# reflections? #3

Open
jessinthecloud opened this issue May 5, 2021 · 1 comment
Open

make more dynamically generated - C# reflections? #3

jessinthecloud opened this issue May 5, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request refactor improve code quality

Comments

@jessinthecloud
Copy link
Owner

jsonInfoObj.Add("name", ValheimJsonExporter.Localize(shared.m_name));
jsonInfoObj.Add("itemType", shared.m_itemType.ToString()); // ItemType
jsonInfoObj.Add("description", ValheimJsonExporter.Localize(shared.m_description));
jsonInfoObj.Add("aiAttackInterval", shared.m_aiAttackInterval);
jsonInfoObj.Add("aiAttackMaxAngle", shared.m_aiAttackMaxAngle);
jsonInfoObj.Add("aiAttackRange", shared.m_aiAttackRange);
// jsonInfoObj.Add("aiAttackRangeMin", shared.m_aiAttackRangeMin); // null
// jsonInfoObj.Add("aiPrioritized", shared.m_aiPrioritized); // null
// jsonInfoObj.Add("aiTargetType", shared.m_aiTargetType); // AiTarget
jsonInfoObj.Add("aiWhenFlying", shared.m_aiWhenFlying);
jsonInfoObj.Add("aiWhenSwiming", shared.m_aiWhenSwiming);
jsonInfoObj.Add("aiWhenWalking", shared.m_aiWhenWalking);
jsonInfoObj.Add("animationState", shared.m_animationState); // AnimationState
jsonInfoObj.Add("armor", shared.m_armor);
jsonInfoObj.Add("attackForce", shared.m_attackForce);
jsonInfoObj.Add("backstabBonus", shared.m_backstabBonus);
jsonInfoObj.Add("blockable", shared.m_blockable);
jsonInfoObj.Add("blockPower", shared.m_blockPower);
jsonInfoObj.Add("blockPowerPerLevel", shared.m_blockPowerPerLevel);
jsonInfoObj.Add("canBeReparied", shared.m_canBeReparied);
jsonInfoObj.Add("deflectionForce", shared.m_deflectionForce);
jsonInfoObj.Add("deflectionForcePerLevel", shared.m_deflectionForcePerLevel);
jsonInfoObj.Add("destroyBroken", shared.m_destroyBroken);
jsonInfoObj.Add("dodgeable", shared.m_dodgeable);
jsonInfoObj.Add("durabilityDrain", shared.m_durabilityDrain);
jsonInfoObj.Add("durabilityPerLevel", shared.m_durabilityPerLevel);
jsonInfoObj.Add("equipDuration", shared.m_equipDuration);
jsonInfoObj.Add("food", shared.m_food);
jsonInfoObj.Add("foodBurnTime", shared.m_foodBurnTime);
jsonInfoObj.Add("foodRegen", shared.m_foodRegen);
jsonInfoObj.Add("foodStamina", shared.m_foodStamina);
jsonInfoObj.Add("helmetHideHair", shared.m_helmetHideHair);
jsonInfoObj.Add("holdDurationMin", shared.m_holdDurationMin);
jsonInfoObj.Add("holdStaminaDrain", shared.m_holdStaminaDrain);
jsonInfoObj.Add("maxDurability", shared.m_maxDurability);
jsonInfoObj.Add("maxQuality", shared.m_maxQuality);
jsonInfoObj.Add("maxStackSize", shared.m_maxStackSize);
jsonInfoObj.Add("movementModifier", shared.m_movementModifier);
jsonInfoObj.Add("questItem", shared.m_questItem);
jsonInfoObj.Add("setSize", shared.m_setSize);
jsonInfoObj.Add("teleportable", shared.m_teleportable);
jsonInfoObj.Add("timedBlockBonus", shared.m_timedBlockBonus);
jsonInfoObj.Add("toolTier", shared.m_toolTier);
jsonInfoObj.Add("useDurability", shared.m_useDurability);
jsonInfoObj.Add("useDurabilityDrain", shared.m_useDurabilityDrain);
jsonInfoObj.Add("value", shared.m_value);
jsonInfoObj.Add("variants", shared.m_variants);
jsonInfoObj.Add("weight", shared.m_weight);
jsonInfoObj.Add("ammoType", shared.m_ammoType);

@jessinthecloud jessinthecloud added the refactor improve code quality label May 5, 2021
@jessinthecloud jessinthecloud self-assigned this May 5, 2021
@jessinthecloud jessinthecloud added the enhancement New feature or request label May 5, 2021
@jessinthecloud
Copy link
Owner Author

If it doesn't, jotunn might

var pieceTables = ReflectionHelper.GetPrivateField<Dictionary<string, PieceTable>>(PieceManager.Instance, "PieceTables");

@jessinthecloud jessinthecloud changed the title make more dynamically generated - maybe C# has reflections? make more dynamically generated - C# reflections? May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor improve code quality
Projects
None yet
Development

No branches or pull requests

1 participant