Skip to content

Commit ea91f25

Browse files
ts 2.1.6
1 parent 71a0910 commit ea91f25

27 files changed

+864
-3131
lines changed

build/entitas.d.ts

Lines changed: 0 additions & 1219 deletions
This file was deleted.

build/entitas.js

Lines changed: 768 additions & 590 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/entitas.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222

2323
0.1.3 - init: add -t bin for non-html projects
2424
platform: no insert namespace in src path, leave as is
25-
25+
26+
0.2.0 - update for typescript 2.1.6, coffeescript 1.12.4

example/ext/example.d.ts

Lines changed: 71 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ declare module entitas.utils {
2525
contains(e: E): boolean;
2626
}
2727
}
28+
/**
29+
* @port https://github.com/junkdog/artemis-odb/blob/master/artemis/src/main/java/com/artemis/utils/Bag.java
30+
* not a full implementation, mostly just what is needed by the game engine.
31+
*/
2832
declare module entitas.utils {
2933
/**
3034
* Collection type a bit like ArrayList but does not preserve the order of its
@@ -178,13 +182,9 @@ declare module entitas.utils {
178182
/**
179183
* Dispatch event
180184
*
181-
* @param $0
182-
* @param $1
183-
* @param $2
184-
* @param $3
185-
* @param $4
185+
* @param args list
186186
*/
187-
dispatch($0?: any, $1?: any, $2?: any, $3?: any, $4?: any): void;
187+
dispatch(...args: any[]): void;
188188
/**
189189
* Add event listener
190190
* @param listener
@@ -402,34 +402,34 @@ declare module entitas.exceptions {
402402
}
403403
declare module entitas.exceptions {
404404
import Exception = entitas.Exception;
405-
class EntityIsNotEnabledException extends Exception {
405+
class EntityIsAlreadyReleasedException extends Exception {
406406
/**
407-
* Entity Is Not Enabled Exception
407+
* Entity Is Already Released Exception
408408
* @constructor
409-
* @param message
410409
*/
411-
constructor(message: string);
410+
constructor();
412411
}
413412
}
414413
declare module entitas.exceptions {
415414
import Exception = entitas.Exception;
416-
class EntityIsAlreadyReleasedException extends Exception {
415+
class EntityIsNotDestroyedException extends Exception {
417416
/**
418-
* Entity Is Already Released Exception
417+
* Entity Is Not Destroyed Exception
419418
* @constructor
419+
* @param message
420420
*/
421-
constructor();
421+
constructor(message: string);
422422
}
423423
}
424424
declare module entitas.exceptions {
425425
import Exception = entitas.Exception;
426-
class SingleEntityException extends Exception {
426+
class EntityIsNotEnabledException extends Exception {
427427
/**
428-
* Single Entity Exception
428+
* Entity Is Not Enabled Exception
429429
* @constructor
430-
* @param matcher
430+
* @param message
431431
*/
432-
constructor(matcher: IMatcher);
432+
constructor(message: string);
433433
}
434434
}
435435
declare module entitas.exceptions {
@@ -445,44 +445,68 @@ declare module entitas.exceptions {
445445
}
446446
declare module entitas.exceptions {
447447
import Exception = entitas.Exception;
448-
class PoolDoesNotContainEntityException extends Exception {
448+
class MatcherException extends Exception {
449449
/**
450-
* Pool Does Not Contain Entity Exception
450+
* Matcher Exception
451451
* @constructor
452-
* @param entity
453-
* @param message
452+
* @param matcher
454453
*/
455-
constructor(entity: Entity, message: string);
454+
constructor(matcher: IMatcher);
456455
}
457456
}
458457
declare module entitas.exceptions {
459458
import Exception = entitas.Exception;
460-
class EntityIsNotDestroyedException extends Exception {
459+
class PoolDoesNotContainEntityException extends Exception {
461460
/**
462-
* Entity Is Not Destroyed Exception
461+
* Pool Does Not Contain Entity Exception
463462
* @constructor
463+
* @param entity
464464
* @param message
465465
*/
466-
constructor(message: string);
466+
constructor(entity: Entity, message: string);
467467
}
468468
}
469469
declare module entitas.exceptions {
470470
import Exception = entitas.Exception;
471-
class MatcherException extends Exception {
471+
class SingleEntityException extends Exception {
472472
/**
473-
* Matcher Exception
473+
* Single Entity Exception
474474
* @constructor
475475
* @param matcher
476476
*/
477477
constructor(matcher: IMatcher);
478478
}
479479
}
480+
declare module entitas {
481+
import GroupEventType = entitas.GroupEventType;
482+
class TriggerOnEvent {
483+
trigger: IMatcher;
484+
eventType: GroupEventType;
485+
/**
486+
* @constructor
487+
*
488+
* @param trigger
489+
* @param eventType
490+
*/
491+
constructor(trigger: IMatcher, eventType: GroupEventType);
492+
}
493+
}
480494
declare module entitas {
481495
import Entity = entitas.Entity;
482496
import IAllOfMatcher = entitas.IAllOfMatcher;
483497
import IAnyOfMatcher = entitas.IAnyOfMatcher;
484498
import INoneOfMatcher = entitas.INoneOfMatcher;
485499
import TriggerOnEvent = entitas.TriggerOnEvent;
500+
/**
501+
* Event Types
502+
* @readonly
503+
* @enum {number}
504+
*/
505+
enum GroupEventType {
506+
OnEntityAdded = 0,
507+
OnEntityRemoved = 1,
508+
OnEntityAddedOrRemoved = 2,
509+
}
486510
module Matcher {
487511
}
488512
class Matcher implements IAllOfMatcher, IAnyOfMatcher, INoneOfMatcher {
@@ -591,19 +615,6 @@ declare module entitas {
591615
* @returns {string}
592616
*/
593617
toString(): string;
594-
/**
595-
* Check if the matchers are equal
596-
* @param {Object} obj
597-
* @returns {boolean}
598-
*/
599-
equals(obj: any): boolean;
600-
/**
601-
* Check if the lists of component indices are equal
602-
* @param {Array<number>} list1
603-
* @param {Array<number>} list2
604-
* @returns {boolean}
605-
*/
606-
static equalIndices(i1: number[], i2: number[]): boolean;
607618
/**
608619
* Get the set if distinct (non-duplicate) indices from a list
609620
* @param {Array<number>} indices
@@ -623,20 +634,6 @@ declare module entitas {
623634
private static appendIndices(sb, prefix, indexArray);
624635
}
625636
}
626-
declare module entitas {
627-
import GroupEventType = entitas.GroupEventType;
628-
class TriggerOnEvent {
629-
trigger: IMatcher;
630-
eventType: GroupEventType;
631-
/**
632-
* @constructor
633-
*
634-
* @param trigger
635-
* @param eventType
636-
*/
637-
constructor(trigger: IMatcher, eventType: GroupEventType);
638-
}
639-
}
640637
/**
641638
* entitas ecs
642639
* @const
@@ -875,7 +872,7 @@ declare module entitas {
875872
static dim(count: number, size: number): void;
876873
/**
877874
* Initialize
878-
* Extension point to allocate enetity pool.
875+
* allocate the entity pool.
879876
*
880877
* @param {number} totalComponents
881878
* @returns {Array<entitas.IComponent>}
@@ -1115,16 +1112,7 @@ declare module entitas {
11151112
import Group = entitas.Group;
11161113
import Entity = entitas.Entity;
11171114
import IComponent = entitas.IComponent;
1118-
/**
1119-
* Event Types
1120-
* @readonly
1121-
* @enum {number}
1122-
*/
1123-
enum GroupEventType {
1124-
OnEntityAdded = 0,
1125-
OnEntityRemoved = 1,
1126-
OnEntityAddedOrRemoved = 2,
1127-
}
1115+
import GroupEventType = entitas.GroupEventType;
11281116
class GroupObserver {
11291117
/**
11301118
* Entities being observed
@@ -1280,6 +1268,7 @@ declare module entitas {
12801268
* Global reference to pool instance
12811269
* @type {entitas.Pool} */
12821270
static instance: Pool;
1271+
_debug: boolean;
12831272
_entities: {};
12841273
_groups: {};
12851274
_groupsForIndex: Bag<Bag<Group>>;
@@ -1310,7 +1299,7 @@ declare module entitas {
13101299
* @param {number} totalComponents
13111300
* @param {number} startCreationIndex
13121301
*/
1313-
constructor(components: {}, totalComponents: number, startCreationIndex?: number);
1302+
constructor(components: {}, totalComponents: number, debug?: boolean, startCreationIndex?: number);
13141303
/**
13151304
* Create a new entity
13161305
* @param {string} name
@@ -1420,6 +1409,22 @@ declare module entitas {
14201409
clearReactiveSystems(): void;
14211410
}
14221411
}
1412+
declare module entitas.viewer {
1413+
/**
1414+
* Profiler class for Entities
1415+
*/
1416+
class EntityBehavior {
1417+
protected obj: any;
1418+
name: string;
1419+
private _name;
1420+
/**
1421+
* @constructor
1422+
*
1423+
* @param obj
1424+
*/
1425+
constructor(obj: any);
1426+
}
1427+
}
14231428
declare module entitas.viewer {
14241429
/**
14251430
* Profiler class for Pools
@@ -1458,22 +1463,6 @@ declare module entitas.viewer {
14581463
constructor(_systems: any);
14591464
}
14601465
}
1461-
declare module entitas.viewer {
1462-
/**
1463-
* Profiler class for Entities
1464-
*/
1465-
class EntityBehavior {
1466-
protected obj: any;
1467-
name: string;
1468-
private _name;
1469-
/**
1470-
* @constructor
1471-
*
1472-
* @param obj
1473-
*/
1474-
constructor(obj: any);
1475-
}
1476-
}
14771466
/**
14781467
* Inspired by Unity
14791468
*/

0 commit comments

Comments
 (0)