Updated to typescript 2.3
This commit is contained in:
parent
7f27d76248
commit
4be738fe4f
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -1,4 +1,3 @@
|
|||
{
|
||||
"typescript.check.workspaceVersion": false,
|
||||
"typescript.tsdk": "./node_modules/typescript/lib"
|
||||
}
|
|
@ -20,7 +20,7 @@
|
|||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"bower": "~1.8",
|
||||
"codecov": "~1.0",
|
||||
"codecov": "~2.1",
|
||||
"jasmine": "~2.5",
|
||||
"karma": "~1.5",
|
||||
"karma-coverage": "~1.1",
|
||||
|
@ -28,7 +28,7 @@
|
|||
"karma-phantomjs-launcher": "~1.0",
|
||||
"remap-istanbul": "~0.9",
|
||||
"live-server": "~1.2",
|
||||
"typescript": "~2.2",
|
||||
"typescript": "~2.3",
|
||||
"typings": "~2.1"
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ if (typeof window != "undefined") {
|
|||
|
||||
module TS.SpaceTac.Specs {
|
||||
class FakeStorage {
|
||||
data = {}
|
||||
data: any = {}
|
||||
getItem(name: string) {
|
||||
return this.data[name];
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 78179da26a37232fcc25a2df9109dc9c2124ec76
|
||||
Subproject commit 28bf87b126d13f3144955cba4c07bbe03c65e224
|
|
@ -75,7 +75,7 @@ module TS.SpaceTac {
|
|||
*/
|
||||
getFullDescription(): string {
|
||||
let requirements: string[] = [];
|
||||
iteritems(this.requirements, (skill, value) => {
|
||||
iteritems(this.requirements, (skill: keyof ShipAttributes, value) => {
|
||||
if (value > 0) {
|
||||
requirements.push(`- ${SHIP_ATTRIBUTES[skill].name} ${value}`);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ module TS.SpaceTac {
|
|||
/**
|
||||
* Returns true if the equipment can be equipped on a ship with given skills.
|
||||
*
|
||||
* This checks *requirements* against the skills.
|
||||
* This checks *requirements* against the effective (modified) skills.
|
||||
*
|
||||
* This does not check where the equipment currently is (except if is it already attached and should be detached first).
|
||||
*/
|
||||
|
@ -123,7 +123,7 @@ module TS.SpaceTac {
|
|||
return false;
|
||||
} else {
|
||||
var able = true;
|
||||
iteritems(this.requirements, (attr, minvalue) => {
|
||||
iteritems(this.requirements, (attr: keyof ShipAttributes, minvalue) => {
|
||||
if (skills[attr].get() < minvalue) {
|
||||
able = false;
|
||||
}
|
||||
|
|
|
@ -20,11 +20,12 @@ module TS.SpaceTac {
|
|||
|
||||
// Fill the list of templates
|
||||
populate(): void {
|
||||
var templates: LootTemplate[] = [];
|
||||
for (var template_name in TS.SpaceTac.Equipments) {
|
||||
let templates: LootTemplate[] = [];
|
||||
let namespace: any = TS.SpaceTac.Equipments;
|
||||
for (var template_name in namespace) {
|
||||
if (template_name && template_name.indexOf("Abstract") != 0) {
|
||||
var template_class = TS.SpaceTac.Equipments[template_name];
|
||||
var template: LootTemplate = new template_class();
|
||||
let template_class = namespace[template_name];
|
||||
let template: LootTemplate = new template_class();
|
||||
templates.push(template);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ module TS.SpaceTac {
|
|||
// TODO better typing for iteritems
|
||||
|
||||
// Apply base skills
|
||||
iteritems(<any>this.skills, (key, skill: ShipAttribute) => {
|
||||
iteritems(<any>this.skills, (key: keyof ShipAttributes, skill: ShipAttribute) => {
|
||||
new_attrs[key].add(skill.get());
|
||||
});
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ module TS.SpaceTac {
|
|||
* Setup the default set of maneuver evaluators
|
||||
*/
|
||||
private setupDefaultEvaluators() {
|
||||
let scaled = (evaluator: (...args) => number, factor: number) => (...args) => factor * evaluator(...args);
|
||||
let scaled = (evaluator: (...args: any[]) => number, factor: number) => (...args: any[]) => factor * evaluator(...args);
|
||||
let evaluators = [
|
||||
scaled(TacticalAIHelpers.evaluateTurnCost, 1),
|
||||
scaled(TacticalAIHelpers.evaluateDamageToEnemy, 30),
|
||||
|
|
|
@ -156,7 +156,7 @@ module TS.SpaceTac.UI {
|
|||
|
||||
this.attributes[SHIP_ATTRIBUTES[attribute].name] = text;
|
||||
|
||||
if (SHIP_SKILLS[attribute]) {
|
||||
if (SHIP_SKILLS.hasOwnProperty(attribute)) {
|
||||
let button = new Phaser.Button(this.game, x + 54, y - 4, "character-skill-upgrade", () => {
|
||||
this.ship.upgradeSkill(<keyof ShipSkills>attribute);
|
||||
this.refresh();
|
||||
|
|
|
@ -125,7 +125,7 @@ module TS.SpaceTac.UI {
|
|||
let duration = distance * 1000 / speed;
|
||||
|
||||
// Update the tween
|
||||
let changes = {};
|
||||
let changes: any = {};
|
||||
changes[property] = dest;
|
||||
tween.to(changes, duration, easing);
|
||||
|
||||
|
@ -152,7 +152,7 @@ module TS.SpaceTac.UI {
|
|||
x: [obj.x + Math.cos(rotated_obj.rotation) * curve_force, x - Math.cos(angle) * curve_force, x],
|
||||
y: [obj.y + Math.sin(rotated_obj.rotation) * curve_force, y - Math.sin(angle) * curve_force, y]
|
||||
}, duration, Phaser.Easing.Sinusoidal.InOut);
|
||||
tween.interpolation((v, k) => Phaser.Math.bezierInterpolation(v, k));
|
||||
tween.interpolation((v: any, k: any) => Phaser.Math.bezierInterpolation(v, k));
|
||||
let prevx = obj.x;
|
||||
let prevy = obj.y;
|
||||
tween.onUpdateCallback(() => {
|
||||
|
|
|
@ -50,7 +50,7 @@ module TS.SpaceTac.UI {
|
|||
*/
|
||||
static setHoverClick(obj: Phaser.Button, enter: Function, leave: Function, click: Function, hovertime = 300, holdtime = 600) {
|
||||
let holdstart = new Date();
|
||||
let enternext = null;
|
||||
let enternext: Function | null = null;
|
||||
let entercalled = false;
|
||||
let cursorinside = false;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ module TS.SpaceTac.UI {
|
|||
return image;
|
||||
}
|
||||
|
||||
addCircle(radius, width = 3, color = 0x424242): Phaser.Graphics {
|
||||
addCircle(radius: number, width = 3, color = 0x424242): Phaser.Graphics {
|
||||
let circle = this.game.add.graphics(0, 0);
|
||||
circle.lineStyle(width, color);
|
||||
circle.drawCircle(0, 0, radius * 2 / this.scale.x);
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"module": "system",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitReturns": true,
|
||||
"removeComments": true,
|
||||
"preserveConstEnums": true,
|
||||
"out": "out/build.js",
|
||||
"strictNullChecks": true,
|
||||
"strict": true,
|
||||
"sourceMap": true,
|
||||
"target": "es5"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue