-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #793 from The-International-Screeps-Bot/Development
New minor version(s)
- Loading branch information
Showing
211 changed files
with
74,902 additions
and
71,833 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
{ | ||
"[javascript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[json]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.renderWhitespace": "none", | ||
"files.encoding": "utf8", | ||
"files.insertFinalNewline": true, | ||
"files.trimTrailingWhitespace": true, | ||
"search.exclude": { | ||
"_book/**": true, | ||
".rpt2_cache/**": true, | ||
"dist/**": true, | ||
"node_modules/**": true, | ||
"typings/**": true | ||
}, | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"eslint.enable": true, | ||
"git.ignoreLimitWarning": true, | ||
"spellright.language": ["en"], | ||
"spellright.documentTypes": ["latex", "plaintext"], | ||
"compile-hero.disable-compile-files-on-did-save-code": true, | ||
"editor.tabSize": 2 | ||
"[javascript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[json]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.renderWhitespace": "none", | ||
"files.encoding": "utf8", | ||
"files.insertFinalNewline": true, | ||
"files.trimTrailingWhitespace": true, | ||
"search.exclude": { | ||
"_book/**": true, | ||
".rpt2_cache/**": true, | ||
"dist/**": true, | ||
"node_modules/**": true, | ||
"typings/**": true | ||
}, | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"eslint.enable": true, | ||
"git.ignoreLimitWarning": true, | ||
"spellright.language": ["en"], | ||
"spellright.documentTypes": ["latex", "plaintext"], | ||
"compile-hero.disable-compile-files-on-did-save-code": true, | ||
"editor.tabSize": 4, | ||
"editor.detectIndentation": false | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Overview | ||
|
||
This document should outline the design strategies and guidelines for the bot. | ||
|
||
The bot intends to implement a primarily data-oriented style, with some aspects of functional, imparative and object oriented design. | ||
|
||
# Data/functional structures | ||
|
||
## Utils | ||
- a static class | ||
- does not contain any state | ||
- contains functions/methods | ||
- acts on singular inputs | ||
|
||
Utils stands for utilities. These are functions that will generally take inputs and provide information in return. | ||
|
||
### Example | ||
|
||
CommuneUtils contains utility functions that provide often cached information on call that helps with processing | ||
|
||
## Procs | ||
- a static class | ||
- does not contain any state | ||
- contains functions/methods | ||
- acts on singular inputs | ||
|
||
Procs stands for processors. These are functions that will generally run logic for specified things. | ||
|
||
### Example | ||
|
||
CommuneProc runs logic for the commune to update data, make intents, and run sub processes like towers, spawning, creeps, etc. | ||
|
||
## Ops | ||
- a static class | ||
- does not contain any state | ||
- contains functions/methods | ||
- acts on singular inputs | ||
|
||
Ops stands for Operations. These are functions that will run logic for specified things, sometimes retrieving values. | ||
|
||
### Example | ||
|
||
HaulerNeedOps contians functions that provide cached information, carry out processes, or whatever else. | ||
|
||
## Services | ||
- a static class | ||
- does not contain any state | ||
- contains function/methods | ||
- acts on plural inputs | ||
|
||
Services run plural inputs, which in turn are generally ran through procs and utils. | ||
|
||
### Example | ||
|
||
RoomServices contains functions that runs logic for a list of rooms. | ||
|
||
## Manager | ||
- a static class | ||
- can contain state | ||
- contains functions/methods | ||
- should generally be avoided given its combination of data and functions, which breaks data-oriented design ideals | ||
|
||
Managers can be a combination of utilities, processors and data. | ||
|
||
## Data | ||
|
||
A state or set of states generally contained in an object. Should not include functions | ||
|
||
should probably be opperated on by Procs. | ||
|
||
### Example | ||
|
||
The MarketManager handles caching market related data, updating / deleting it as needed, while pruning and optimizing existing orders that the bot controls. | ||
|
||
## Use of classes | ||
|
||
Classes should be static, and static classes should not be instantiated. If a class "needs" to be instantiated, there is probably a better way to do it. | ||
|
||
Inherence of classes should be avoided. | ||
classes should no contain state and alter state. They should do only one or the other. | ||
|
||
# Creep Tasks | ||
|
||
Allows creeps to track general inter-tick actions that are desired for fulfillment | ||
|
||
## Task Runners | ||
|
||
Task runners decide what actions to take based on the task data provided. Besides running tasks, runners may delete tasks, stop additional tasks to be ran, and more |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const fs = require('fs') | ||
|
||
fs.copyFileSync('src/settings.example.ts', 'src/settings.ts') | ||
fs.copyFileSync('src/other/userScript/userScript.example.ts', 'src/other/userScript/userScript.ts') | ||
|
||
const settings = fs.readFileSync('src/settings.ts', 'utf8') | ||
const newSettings = settings.replace(/Example/g, '',) | ||
fs.writeFileSync('src/settings.ts', newSettings) | ||
|
||
const userScript = fs.readFileSync('src/other/userScript/userScript.ts', 'utf8') | ||
const newUserScript = userScript.replace(/Example/g, '') | ||
fs.writeFileSync('src/other/userScript/userScript.ts', newUserScript) |
This file contains 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
Oops, something went wrong.