Restored game save serialization (using tscommon)
This commit is contained in:
parent
bee43583ca
commit
877af0e8c8
1
TODO
1
TODO
|
@ -1,4 +1,3 @@
|
|||
* Restore serialization
|
||||
* Drones: add tooltip
|
||||
* Drones: add hull points and take area damage
|
||||
* Drones: change the sprite angle for deploy animation
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 795267025bbe1f67c33645af12096dd57a8f1109
|
||||
Subproject commit 4e1d39b95da965bbb68900e5dd6137c6b17d5f91
|
|
@ -52,7 +52,7 @@ module TS.SpaceTac {
|
|||
|
||||
var result = new Battle(player1.fleet, player2.fleet);
|
||||
if (with_ai) {
|
||||
player2.ai = new AI.BullyAI(player2.fleet);
|
||||
player2.ai = new BullyAI(player2.fleet);
|
||||
}
|
||||
result.start();
|
||||
return result;
|
||||
|
|
|
@ -19,8 +19,8 @@ module TS.SpaceTac {
|
|||
this.filters = [];
|
||||
}
|
||||
|
||||
postSerialize(fields: any): void {
|
||||
fields.subscribers = [];
|
||||
postUnserialize(): void {
|
||||
this.subscribers = [];
|
||||
}
|
||||
|
||||
// Clear the stored events
|
||||
|
|
|
@ -6,7 +6,7 @@ module TS.SpaceTac.Specs {
|
|||
battle.endBattle(battle.fleets[0]);
|
||||
}
|
||||
|
||||
/*describe("GameSession", () => {
|
||||
describe("GameSession", () => {
|
||||
it("serializes to a string", () => {
|
||||
var session = new GameSession();
|
||||
session.startQuickBattle(true);
|
||||
|
@ -37,5 +37,5 @@ module TS.SpaceTac.Specs {
|
|||
// Check equality after game steps
|
||||
expect(loaded_session).toEqual(session);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ module TS.SpaceTac {
|
|||
fleet: Fleet;
|
||||
|
||||
// AI playing (null for human player)
|
||||
ai: AI.AbstractAI;
|
||||
ai: AbstractAI;
|
||||
|
||||
// List of visited star systems
|
||||
visited: StarLocation[] = [];
|
||||
|
|
|
@ -54,7 +54,7 @@ module TS.SpaceTac {
|
|||
var fleet_generator = new FleetGenerator(random);
|
||||
var ship_count = random.throwInt(1, 5);
|
||||
this.encounter = fleet_generator.generate(this.star.level, null, ship_count);
|
||||
this.encounter.player.ai = new AI.BullyAI(this.encounter);
|
||||
this.encounter.player.ai = new BullyAI(this.encounter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.AI {
|
||||
module TS.SpaceTac {
|
||||
// Base class for all Artificial Intelligence interaction
|
||||
export class AbstractAI {
|
||||
// The fleet controlled by this AI
|
||||
|
@ -29,8 +29,8 @@ module TS.SpaceTac.AI {
|
|||
this.random = new RandomGenerator();
|
||||
}
|
||||
|
||||
postSerialize(fields: any): void {
|
||||
fields.workqueue = [];
|
||||
postUnserialize(): void {
|
||||
this.workqueue = [];
|
||||
}
|
||||
|
||||
// Play a ship turn
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.AI.Specs {
|
||||
module TS.SpaceTac.Specs {
|
||||
describe("BullyAI", function () {
|
||||
it("lists enemies", function () {
|
||||
var battle = new Battle();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference path="AbstractAI.ts"/>
|
||||
module TS.SpaceTac.AI {
|
||||
module TS.SpaceTac {
|
||||
// Combination of a move action and a fire action
|
||||
export class BullyManeuver {
|
||||
// Move action to position the ship before firing
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.AI {
|
||||
module TS.SpaceTac {
|
||||
// Ship maneuver for an artifical intelligence
|
||||
// A maneuver is like a human player action, choosing an equipment and using it
|
||||
export class Maneuver {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module TS.SpaceTac.AI {
|
||||
module TS.SpaceTac {
|
||||
// A chain of Maneuver to execute sequentially
|
||||
export class ManeuverSequence {
|
||||
// Concerned ship
|
||||
|
|
Loading…
Reference in a new issue