Skip to content

Instantly share code, notes, and snippets.

@philpursglove
Created June 1, 2025 21:03
Show Gist options
  • Save philpursglove/a173b59ad76378a2c6a26fd977d4c03c to your computer and use it in GitHub Desktop.
Save philpursglove/a173b59ad76378a2c6a26fd977d4c03c to your computer and use it in GitHub Desktop.
PilotBuilder
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