<commit_before>/* eslint no-process-env: 0 */
'use strict';

const pjson = require('../package.json');
const os = require('os');
const networks = os.networkInterfaces();

// Find the current IP
var ip = '127.0.0.1';
for(var name in networks){
    if(networks.hasOwnProperty(name)){
        var network = networks[name];
        var i = 0;
        var len = network.length;

        while(i < len){
            var adapter = network[i];
            if(adapter.family === 'IPv4' && adapter.internal === false){
                ip = adapter.address;
                break;
            }
            i++;
        }

        if(ip !== '127.0.0.1'){
            break;
        }
    }
}

/**
 * Game
 * @property {String} playerFaction
 * @property {String} playerFactionId
 * @property {String|Number} skillLevel
 * @property {String|Number} supportedVersion
 * @property {String|Number} healthLevel
 * @property {String} qualityLevel
 * @property {String} saveDir
 * @property {String} saveName
 * @property {String|Boolean} saveId
 * @property {String} modifiedName
 */
class Game {
    constructor(config){
        this.playerFaction = config.playerFaction || 'Faction_9';
        this.playerFactionId = this.playerFaction.split('_')[1];
        this.skillLevel = typeof config.skillLevel === 'undefined' ? 20 : config.skillLevel;
        this.supportedVersion = pjson.engines.game;

        if(this.skillLevel > 20){
            console.warn('Skill level cannot be above 20, setting it to 20 instead');
            this.skillLevel = 20;
        }

        //TODO: Read item health definitions?
        this.healthLevel = typeof config.healthLevel === 'undefined' ? 1000 : config.healthLevel;
        this.qualityLevel = config.qualityLevel || 'Masterwork';

        // TODO: Read from game config file, prompt user for save location, check if running inside the game folder
        this.saveDir = config.saveDir;

        //TODO: Prompt user for save to open
        this.saveName = config.saveName;
        this.saveId = config.saveId || false;
        this.modifiedName = (typeof config.modifiedNamePrefix === 'undefined' ? 'Edited' : config.modifiedNamePrefix) + this.saveName;
    }
}

/**
 * Quick Actions
 * @property {Boolean} woundHostilePawns
 * @property {Boolean} caravanDisaster
 * @property {Boolean} upgradeArt
 * @property {Boolean} empowerPawns
 * @property {Boolean} upgradePawnSkills
 * @property {Boolean} upgradePawnEquipment
 * @property {Boolean} upgradePawnApparel
 * @property {Boolean} upgradeItems
 * @property {Boolean} setPlayerPeace
 * @property {Boolean} setPlayerWar
 * @property {Boolean} setWorldPeace
 * @property {Boolean} setWorldWar
 */
