Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
First Commit
  • Loading branch information
Garethp committed Dec 4, 2014
0 parents commit f9247a2
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
atlassian-ide-plugin.xml
65 changes: 65 additions & 0 deletions Creep.js
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) { }
};
20 changes: 20 additions & 0 deletions Energy.js
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
};
20 changes: 20 additions & 0 deletions Exit.js
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
};
24 changes: 24 additions & 0 deletions Flag.js
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() { }
};
87 changes: 87 additions & 0 deletions Game.js
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) { }
};
5 changes: 5 additions & 0 deletions Readme.md
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
29 changes: 29 additions & 0 deletions Room.js
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) { }
};
25 changes: 25 additions & 0 deletions RoomPosition.js
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) { }
};
24 changes: 24 additions & 0 deletions Source.js
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
};
42 changes: 42 additions & 0 deletions Spawn.js
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) { }
};
26 changes: 26 additions & 0 deletions Structure.js
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
};

0 comments on commit f9247a2

Please sign in to comment.