forked from Garethp/ScreepsAutocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First Commit
- Loading branch information
0 parents
commit f9247a2
Showing
12 changed files
with
369 additions
and
0 deletions.
There are no files selected for viewing
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,2 @@ | ||
.idea/ | ||
atlassian-ide-plugin.xml |
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,65 @@ | ||
Creep = function() | ||
{ | ||
|
||
}; | ||
|
||
Creep.prototype = { | ||
|
||
id: null, | ||
|
||
name: null, | ||
|
||
owner: null, | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
memory: null, | ||
|
||
my: true, | ||
|
||
spawning: true, | ||
|
||
body: [ ], | ||
|
||
energy: 0, | ||
|
||
energyCapacity: 0, | ||
|
||
hits: 0, | ||
|
||
hitsMax: 0, | ||
|
||
ticksToLive: 0, | ||
|
||
fatigue: 0, | ||
|
||
attack: function(target) { }, | ||
|
||
build: function(target) { }, | ||
|
||
dropEnergy: function(amount) { }, | ||
|
||
getActiveBodyparts: function(type) { }, | ||
|
||
harvest: function(target) { }, | ||
|
||
move: function(direction) { }, | ||
|
||
moveTo: function(target, opts) { }, | ||
|
||
pickup: function(target) { }, | ||
|
||
rangedAttack: function(target) { }, | ||
|
||
suicide: function() { }, | ||
|
||
transferEnergy: function(target, amount) { } | ||
}; |
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,20 @@ | ||
Energy = function() | ||
{ | ||
|
||
}; | ||
|
||
Energy.prototype = { | ||
id: "", | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
energy: 0 | ||
}; |
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,20 @@ | ||
Exit = function() | ||
{ | ||
|
||
}; | ||
|
||
Exit.prototype = { | ||
id: "", | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
exit: 0 | ||
}; |
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,24 @@ | ||
Flag = function() | ||
{ | ||
|
||
}; | ||
|
||
Flag.prototype = { | ||
id: "", | ||
|
||
name: "", | ||
|
||
roomName: "", | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
remove: function() { } | ||
}; |
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,87 @@ | ||
var Game = function() | ||
{ | ||
|
||
}; | ||
|
||
Game.prototype = { | ||
OK: 0, | ||
ERR_NOT_OWNER: -1, | ||
ERR_NO_PATH: -2, | ||
ERR_NAME_EXISTS: -3, | ||
ERR_BUSY: -4, | ||
ERR_NOT_FOUND: -5, | ||
ERR_NOT_ENOUGH_ENERGY: -6, | ||
ERR_INVALID_TARGET: -6, | ||
ERR_FULL: -8, | ||
ERR_NOT_IN_RANGE: -9, | ||
ERR_INVALID_ARGS: -10, | ||
ERR_TIRED: -11, | ||
ERR_NO_BODYPART: -12, | ||
ERR_NOT_ENOUGH_EXTENSIONS: -13, | ||
|
||
CREEPS: 1, | ||
MY_CREEPS: 2, | ||
HOSTILE_CREEPS: 3, | ||
SOURCES_ACTIVE: 4, | ||
SOURCES: 5, | ||
DROPPED_ENERGY: 6, | ||
STRUCTURES: 7, | ||
MY_STRUCTURES: 8, | ||
HOSTILE_STRUCTURES: 9, | ||
FLAGS: 10, | ||
CONSTRUCTION_SITES: 11, | ||
MY_SPAWNS: 12, | ||
HOSTILE_SPAWNS: 13, | ||
EXIT_TOP: 14, | ||
EXIT_RIGHT: 15, | ||
EXIT_BOTTOM: 16, | ||
EXIT_LEFT: 17, | ||
|
||
TOP: 1, | ||
TOP_RIGHT: 2, | ||
RIGHT: 3, | ||
BOTTOM_RIGHT: 4, | ||
BOTTOM: 5, | ||
BOTTOM_LEFT: 6, | ||
LEFT: 7, | ||
TOP_LEFT: 8, | ||
|
||
MOVE: "move", | ||
WORK: "work", | ||
CARRY: "carry", | ||
ATTACK: "attack", | ||
RANGED_ATTACK: "ranged_attack", | ||
TOUGH: "tough", | ||
HEAL: "heal", | ||
|
||
STRUCTURE_EXTENSION: "extension", | ||
STRUCTURE_RAMPART: "rampart", | ||
STRUCTURE_ROAD: "road", | ||
STRUCTURE_SPAWN: "spawn", | ||
STRUCTURE_WALL: "constructedWall", | ||
|
||
/** | ||
* @type Creep[] | ||
*/ | ||
creeps: null, | ||
|
||
flags: null, | ||
|
||
/** | ||
* @type Spawn[] | ||
*/ | ||
spawns: null, | ||
|
||
/** | ||
* @type Structure[] | ||
*/ | ||
structures: null, | ||
|
||
time: 0, | ||
|
||
getObjectById: function(id) { }, | ||
|
||
getRoom: function(name) { }, | ||
|
||
notify: function(message) { } | ||
}; |
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,5 @@ | ||
Screeps Autocomplete | ||
==================== | ||
The purpose of this is to add screeps autocomplete to IDE's by creating a defintion from the documents. People can then | ||
add this project as a library in their IDE, and their IDE should be able to start autocompleting their code. Tested | ||
somewhat in JetBrain's WebStorm |
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,29 @@ | ||
Room = function() | ||
{ | ||
|
||
}; | ||
|
||
Room.prototype = { | ||
name: "", | ||
|
||
createFlag: function(x, y, name) { }, | ||
|
||
createConstructionSite: function(x, y, structureType) { }, | ||
|
||
find: function(type, opts) { }, | ||
|
||
lookAt: function(x, y, opts) { }, | ||
|
||
findPath: function(fromPos, toPos, opts) { }, | ||
|
||
/** | ||
* | ||
* @param x {Number} The X position. | ||
* @param y {Number} The Y position. | ||
* | ||
* @return RoomPosition | ||
*/ | ||
getPositionAt: function(x, y) { }, | ||
|
||
makeSnapshot: function(description) { } | ||
}; |
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,25 @@ | ||
RoomPosition = function() | ||
{ | ||
}; | ||
|
||
RoomPosition.prototype = { | ||
x: 0, | ||
|
||
y: 0, | ||
|
||
roomName: 0, | ||
|
||
inRangeTo: function(toPos, range) { }, | ||
|
||
isNearTo: function(x, y) { }, | ||
|
||
getDirectionTo: function(x, y) { }, | ||
|
||
findPathTo: function(target, opts) { }, | ||
|
||
findNearest: function(type, opts) { }, | ||
|
||
findInRange: function(type, range, opts) { }, | ||
|
||
equalsTo: function(x, y) { } | ||
}; |
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,24 @@ | ||
Source = function() | ||
{ | ||
|
||
}; | ||
|
||
Source.prototype = { | ||
id: "", | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
energy: 0, | ||
|
||
energyCapacity: 0, | ||
|
||
ticksToRegeneration: 0 | ||
}; |
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,42 @@ | ||
Spawn = function() | ||
{ | ||
|
||
}; | ||
|
||
Spawn.prototype = { | ||
id: "", | ||
|
||
name: "", | ||
|
||
owner: "", | ||
|
||
/** | ||
* @type Room | ||
*/ | ||
room: null, | ||
|
||
/** | ||
* @type RoomPosition | ||
*/ | ||
pos: null, | ||
|
||
memory: [ ], | ||
|
||
my: true, | ||
|
||
structureType: 'spawn', | ||
|
||
spawning: null, | ||
|
||
energy: 0, | ||
|
||
energyCapacity: 0, | ||
|
||
hits: 0, | ||
|
||
hitsMax: 0, | ||
|
||
createCreep: function(bodyParts, name, memory) { }, | ||
|
||
transferEnergy: function(target, amount) { } | ||
}; |
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,26 @@ | ||
Structure = function() | ||
{ | ||
|
||
}; | ||
|
||
Structure.prototype = { | ||
id: "", | ||
|
||
owner: "", | ||
|
||
room: null, | ||
|
||
pos: null, | ||
|
||
hits: 0, | ||
|
||
hitsMax: 0, | ||
|
||
structureType: "", | ||
|
||
my: true, | ||
|
||
energy: 0, | ||
|
||
energyCapacity: 0 | ||
}; |