Skip to content

Commit

Permalink
#738 Adds RulerSelection enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomount committed Apr 13, 2024
1 parent c564a9b commit ebac330
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

}

0 comments on commit ebac330

Please sign in to comment.