Created
June 1, 2025 21:03
-
-
Save philpursglove/a173b59ad76378a2c6a26fd977d4c03c to your computer and use it in GitHub Desktop.
PilotBuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PilotBuilder { | |
private PilotCardInfo pilot = new PilotCardInfo25(); | |
public PilotCardInfo25 Build() { | |
return pilot; | |
} | |
public PilotBuilder WithName(string name) { | |
pilot.pilotName = name; | |
return this; | |
} | |
public PilotBuilder WithVersion(VersionRequirement version) { | |
pilot.Version = version; | |
return this; | |
} | |
WithAbility | |
WithFaction | |
etc etc | |
} | |
public enum VersionRequirement { | |
AMG, | |
XWA, | |
Extended, | |
... | |
} | |
public class DarthVaderAMG : TIEAdvancedX1 { | |
public DarthVaderAMG() : base() { | |
PilotInfo = new PilotBuilder() | |
.WithName("Darth Vader") | |
.WithVersion(Version.AMG) | |
// fill in other properties | |
.Build(); | |
} | |
} | |
public class DarthVaderXWA : TIEAdvancedX1 { | |
public DarthVaderXWA() : base() { | |
PilotInfo = new PilotBuilder() | |
.WithName("Darth Vader") | |
.WithVersion(Version.XWA) | |
// fill in other properties | |
.Build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment