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 Prerequisite Lint Check use ITechTreePrerequisiteInfo #15344

Merged
merged 1 commit into from Jul 26, 2018

Conversation

Projects
None yet
4 participants
@MustaphaTR
Copy link
Member

MustaphaTR commented Jul 13, 2018

and make LobbyPrerequisiteCheckboxInfo implement ITechTreePrerequisiteInfo.

Fixes #15343.


string[] ITechTreePrerequisiteInfo.Prerequisites(ActorInfo info)
{
return new string[] { Prerequisite == null ? info.Name : Prerequisite };

This comment has been minimized.

@pchote

pchote Jul 13, 2018

Member

This can simplify to { Prerequisite ?? info.Name }

@@ -43,7 +43,9 @@ public class LobbyPrerequisiteCheckboxInfo : ITraitInfo, ILobbyOptions

[FieldLoader.Require]
[Desc("Prerequisites to grant when this checkbox is enabled.")]
public readonly HashSet<string> Prerequisites = new HashSet<string>();
public readonly string[] Prerequisites = { };

This comment has been minimized.

@pchote

pchote Jul 13, 2018

Member

Please keep this as a HashSet<string>

public interface ITechTreePrerequisiteInfo : ITraitInfo { }
public interface ITechTreePrerequisiteInfo : ITraitInfo
{
string[] Prerequisites(ActorInfo info);

This comment has been minimized.

@pchote

pchote Jul 13, 2018

Member

Change this to IEnumerable<string> to allow both string[] and HashSet<string> to be returned. Also needs a newline after the closing }.

@MustaphaTR MustaphaTR force-pushed the MustaphaTR:fix-lint-checkbox-prereq branch from 17eabf1 to b83b0e3 Jul 13, 2018

@MustaphaTR

This comment has been minimized.

Copy link
Member Author

MustaphaTR commented Jul 13, 2018

Updated.

@GraionDilach
Copy link
Contributor

GraionDilach left a comment

👍

This also provides a door for @forcecore's BotProvidesPrerequsite even.

@pchote

pchote approved these changes Jul 26, 2018

@pchote pchote merged commit c14c765 into OpenRA:bleed Jul 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MustaphaTR MustaphaTR deleted the MustaphaTR:fix-lint-checkbox-prereq branch Jul 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.