<commit_before>'use strict';

let counts = require('counts');

class BaseRole {
    constructor(creep) {
        this.creep = creep;
        this.spawn = Game.spawns[creep.memory.spawnName];
    }

    static wantsToBuild(level) {
        let want = this.LEVEL_INFO[level || 0].count || 0,
            typeKey = this.key(),
            have = counts[typeKey] || 0;

        return want < have;
    }

    static getCreep(level) {
        return {
            parts: this.LEVEL_INFO[level],
            memory: {
                role: this.key()
            }
        };
    }

    getRally() {
        let rallyPoint = this.spawn.pos;
        if (Game.flags.BoushleyRally) {
            rallyPoint = Game.flags.BoushleyRally.pos;
        }
<commit_msg>Add reference to memory to base role.<commit_after>'use strict';

let counts = require('counts');

class BaseRole {
    constructor(creep) {
        this.creep = creep;
        this.spawn = Game.spawns[creep.memory.spawnName];
        this.memory = creep.memory;
    }

    static wantsToBuild(level) {
        let want = this.LEVEL_INFO[level || 0].count || 0,
            typeKey = this.key(),
            have = counts[typeKey] || 0;

        return want < have;
    }

    static getCreep(level) {
        return {
            parts: this.LEVEL_INFO[level],
            memory: {
                role: this.key()
            }
        };
    }

    getRally() {
        let rallyPoint = this.spawn.pos;
        if (Game.flags.BoushleyRally) {
            rallyPoint = Game.flags.BoushleyRally.pos;
        }

{'fraction_non_alphanumeric': 0.12084398976982097, 'fraction_numerical': 0.0038363171355498722, 'mean_word_length': 1.693631669535284, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6912505', 'n_tokens_mistral': 505, 'n_tokens_neox': 488, 'n_words': 94}