@@ -25,6 +25,10 @@ declare module entitas.utils {
25
25
contains ( e : E ) : boolean ;
26
26
}
27
27
}
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
+ */
28
32
declare module entitas . utils {
29
33
/**
30
34
* Collection type a bit like ArrayList but does not preserve the order of its
@@ -178,13 +182,9 @@ declare module entitas.utils {
178
182
/**
179
183
* Dispatch event
180
184
*
181
- * @param $0
182
- * @param $1
183
- * @param $2
184
- * @param $3
185
- * @param $4
185
+ * @param args list
186
186
*/
187
- dispatch ( $0 ? : any , $1 ?: any , $2 ?: any , $3 ?: any , $4 ?: any ) : void ;
187
+ dispatch ( ... args : any [ ] ) : void ;
188
188
/**
189
189
* Add event listener
190
190
* @param listener
@@ -402,34 +402,34 @@ declare module entitas.exceptions {
402
402
}
403
403
declare module entitas . exceptions {
404
404
import Exception = entitas . Exception ;
405
- class EntityIsNotEnabledException extends Exception {
405
+ class EntityIsAlreadyReleasedException extends Exception {
406
406
/**
407
- * Entity Is Not Enabled Exception
407
+ * Entity Is Already Released Exception
408
408
* @constructor
409
- * @param message
410
409
*/
411
- constructor ( message : string ) ;
410
+ constructor ( ) ;
412
411
}
413
412
}
414
413
declare module entitas . exceptions {
415
414
import Exception = entitas . Exception ;
416
- class EntityIsAlreadyReleasedException extends Exception {
415
+ class EntityIsNotDestroyedException extends Exception {
417
416
/**
418
- * Entity Is Already Released Exception
417
+ * Entity Is Not Destroyed Exception
419
418
* @constructor
419
+ * @param message
420
420
*/
421
- constructor ( ) ;
421
+ constructor ( message : string ) ;
422
422
}
423
423
}
424
424
declare module entitas . exceptions {
425
425
import Exception = entitas . Exception ;
426
- class SingleEntityException extends Exception {
426
+ class EntityIsNotEnabledException extends Exception {
427
427
/**
428
- * Single Entity Exception
428
+ * Entity Is Not Enabled Exception
429
429
* @constructor
430
- * @param matcher
430
+ * @param message
431
431
*/
432
- constructor ( matcher : IMatcher ) ;
432
+ constructor ( message : string ) ;
433
433
}
434
434
}
435
435
declare module entitas . exceptions {
@@ -445,44 +445,68 @@ declare module entitas.exceptions {
445
445
}
446
446
declare module entitas . exceptions {
447
447
import Exception = entitas . Exception ;
448
- class PoolDoesNotContainEntityException extends Exception {
448
+ class MatcherException extends Exception {
449
449
/**
450
- * Pool Does Not Contain Entity Exception
450
+ * Matcher Exception
451
451
* @constructor
452
- * @param entity
453
- * @param message
452
+ * @param matcher
454
453
*/
455
- constructor ( entity : Entity , message : string ) ;
454
+ constructor ( matcher : IMatcher ) ;
456
455
}
457
456
}
458
457
declare module entitas . exceptions {
459
458
import Exception = entitas . Exception ;
460
- class EntityIsNotDestroyedException extends Exception {
459
+ class PoolDoesNotContainEntityException extends Exception {
461
460
/**
462
- * Entity Is Not Destroyed Exception
461
+ * Pool Does Not Contain Entity Exception
463
462
* @constructor
463
+ * @param entity
464
464
* @param message
465
465
*/
466
- constructor ( message : string ) ;
466
+ constructor ( entity : Entity , message : string ) ;
467
467
}
468
468
}
469
469
declare module entitas . exceptions {
470
470
import Exception = entitas . Exception ;
471
- class MatcherException extends Exception {
471
+ class SingleEntityException extends Exception {
472
472
/**
473
- * Matcher Exception
473
+ * Single Entity Exception
474
474
* @constructor
475
475
* @param matcher
476
476
*/
477
477
constructor ( matcher : IMatcher ) ;
478
478
}
479
479
}
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
+ }
480
494
declare module entitas {
481
495
import Entity = entitas . Entity ;
482
496
import IAllOfMatcher = entitas . IAllOfMatcher ;
483
497
import IAnyOfMatcher = entitas . IAnyOfMatcher ;
484
498
import INoneOfMatcher = entitas . INoneOfMatcher ;
485
499
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
+ }
486
510
module Matcher {
487
511
}
488
512
class Matcher implements IAllOfMatcher , IAnyOfMatcher , INoneOfMatcher {
@@ -591,19 +615,6 @@ declare module entitas {
591
615
* @returns {string }
592
616
*/
593
617
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 ;
607
618
/**
608
619
* Get the set if distinct (non-duplicate) indices from a list
609
620
* @param {Array<number> } indices
@@ -623,20 +634,6 @@ declare module entitas {
623
634
private static appendIndices ( sb , prefix , indexArray ) ;
624
635
}
625
636
}
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
- }
640
637
/**
641
638
* entitas ecs
642
639
* @const
@@ -875,7 +872,7 @@ declare module entitas {
875
872
static dim ( count : number , size : number ) : void ;
876
873
/**
877
874
* Initialize
878
- * Extension point to allocate enetity pool.
875
+ * allocate the entity pool.
879
876
*
880
877
* @param {number } totalComponents
881
878
* @returns {Array<entitas.IComponent> }
@@ -1115,16 +1112,7 @@ declare module entitas {
1115
1112
import Group = entitas . Group ;
1116
1113
import Entity = entitas . Entity ;
1117
1114
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 ;
1128
1116
class GroupObserver {
1129
1117
/**
1130
1118
* Entities being observed
@@ -1280,6 +1268,7 @@ declare module entitas {
1280
1268
* Global reference to pool instance
1281
1269
* @type {entitas.Pool } */
1282
1270
static instance : Pool ;
1271
+ _debug : boolean ;
1283
1272
_entities : { } ;
1284
1273
_groups : { } ;
1285
1274
_groupsForIndex : Bag < Bag < Group > > ;
@@ -1310,7 +1299,7 @@ declare module entitas {
1310
1299
* @param {number } totalComponents
1311
1300
* @param {number } startCreationIndex
1312
1301
*/
1313
- constructor ( components : { } , totalComponents : number , startCreationIndex ?: number ) ;
1302
+ constructor ( components : { } , totalComponents : number , debug ?: boolean , startCreationIndex ?: number ) ;
1314
1303
/**
1315
1304
* Create a new entity
1316
1305
* @param {string } name
@@ -1420,6 +1409,22 @@ declare module entitas {
1420
1409
clearReactiveSystems ( ) : void ;
1421
1410
}
1422
1411
}
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
+ }
1423
1428
declare module entitas . viewer {
1424
1429
/**
1425
1430
* Profiler class for Pools
@@ -1458,22 +1463,6 @@ declare module entitas.viewer {
1458
1463
constructor ( _systems : any ) ;
1459
1464
}
1460
1465
}
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
- }
1477
1466
/**
1478
1467
* Inspired by Unity
1479
1468
*/
0 commit comments