This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let travFlag = Game.flags["travFlag"]; | |
if (travFlag) { | |
let newTraveler = new Traveler(); | |
let oldTraveler = new OldTraveler(); | |
let newTravelerCreep = Game.creeps["newTraveler"]; | |
if (!newTravelerCreep) { | |
empire.spawnFromClosest(travFlag.pos, [MOVE], "newTraveler"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {MINERALS_RAW, RESERVE_AMOUNT, TradeNetwork, PRODUCT_LIST} from "./TradeNetwork"; | |
export class MarketTrader { | |
private network: TradeNetwork; | |
constructor(network: TradeNetwork) { | |
this.network = network; | |
} | |
public actions() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {WorldMap} from "./WorldMap"; | |
export class TradeNetwork { | |
public storages: StructureStorage[] = []; | |
public terminals: StructureTerminal[] = []; | |
private shortages: {[resourceType: string]: StructureTerminal[] } = {}; | |
private surpluses: {[resourceType: string]: StructureTerminal[] } = {}; | |
private _inventory: {[key: string]: number}; | |
private map: WorldMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Diplomat { | |
public allies: {[username: string]: boolean}; | |
public foes: {[username: string]: boolean}; | |
public partners: {[username: string]: boolean}; | |
constructor() { | |
if (!Memory.empire) { Memory.empire = {}; } | |
_.defaults(Memory.empire, { | |
allies: ALLIES, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Diplomat} from "./Diplomat"; | |
import {TradeNetwork} from "./TradeNetwork"; | |
export class WorldMap { | |
public controlledRooms: {[roomName: string]: Room } = {}; | |
public allyMap: {[roomName: string]: RoomMemory } = {}; | |
public allyRooms: Room[] = []; | |
public tradeMap: {[roomName: string]: RoomMemory } = {}; | |
public tradeRooms: Room[] = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To start using Traveler, require it in main.js: | |
* Example: var Traveler = require('Traveler.js'); | |
* | |
* Check the footer of this file for suggestions on how to access it at various scopes | |
* | |
*/ | |
"use strict"; | |
const REPORT_CPU_THRESHOLD = 50; | |
const DEFAULT_MAXOPS = 20000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To start using Traveler, require it in main.js: | |
* Example: var Traveler = require('Traveler.js'); | |
* | |
* Check the footer of this file for suggestions on how to access it at various scopes | |
* | |
*/ | |
export interface TravelData { | |
stuck: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
/** | |
* Created by this busta (Luke) on 4/18/2015. | |
*/ | |
public class PrimeNumberRecursive { | |
public static void main(String[] args) { | |
NewerOlder