mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
refactor - stateForms start
This commit is contained in:
parent
60e69348a9
commit
2be3c68290
15 changed files with 277 additions and 89 deletions
|
|
@ -0,0 +1,15 @@
|
|||
import {each} from "utils/probabilityUtils";
|
||||
|
||||
const {Names} = window;
|
||||
|
||||
export function defineStateName(cellId: number, capitalName: string, cultureId: number, cultures: TCultures): string {
|
||||
const useCapitalName = capitalName.length < 9 && each(5)(cellId);
|
||||
const nameBase = cultures[cultureId].base;
|
||||
const basename: string = useCapitalName ? capitalName : Names.getBaseShort(nameBase);
|
||||
|
||||
return Names.getState(basename, basename);
|
||||
}
|
||||
|
||||
export function defineFullStateName(name: string, form: string) {
|
||||
return `${name} ${form}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue