diff --git a/src/main/java/org/openRealmOfStars/player/government/GovernmentType.java b/src/main/java/org/openRealmOfStars/player/government/GovernmentType.java index 1ce622181..e0692f919 100644 --- a/src/main/java/org/openRealmOfStars/player/government/GovernmentType.java +++ b/src/main/java/org/openRealmOfStars/player/government/GovernmentType.java @@ -197,6 +197,51 @@ public int getIndex() { return index; } + /** + * Get Ruler selection type. + * @return Ruler Selection type. + */ + public RulerSelection getRulerSelection() { + switch (this) { + default: + case CLAN: + case HORDE: + case HIVEMIND: + case NEST: { + return RulerSelection.STRONG_RULER; + } + case HIERARCHY: + case REGIME: { + return RulerSelection.STRONG_RULER; + } + case EMPIRE: + case FEUDALISM: + case KINGDOM: { + return RulerSelection.HEIR_TO_THRONE; + } + case GUILD: + case ENTERPRISE: { + return RulerSelection.CEO_AS_A_RULER; + } + case DEMOCRACY: + case TECHNOCRACY: + case UNION: { + return RulerSelection.ELECTION_TYPE1; + } + case FEDERATION: + case REPUBLIC: { + return RulerSelection.ELECTION_TYPE2; + } + case UTOPIA: + case HEGEMONY: { + return RulerSelection.HEGEMONIA_RULER; + } + case AI: + case COLLECTIVE: { + return RulerSelection.AI_RULER; + } + } + } /** * Is government immune to happiness system? * Is Government single minded organism? diff --git a/src/main/java/org/openRealmOfStars/player/government/RulerSelection.java b/src/main/java/org/openRealmOfStars/player/government/RulerSelection.java new file mode 100644 index 000000000..7132bd88c --- /dev/null +++ b/src/main/java/org/openRealmOfStars/player/government/RulerSelection.java @@ -0,0 +1,64 @@ +package org.openRealmOfStars.player.government; +/* + * Open Realm of Stars game project + * Copyright (C) 2024 Tuomo Untinen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see http://www.gnu.org/licenses/ + */ + +/** + * Enumeration how ruler is selected for government. + * + */ +public enum RulerSelection { + + /** Strong ruler is selected which has aggressive perks. Age also matters + * and should not be too young or too old. Also if parent has been known + * leader this affects. + */ + STRONG_RULER, + /** Ruler is being selected based hereditary ranks. If there are not heirs, + * then STRONG_RULER is being used. + */ + HEIR_TO_THRONE, + /** + * Ruler is selected like CEO is being selected for big corporation. Leader + * needs to be skillful and willing to make credits. Older candidates are + * more likely to be selected. + */ + CEO_AS_A_RULER, + /** + * Ruler is being elected, charismatic, peaceful and skillful leader is good + * chance to be elected. Certain age is good, but too old start dropping the + * chances. There is also a bit randomness which is simulating the voting. + */ + ELECTION_TYPE1, + /** + * Ruler is being elected, charismatic, strong and skillful leader is good + * chance to be elected. Old age is good for election. + * There is also a bit randomness which is simulating the voting. + */ + ELECTION_TYPE2, + /** + * Strong minded, charismatic leader has good chance to win. Candidate age + * also affects, but too old get negative score. + */ + HEGEMONIA_RULER, + /** + * Skillful, charismatic leader, but pacifist or peacefull is negative for + * leader. Age does not matter at all. Only number of perks. + */ + AI_RULER; + +}