class QuickActions {
    constructor(config){
        // Events
        this.woundHostilePawns = typeof config.woundHostilePawns === 'boolean' ? config.woundHostilePawns : true;
        this.caravanDisaster = typeof config.woundCaravan === 'boolean' ? config.woundCaravan : true;

        // Colony
        this.empowerPawns = typeof config.empowerPawns === 'boolean' ? config.empowerPawns : true;
        this.upgradePawnSkills = typeof config.upgradePawnSkills === 'boolean' ? config.upgradePawnSkills : true;
        this.upgradePawnEquipment = typeof config.upgradePawnEquipment === 'boolean' ? config.upgradePawnEquipment : true;
        this.upgradePawnApparel = typeof config.upgradePawnApparel === 'boolean' ? config.upgradePawnApparel : true;

        // Things
        this.upgradeItems = typeof config.upgradeItems === 'boolean' ? config.upgradeItems : true;
        this.upgradeArt = typeof config.upgradeArt === 'boolean' ? config.upgradeArt : true;

        // Factions
        this.setPlayerPeace = config.setPlayerPeace || false;
        this.setPlayerWar = config.setPlayerWar || false;
        this.setWorldPeace = config.setWorldPeace || false;
        this.setWorldWar = config.setWorldWar || false;
<commit_msg>Remove empower - Don't remember what I wanted to do with that option<commit_after>/* eslint no-process-env: 0 */
'use strict';

const pjson = require('../package.json');
const os = require('os');
const networks = os.networkInterfaces();

// Find the current IP
var ip = '127.0.0.1';
for(var name in networks){
    if(networks.hasOwnProperty(name)){
        var network = networks[name];
        var i = 0;
        var len = network.length;

        while(i < len){
            var adapter = network[i];
            if(adapter.family === 'IPv4' && adapter.internal === false){
                ip = adapter.address;
                break;
            }
            i++;
        }

        if(ip !== '127.0.0.1'){
            break;
        }
    }
}

/**
 * Game
 * @property {String} playerFaction
 * @property {String} playerFactionId
 * @property {String|Number} skillLevel
 * @property {String|Number} supportedVersion
 * @property {String|Number} healthLevel
 * @property {String} qualityLevel
 * @property {String} saveDir
 * @property {String} saveName
 * @property {String|Boolean} saveId
 * @property {String} modifiedName
 */
class Game {
    constructor(config){
        this.playerFaction = config.playerFaction || 'Faction_9';
        this.playerFactionId = this.playerFaction.split('_')[1];
        this.skillLevel = typeof config.skillLevel === 'undefined' ? 20 : config.skillLevel;
        this.supportedVersion = pjson.engines.game;

        if(this.skillLevel > 20){
            console.warn('Skill level cannot be above 20, setting it to 20 instead');
            this.skillLevel = 20;
        }

        //TODO: Read item health definitions?
        this.healthLevel = typeof config.healthLevel === 'undefined' ? 1000 : config.healthLevel;
        this.qualityLevel = config.qualityLevel || 'Masterwork';

        // TODO: Read from game config file, prompt user for save location, check if running inside the game folder
        this.saveDir = config.saveDir;

        //TODO: Prompt user for save to open
        this.saveName = config.saveName;
        this.saveId = config.saveId || false;
        this.modifiedName = (typeof config.modifiedNamePrefix === 'undefined' ? 'Edited' : config.modifiedNamePrefix) + this.saveName;
    }
}

/**
 * Quick Actions
 * @property {Boolean} woundHostilePawns
 * @property {Boolean} caravanDisaster
 * @property {Boolean} upgradeArt
 * @property {Boolean} upgradePawnSkills
 * @property {Boolean} upgradePawnEquipment
 * @property {Boolean} upgradePawnApparel
 * @property {Boolean} upgradeItems
 * @property {Boolean} setPlayerPeace
 * @property {Boolean} setPlayerWar
 * @property {Boolean} setWorldPeace
 * @property {Boolean} setWorldWar
 */
class QuickActions {
    constructor(config){
        // Events
        this.woundHostilePawns = typeof config.woundHostilePawns === 'boolean' ? config.woundHostilePawns : true;
        this.caravanDisaster = typeof config.woundCaravan === 'boolean' ? config.woundCaravan : true;

        // Colony
        this.upgradePawnSkills = typeof config.upgradePawnSkills === 'boolean' ? config.upgradePawnSkills : true;
        this.upgradePawnEquipment = typeof config.upgradePawnEquipment === 'boolean' ? config.upgradePawnEquipment : true;
        this.upgradePawnApparel = typeof config.upgradePawnApparel === 'boolean' ? config.upgradePawnApparel : true;

        // Things
        this.upgradeItems = typeof config.upgradeItems === 'boolean' ? config.upgradeItems : true;
        this.upgradeArt = typeof config.upgradeArt === 'boolean' ? config.upgradeArt : true;

        // Factions
        this.setPlayerPeace = config.setPlayerPeace || false;
        this.setPlayerWar = config.setPlayerWar || false;
        this.setWorldPeace = config.setWorldPeace || false;
        this.setWorldWar = config.setWorldWar || false;

{'fraction_non_alphanumeric': 0.11875808538163002, 'fraction_numerical': 0.008020698576972834, 'mean_word_length': 2.9850515463917526, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1950205', 'n_tokens_mistral': 2281, 'n_tokens_neox': 2189, 'n_words': 548}