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

[FactionInfo] Expose getter and setter for faction relationships #1951

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oznogon
Copy link
Contributor

@oznogon oznogon commented Mar 24, 2023

  • Add conversion functions for EFactionVsFactionState as a parameter and return value

  • Replace the overloaded FactionInfo::getState function with separate getRelationshipWith and getRelationshipBetween functions, and replaces usage of FactionInfo::getState with the equivalent getRelationshipBetween

  • Expose getRelationshipWith to scripting:

    human_navy = getFactionInfo("Human Navy")
    kraylor = getFactionInfo("Kraylor")
    human_kraylor_relationship = kraylor:getRelationshipWith(human_navy) -- returns "enemy"
  • Add setRelationshipWith

Towards #530.

@oznogon oznogon force-pushed the convert-efactionvsfactionstate branch from 3f96c89 to 2db0bea Compare March 24, 2023 05:13
@oznogon oznogon changed the title [FactionInfo] Expose getter for faction relationships [FactionInfo] Expose getter and setter for faction relationships Mar 24, 2023

if (state == FVF_Enemy) { setEnemy(other); }
else if (state == FVF_Friendly) { setFriendly(other); }
// else if (state == FVF_Neutral) { setNeutral(other); }
Copy link
Contributor Author

@oznogon oznogon Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If #1953 is merged, uncomment this liine.

Suggested change
// else if (state == FVF_Neutral) { setNeutral(other); }
else if (state == FVF_Neutral) { setNeutral(other); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant