1
0
Fork 0

Added submodule tscommon, shared with Succession

This commit is contained in:
Michaël Lemaire 2017-01-27 00:52:45 +01:00
parent d82f89aeb5
commit 92764542df
129 changed files with 134 additions and 130 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "src/common"]
path = src/common
url = https://code.thunderk.net/michael/tscommon.git

View file

@ -31,7 +31,7 @@
<script> <script>
window.oncontextmenu = function (e) { e.preventDefault(); }; window.oncontextmenu = function (e) { e.preventDefault(); };
window.onload = function () { window.onload = function () {
new SpaceTac.GameUI(); new TS.SpaceTac.GameUI();
}; };
</script> </script>
</body> </body>

View file

@ -4,7 +4,7 @@ if (typeof window != "undefined") {
(<any>window).describe = (<any>window).describe || function () { }; (<any>window).describe = (<any>window).describe || function () { };
} }
module SpaceTac { module TS.SpaceTac {
// Router between game views // Router between game views
export class GameUI extends Phaser.Game { export class GameUI extends Phaser.Game {
// Current game session // Current game session

1
src/common Submodule

@ -0,0 +1 @@
Subproject commit c79c6fa24da6b065163a45139722d368f0ca6d0f

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("Attribute", function () { describe("Attribute", function () {
it("is initially not limited", function () { it("is initially not limited", function () {
var attr = new Attribute(); var attr = new Attribute();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Code to identify // Code to identify
export enum AttributeCode { export enum AttributeCode {
// Initiative level // Initiative level

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("AttributeCollection", function () { describe("AttributeCollection", function () {
it("sets and gets an attribute value", function () { it("sets and gets an attribute value", function () {
var coll = new AttributeCollection(); var coll = new AttributeCollection();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Collection of several attributes // Collection of several attributes
export class AttributeCollection extends Serializable { export class AttributeCollection extends Serializable {
// Attributes // Attributes

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("Battle", function () { describe("Battle", function () {
it("defines play order by initiative throws", function () { it("defines play order by initiative throws", function () {
var fleet1 = new Fleet(null); var fleet1 = new Fleet(null);

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// A turn-based battle between fleets // A turn-based battle between fleets
export class Battle extends Serializable { export class Battle extends Serializable {
// Flag indicating if the battle is ended // Flag indicating if the battle is ended

View file

@ -1,6 +1,6 @@
/// <reference path="events/BaseLogEvent.ts"/> /// <reference path="events/BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Check a single game log event // Check a single game log event
function checkEvent(got: BaseLogEvent, ship: Ship, code: string, function checkEvent(got: BaseLogEvent, ship: Ship, code: string,
target_ship: Ship = null, target_x: number = null, target_y: number = null): void { target_ship: Ship = null, target_x: number = null, target_y: number = null): void {

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Log of a battle // Log of a battle
// This keeps track of all events in a battle // This keeps track of all events in a battle
// It also allows to register a callback to receive these events // It also allows to register a callback to receive these events

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("BattleOutcome", () => { describe("BattleOutcome", () => {
it("generates loot from dead ships, for the winner to take", () => { it("generates loot from dead ships, for the winner to take", () => {
var fleet1 = new Fleet(); var fleet1 = new Fleet();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Result of an ended battle // Result of an ended battle
export class BattleOutcome extends Serializable { export class BattleOutcome extends Serializable {
// Indicates if the battle is a draw (no winner) // Indicates if the battle is a draw (no winner)

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("EffectTemplate", () => { describe("EffectTemplate", () => {
it("interpolates between weak and strong effects", () => { it("interpolates between weak and strong effects", () => {
var base_effect = new AttributeMaxEffect(AttributeCode.Hull, 6); var base_effect = new AttributeMaxEffect(AttributeCode.Hull, 6);

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Modifier for a value of a BaseEffect subclass // Modifier for a value of a BaseEffect subclass
export class EffectTemplateModifier { export class EffectTemplateModifier {
// Value name // Value name

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Equipment", () => { describe("Equipment", () => {
it("checks capabilities requirements", function () { it("checks capabilities requirements", function () {
var equipment = new Equipment(); var equipment = new Equipment();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Piece of equipment to attach in slots // Piece of equipment to attach in slots
export class Equipment extends Serializable { export class Equipment extends Serializable {
// Actual slot this equipment is attached to // Actual slot this equipment is attached to

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("Fleet", function () { describe("Fleet", function () {
it("get average level", function () { it("get average level", function () {
var fleet = new Fleet(); var fleet = new Fleet();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// A fleet of ships // A fleet of ships
export class Fleet extends Serializable { export class Fleet extends Serializable {
// Fleet owner // Fleet owner

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Generator of balanced ships to form a fleet // Generator of balanced ships to form a fleet
export class FleetGenerator { export class FleetGenerator {
// Random generator to use // Random generator to use

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
function applyGameSteps(session: GameSession): void { function applyGameSteps(session: GameSession): void {
var battle = session.getBattle(); var battle = session.getBattle();
battle.advanceToNextShip(); battle.advanceToNextShip();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// A game session, binding a universe and a player // A game session, binding a universe and a player
export class GameSession extends Serializable { export class GameSession extends Serializable {
// Game universe // Game universe

View file

@ -1,6 +1,6 @@
/// <reference path="LootTemplate.ts" /> /// <reference path="LootTemplate.ts" />
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
class TestTemplate extends LootTemplate { class TestTemplate extends LootTemplate {
constructor() { constructor() {
super(SlotType.Shield, "Hexagrid Shield"); super(SlotType.Shield, "Hexagrid Shield");

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Equipment generator from loot templates // Equipment generator from loot templates
export class LootGenerator { export class LootGenerator {
// List of available templates // List of available templates
@ -21,9 +21,9 @@ module SpaceTac.Game {
// Fill the list of templates // Fill the list of templates
populate(): void { populate(): void {
var templates: LootTemplate[] = []; var templates: LootTemplate[] = [];
for (var template_name in SpaceTac.Game.Equipments) { for (var template_name in TS.SpaceTac.Game.Equipments) {
if (template_name) { if (template_name) {
var template_class = SpaceTac.Game.Equipments[template_name]; var template_class = TS.SpaceTac.Game.Equipments[template_name];
var template: LootTemplate = new template_class(); var template: LootTemplate = new template_class();
templates.push(template); templates.push(template);
} }

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("LootTemplate", () => { describe("LootTemplate", () => {
it("interpolates between weak and strong loot", () => { it("interpolates between weak and strong loot", () => {
var template = new LootTemplate(SlotType.Weapon, "Bulletator"); var template = new LootTemplate(SlotType.Weapon, "Bulletator");

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Template used to generate a loot equipment // Template used to generate a loot equipment
export class LootTemplate extends Serializable { export class LootTemplate extends Serializable {
// Type of slot this equipment will fit in // Type of slot this equipment will fit in

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("NameGenerator", () => { describe("NameGenerator", () => {
it("generates unique names", () => { it("generates unique names", () => {
var random = new RandomGenerator(0.48, 0.9, 0.1); var random = new RandomGenerator(0.48, 0.9, 0.1);

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// A unique name generator // A unique name generator
export class NameGenerator { export class NameGenerator {
// List of available choices // List of available choices

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// One player (human or IA) // One player (human or IA)
export class Player extends Serializable { export class Player extends Serializable {
// Universe in which we are playing // Universe in which we are playing

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Random generator, used in all throws // Random generator, used in all throws
export class RandomGenerator extends Serializable { export class RandomGenerator extends Serializable {
// Array of next values, empty for a correct generator // Array of next values, empty for a correct generator

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
function checkProportional(range: Range, value1: number, value2: number) { function checkProportional(range: Range, value1: number, value2: number) {
expect(range.getProportional(value1)).toEqual(value2); expect(range.getProportional(value1)).toEqual(value2);
expect(range.getReverseProportional(value2)).toEqual(value1); expect(range.getReverseProportional(value2)).toEqual(value1);

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Range of number values // Range of number values
export class Range extends Serializable { export class Range extends Serializable {
// Minimal value // Minimal value

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Base class for serializable objects // Base class for serializable objects
export class Serializable { export class Serializable {
static _next_sid: number = 0; static _next_sid: number = 0;

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
export class SerializableTestObj3 extends Serializable { export class SerializableTestObj3 extends Serializable {
a: boolean; a: boolean;
b: SerializableTestObj1; b: SerializableTestObj1;

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Serializer to cascade through Serializable objects // Serializer to cascade through Serializable objects
export class Serializer { export class Serializer {
// Mapping of IDs to objects // Mapping of IDs to objects
@ -29,7 +29,7 @@ module SpaceTac.Game {
} }
return result; return result;
} else { } else {
return this.collectSerializableClasses(SpaceTac.Game, "SpaceTac.Game"); return this.collectSerializableClasses(TS.SpaceTac.Game, "SpaceTac.Game");
} }
} }

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Ship", function () { describe("Ship", function () {
it("moves and computes facing angle", function () { it("moves and computes facing angle", function () {
var ship = new Ship(null, "Test"); var ship = new Ship(null, "Test");

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// A single ship in a Fleet // A single ship in a Fleet
export class Ship extends Serializable { export class Ship extends Serializable {
// Fleet this ship is a member of // Fleet this ship is a member of

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("ShipGenerator", function () { describe("ShipGenerator", function () {
it("can use ship model", function () { it("can use ship model", function () {
var gen = new ShipGenerator(); var gen = new ShipGenerator();

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Generator of random ship // Generator of random ship
export class ShipGenerator { export class ShipGenerator {
// Random number generator used // Random number generator used

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// A model of ship // A model of ship
// It defines the ship looks, and available slots for equipment // It defines the ship looks, and available slots for equipment
export class ShipModel { export class ShipModel {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Slot", () => { describe("Slot", () => {
it("checks equipment type", () => { it("checks equipment type", () => {
var ship = new Ship(); var ship = new Ship();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Types of slots // Types of slots
export enum SlotType { export enum SlotType {
Armor, Armor,

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Star", () => { describe("Star", () => {
it("lists links to other stars", () => { it("lists links to other stars", () => {
var universe = new Universe(); var universe = new Universe();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// A star system // A star system
export class Star extends Serializable { export class Star extends Serializable {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("StarLink", () => { describe("StarLink", () => {
it("checks link intersection", () => { it("checks link intersection", () => {
var star1 = new Star(null, 0, 0); var star1 = new Star(null, 0, 0);

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// An hyperspace link between two star systems // An hyperspace link between two star systems
export class StarLink extends Serializable { export class StarLink extends Serializable {
// Stars // Stars

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("StarLocation", () => { describe("StarLocation", () => {
it("removes generated encounters that lose", function () { it("removes generated encounters that lose", function () {
var location = new StarLocation(null, StarLocationType.PLANET, 0, 0); var location = new StarLocation(null, StarLocationType.PLANET, 0, 0);

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
export enum StarLocationType { export enum StarLocationType {
STAR, STAR,
WARP, WARP,

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Target", () => { describe("Target", () => {
it("initializes from ship or location", () => { it("initializes from ship or location", () => {
var target: Target; var target: Target;

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Find the nearest intersection between a line and a circle // Find the nearest intersection between a line and a circle
// Circle is supposed to be centered at (0,0) // Circle is supposed to be centered at (0,0)
// Nearest intersection to (x1,y1) is returned // Nearest intersection to (x1,y1) is returned

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// unit testing utilities // unit testing utilities
export class TestTools { export class TestTools {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
class TestObj { class TestObj {
a: string; a: string;
b: any; b: any;

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Generic tools functions // Generic tools functions
export class Tools { export class Tools {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("Universe", () => { describe("Universe", () => {
it("generates star systems", () => { it("generates star systems", () => {
var universe = new Universe(); var universe = new Universe();

View file

@ -1,6 +1,6 @@
/// <reference path="Serializable.ts"/> /// <reference path="Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Main game universe // Main game universe
export class Universe extends Serializable { export class Universe extends Serializable {
// List of star systems // List of star systems

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("BaseAction", function () { describe("BaseAction", function () {
it("check if equipment can be used with remaining AP", function () { it("check if equipment can be used with remaining AP", function () {
var equipment = new Equipment(SlotType.Armor); var equipment = new Equipment(SlotType.Armor);

View file

@ -1,6 +1,6 @@
/// <reference path="../Serializable.ts"/> /// <reference path="../Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Base class for action definitions // Base class for action definitions
export class BaseAction extends Serializable { export class BaseAction extends Serializable {
// Identifier code for the type of action // Identifier code for the type of action

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("EndTurnAction", () => { describe("EndTurnAction", () => {
it("can't be applied to non-playing ship", () => { it("can't be applied to non-playing ship", () => {
var battle = Battle.newQuickRandom(); var battle = Battle.newQuickRandom();

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Action to end the ship's turn // Action to end the ship's turn
export class EndTurnAction extends BaseAction { export class EndTurnAction extends BaseAction {
constructor() { constructor() {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseAction.ts"/> /// <reference path="BaseAction.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Action to fire a weapon on another ship, or in space // Action to fire a weapon on another ship, or in space
export class FireWeaponAction extends BaseAction { export class FireWeaponAction extends BaseAction {
// Boolean set to true if the weapon can target space // Boolean set to true if the weapon can target space

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
describe("MoveAction", function () { describe("MoveAction", function () {
it("checks movement against remaining AP", function () { it("checks movement against remaining AP", function () {
var ship = new Ship(); var ship = new Ship();

View file

@ -1,4 +1,4 @@
module SpaceTac.Game { module TS.SpaceTac.Game {
// Action to move to a given location // Action to move to a given location
export class MoveAction extends BaseAction { export class MoveAction extends BaseAction {

View file

@ -1,6 +1,6 @@
/// <reference path="../Serializable.ts"/> /// <reference path="../Serializable.ts"/>
module SpaceTac.Game.AI { module TS.SpaceTac.Game.AI {
// Base class for all Artificial Intelligence interaction // Base class for all Artificial Intelligence interaction
export class AbstractAI extends Serializable { export class AbstractAI extends Serializable {
// The fleet controlled by this AI // The fleet controlled by this AI

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.AI.Specs { module TS.SpaceTac.Game.AI.Specs {
describe("BullyAI", function () { describe("BullyAI", function () {
it("lists enemies", function () { it("lists enemies", function () {
var battle = new Battle(); var battle = new Battle();

View file

@ -1,5 +1,5 @@
/// <reference path="AbstractAI.ts"/> /// <reference path="AbstractAI.ts"/>
module SpaceTac.Game.AI { module TS.SpaceTac.Game.AI {
// Combination of a move action and a fire action // Combination of a move action and a fire action
export class BullyManeuver { export class BullyManeuver {
// Move action to position the ship before firing // Move action to position the ship before firing

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.AI { module TS.SpaceTac.Game.AI {
// Ship maneuver for an artifical intelligence // Ship maneuver for an artifical intelligence
// A maneuver is like a human player action, choosing an equipment and using it // A maneuver is like a human player action, choosing an equipment and using it
export class Maneuver { export class Maneuver {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.AI { module TS.SpaceTac.Game.AI {
// A chain of Maneuver to execute sequentially // A chain of Maneuver to execute sequentially
export class ManeuverSequence { export class ManeuverSequence {
// Concerned ship // Concerned ship

View file

@ -1,6 +1,6 @@
/// <reference path="BaseEffect.ts"/> /// <reference path="BaseEffect.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Hard limitation on attribute value // Hard limitation on attribute value
// For example, this could be used to slow a target by limiting its action points // For example, this could be used to slow a target by limiting its action points
export class AttributeLimitEffect extends BaseEffect { export class AttributeLimitEffect extends BaseEffect {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseEffect.ts"/> /// <reference path="BaseEffect.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Effect on attribute maximum // Effect on attribute maximum
// Typically, these effects are summed up to define an attribute maximum // Typically, these effects are summed up to define an attribute maximum
export class AttributeMaxEffect extends BaseEffect { export class AttributeMaxEffect extends BaseEffect {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseEffect.ts"/> /// <reference path="BaseEffect.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Effect on attribute value // Effect on attribute value
// Typically, these effects are summed up to define an attribute value // Typically, these effects are summed up to define an attribute value
export class AttributeValueEffect extends BaseEffect { export class AttributeValueEffect extends BaseEffect {

View file

@ -1,6 +1,6 @@
/// <reference path="../Serializable.ts"/> /// <reference path="../Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Base class for effects of actions // Base class for effects of actions
// Effects are typically one shot, but sticky effects can be used to apply effects over a period // Effects are typically one shot, but sticky effects can be used to apply effects over a period
export class BaseEffect extends Serializable { export class BaseEffect extends Serializable {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseEffect.ts"/> /// <reference path="BaseEffect.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Apply damage to a ship // Apply damage to a ship
export class DamageEffect extends BaseEffect { export class DamageEffect extends BaseEffect {
// Base damage points // Base damage points

View file

@ -1,6 +1,6 @@
/// <reference path="BaseEffect.ts"/> /// <reference path="BaseEffect.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
/** /**
* Wrapper around another effect, to make it stick to a ship. * Wrapper around another effect, to make it stick to a ship.
* *

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("AbstractWeapon", function () { describe("AbstractWeapon", function () {
it("has fire action, and damage effects on target", function () { it("has fire action, and damage effects on target", function () {
var weapon = new Equipments.AbstractWeapon("Super Fire Weapon", 50, 60); var weapon = new Equipments.AbstractWeapon("Super Fire Weapon", 50, 60);

View file

@ -1,6 +1,6 @@
/// <reference path="../LootTemplate.ts"/> /// <reference path="../LootTemplate.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
// Base convenience class for weapons // Base convenience class for weapons
export class AbstractWeapon extends LootTemplate { export class AbstractWeapon extends LootTemplate {
// Boolean set to true if the weapon can target space // Boolean set to true if the weapon can target space

View file

@ -1,6 +1,6 @@
/// <reference path="../LootTemplate.ts"/> /// <reference path="../LootTemplate.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class BasicForceField extends LootTemplate { export class BasicForceField extends LootTemplate {
constructor() { constructor() {
super(SlotType.Shield, "Basic Force Field"); super(SlotType.Shield, "Basic Force Field");

View file

@ -1,6 +1,6 @@
/// <reference path="../LootTemplate.ts"/> /// <reference path="../LootTemplate.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class BasicPowerCore extends LootTemplate { export class BasicPowerCore extends LootTemplate {
constructor() { constructor() {
super(SlotType.Power, "Basic Power Core"); super(SlotType.Power, "Basic Power Core");

View file

@ -1,6 +1,6 @@
/// <reference path="../LootTemplate.ts"/> /// <reference path="../LootTemplate.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
// Equipment: Conventional Engine // Equipment: Conventional Engine
export class ConventionalEngine extends LootTemplate { export class ConventionalEngine extends LootTemplate {
constructor() { constructor() {

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("EnergyDepleter", () => { describe("EnergyDepleter", () => {
it("limits target's AP", () => { it("limits target's AP", () => {
var template = new Equipments.EnergyDepleter(); var template = new Equipments.EnergyDepleter();

View file

@ -1,6 +1,6 @@
/// <reference path="AbstractWeapon.ts"/> /// <reference path="AbstractWeapon.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class EnergyDepleter extends AbstractWeapon { export class EnergyDepleter extends AbstractWeapon {
constructor() { constructor() {
super("Energy Depleter"); super("Energy Depleter");

View file

@ -1,6 +1,6 @@
/// <reference path="AbstractWeapon.ts"/> /// <reference path="AbstractWeapon.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class GatlingGun extends AbstractWeapon { export class GatlingGun extends AbstractWeapon {
constructor() { constructor() {
super("Gatling Gun", 50, 100); super("Gatling Gun", 50, 100);

View file

@ -1,6 +1,6 @@
/// <reference path="../LootTemplate.ts"/> /// <reference path="../LootTemplate.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class IronHull extends LootTemplate { export class IronHull extends LootTemplate {
constructor() { constructor() {
super(SlotType.Armor, "IronHull"); super(SlotType.Armor, "IronHull");

View file

@ -1,4 +1,4 @@
module SpaceTac.Game.Specs { module TS.SpaceTac.Game.Specs {
describe("SubMunitionMissile", () => { describe("SubMunitionMissile", () => {
it("hits several targets in circle", () => { it("hits several targets in circle", () => {
var battle = TestTools.createBattle(1, 2); var battle = TestTools.createBattle(1, 2);

View file

@ -1,6 +1,6 @@
/// <reference path="AbstractWeapon.ts"/> /// <reference path="AbstractWeapon.ts"/>
module SpaceTac.Game.Equipments { module TS.SpaceTac.Game.Equipments {
export class SubMunitionMissile extends AbstractWeapon { export class SubMunitionMissile extends AbstractWeapon {
constructor() { constructor() {
super("SubMunition Missile", 30, 50); super("SubMunition Missile", 30, 50);

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a ship moves // Event logged when a ship moves
export class AttributeChangeEvent extends BaseLogEvent { export class AttributeChangeEvent extends BaseLogEvent {
// Saved version of the attribute // Saved version of the attribute

View file

@ -1,6 +1,6 @@
/// <reference path="../Serializable.ts"/> /// <reference path="../Serializable.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Base class for a BattleLog event // Base class for a BattleLog event
export class BaseLogEvent extends Serializable { export class BaseLogEvent extends Serializable {
// Code of the event (its type) // Code of the event (its type)

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a ship takes damage // Event logged when a ship takes damage
export class DamageEvent extends BaseLogEvent { export class DamageEvent extends BaseLogEvent {
// Damage to hull // Damage to hull

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a ship is dead // Event logged when a ship is dead
export class DeathEvent extends BaseLogEvent { export class DeathEvent extends BaseLogEvent {
constructor(ship: Ship) { constructor(ship: Ship) {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a sticky effect is added to a ship // Event logged when a sticky effect is added to a ship
export class EffectAddedEvent extends BaseLogEvent { export class EffectAddedEvent extends BaseLogEvent {
// Pointer to the effect // Pointer to the effect

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a sticky effect is added to a ship // Event logged when a sticky effect is added to a ship
export class EffectDurationChangedEvent extends BaseLogEvent { export class EffectDurationChangedEvent extends BaseLogEvent {
// Pointer to the effect // Pointer to the effect

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a sticky effect is removed from a ship // Event logged when a sticky effect is removed from a ship
export class EffectRemovedEvent extends BaseLogEvent { export class EffectRemovedEvent extends BaseLogEvent {
// Pointer to the effect // Pointer to the effect

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when the battle ended // Event logged when the battle ended
// This is always the last event of a battle log // This is always the last event of a battle log
export class EndBattleEvent extends BaseLogEvent { export class EndBattleEvent extends BaseLogEvent {

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a weapon is used on a target // Event logged when a weapon is used on a target
export class FireEvent extends BaseLogEvent { export class FireEvent extends BaseLogEvent {
// Weapon used // Weapon used

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Event logged when a ship moves // Event logged when a ship moves
export class MoveEvent extends BaseLogEvent { export class MoveEvent extends BaseLogEvent {
// New facing angle, in radians // New facing angle, in radians

View file

@ -1,6 +1,6 @@
/// <reference path="BaseLogEvent.ts"/> /// <reference path="BaseLogEvent.ts"/>
module SpaceTac.Game { module TS.SpaceTac.Game {
// Battle event, when a ship turn ended, and advanced to a new one // Battle event, when a ship turn ended, and advanced to a new one
export class ShipChangeEvent extends BaseLogEvent { export class ShipChangeEvent extends BaseLogEvent {
constructor(ship: Ship, new_ship: Ship) { constructor(ship: Ship, new_ship: Ship) {

View file

@ -1,4 +1,4 @@
module SpaceTac.View { module TS.SpaceTac.View {
// Base class for all game views // Base class for all game views
export class BaseView extends Phaser.State { export class BaseView extends Phaser.State {
// Link to the root UI // Link to the root UI

View file

@ -1,4 +1,4 @@
module SpaceTac.View { module TS.SpaceTac.View {
export class Boot extends Phaser.State { export class Boot extends Phaser.State {
preload() { preload() {
this.load.image("preload-background", "assets/images/preload/bar-background.png"); this.load.image("preload-background", "assets/images/preload/bar-background.png");

View file

@ -1,6 +1,6 @@
/// <reference path="BaseView.ts"/> /// <reference path="BaseView.ts"/>
module SpaceTac.View { module TS.SpaceTac.View {
export class MainMenu extends BaseView { export class MainMenu extends BaseView {
group: Phaser.Group; group: Phaser.Group;
button_new_game: Phaser.Button; button_new_game: Phaser.Button;

View file

@ -1,6 +1,6 @@
/// <reference path="BaseView.ts"/> /// <reference path="BaseView.ts"/>
module SpaceTac.View { module TS.SpaceTac.View {
export class Preload extends BaseView { export class Preload extends BaseView {
private preloadBar: Phaser.Image; private preloadBar: Phaser.Image;

Some files were not shown because too many files have changed in this diff Show more