forked from openrocket/openrocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openrocket#2693 from MiguelECL/AdditionalRocketPro…
…perties [openrocket#2664] Additional rocket properties
- Loading branch information
Showing
7 changed files
with
266 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
40 changes: 40 additions & 0 deletions
40
core/src/main/java/info/openrocket/core/rocketcomponent/DesignType.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package info.openrocket.core.rocketcomponent; | ||
|
||
import info.openrocket.core.l10n.Translator; | ||
import info.openrocket.core.startup.Application; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* The type of design of a rocket, e.g. original design, clone kit, etc. | ||
*/ | ||
public enum DesignType { | ||
ORIGINAL("DesignType.Originaldesign"), | ||
COMMERCIAL_KIT("DesignType.Commercialkit"), | ||
CLONE_KIT("DesignType.Clonekit"), | ||
UPSCALE_KIT("DesignType.Upscalekit"), | ||
DOWNSCALE_KIT("DesignType.Downscalekit"), | ||
MODIFIED_KIT("DesignType.Modificationkit"), | ||
KIT_BASH("DesignType.Kitbashkit"); | ||
|
||
private static final Translator trans = Application.getTranslator(); | ||
private final String translationKey; | ||
|
||
DesignType(String translationKey) { | ||
this.translationKey = translationKey; | ||
} | ||
|
||
public String getName() { | ||
return trans.get(translationKey); | ||
} | ||
|
||
/** | ||
* Returns a string that can be used to store the design type in a file. | ||
* The result is a lowercase string with underscores removed (for some historical reason, that's how OpenRocket | ||
* does it)... | ||
* @return the storable string | ||
*/ | ||
public String getStorableString() { | ||
return name().toLowerCase(Locale.ENGLISH).replace("_", ""); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.