angry-pixel 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +26 -29
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -538,9 +538,8 @@ declare class EntityManager {
|
|
|
538
538
|
private disabledComponents;
|
|
539
539
|
/**
|
|
540
540
|
* Creates an entity without component
|
|
541
|
-
* @return
|
|
541
|
+
* @return The created Entity
|
|
542
542
|
* @public
|
|
543
|
-
* @category Core
|
|
544
543
|
* @example
|
|
545
544
|
* ```js
|
|
546
545
|
* const entity = entityManager.createEntity();
|
|
@@ -549,9 +548,9 @@ declare class EntityManager {
|
|
|
549
548
|
createEntity(): Entity;
|
|
550
549
|
/**
|
|
551
550
|
* Creates an Entity based on a collection of Component instances and ComponentTypes
|
|
552
|
-
* @param components A collection of
|
|
551
|
+
* @param components A collection of component instances and component classes
|
|
552
|
+
* @return The created Entity
|
|
553
553
|
* @public
|
|
554
|
-
* @category Core
|
|
555
554
|
* @example
|
|
556
555
|
* ```js
|
|
557
556
|
* const entity = entityManager.createEntity([
|
|
@@ -561,11 +560,31 @@ declare class EntityManager {
|
|
|
561
560
|
* ```
|
|
562
561
|
*/
|
|
563
562
|
createEntity(components: Array<ComponentType | Component>): Entity;
|
|
563
|
+
/**
|
|
564
|
+
* Creates multiple entities based on an array of component collections
|
|
565
|
+
* @param components An array of collections of component instances and component classes
|
|
566
|
+
* @return An array with the created entities, in the same order of the collections of components
|
|
567
|
+
* @public
|
|
568
|
+
* @example
|
|
569
|
+
* ```js
|
|
570
|
+
* const parent = [
|
|
571
|
+
* new Transform({position: new Vector2(100, 100)}),
|
|
572
|
+
* SpriteRenderer
|
|
573
|
+
* ];
|
|
574
|
+
*
|
|
575
|
+
* const child = [
|
|
576
|
+
* new Transform({parent: parent[0]}),
|
|
577
|
+
* SpriteRenderer
|
|
578
|
+
* ];
|
|
579
|
+
*
|
|
580
|
+
* const entity = entityManager.createEntities([parent, child]);
|
|
581
|
+
* ```
|
|
582
|
+
*/
|
|
583
|
+
createEntities(componentsList: Component[][]): Entity[];
|
|
564
584
|
/**
|
|
565
585
|
* Removes an Entity and all its Components
|
|
566
586
|
* @param entity The entity to remove
|
|
567
587
|
* @public
|
|
568
|
-
* @category Core
|
|
569
588
|
* @example
|
|
570
589
|
* ```js
|
|
571
590
|
* entityManager.removeEntity(entity);
|
|
@@ -575,7 +594,6 @@ declare class EntityManager {
|
|
|
575
594
|
/**
|
|
576
595
|
* Removes all Entities and all their Components
|
|
577
596
|
* @public
|
|
578
|
-
* @category Core
|
|
579
597
|
* @example
|
|
580
598
|
* ```js
|
|
581
599
|
* entityManager.removeAllEntities();
|
|
@@ -587,7 +605,6 @@ declare class EntityManager {
|
|
|
587
605
|
* @param entity The entity to verify
|
|
588
606
|
* @returns boolean
|
|
589
607
|
* @public
|
|
590
|
-
* @category Core
|
|
591
608
|
* @example
|
|
592
609
|
* ```js
|
|
593
610
|
* const entityEnabled = entityManager.isEntityEnabled(entity);
|
|
@@ -598,7 +615,6 @@ declare class EntityManager {
|
|
|
598
615
|
* Enables an Entity
|
|
599
616
|
* @param entity The entity to be enabled
|
|
600
617
|
* @public
|
|
601
|
-
* @category Core
|
|
602
618
|
* @example
|
|
603
619
|
* ```js
|
|
604
620
|
* entityManager.enableEntity(entity);
|
|
@@ -609,7 +625,6 @@ declare class EntityManager {
|
|
|
609
625
|
* Disables an Entity
|
|
610
626
|
* @param entity The entity to be disabled
|
|
611
627
|
* @public
|
|
612
|
-
* @category Core
|
|
613
628
|
* @example
|
|
614
629
|
* ```js
|
|
615
630
|
* entityManager.disableEntity(entity);
|
|
@@ -620,7 +635,6 @@ declare class EntityManager {
|
|
|
620
635
|
* Disable all Entities that have a component of the given type
|
|
621
636
|
* @param componentType The class of the component
|
|
622
637
|
* @public
|
|
623
|
-
* @category Core
|
|
624
638
|
* @example
|
|
625
639
|
* ```js
|
|
626
640
|
* entityManager.disableEntitiesByComponent(SpriteRenderer);
|
|
@@ -631,7 +645,6 @@ declare class EntityManager {
|
|
|
631
645
|
* Enable all Entities that have a component of the given type
|
|
632
646
|
* @param componentType The class of the component
|
|
633
647
|
* @public
|
|
634
|
-
* @category Core
|
|
635
648
|
* @example
|
|
636
649
|
* ```js
|
|
637
650
|
* entityManager.enableEntitiesByComponent(SpriteRenderer);
|
|
@@ -644,7 +657,6 @@ declare class EntityManager {
|
|
|
644
657
|
* @param componentType The class of the component
|
|
645
658
|
* @returns The instance of the component
|
|
646
659
|
* @public
|
|
647
|
-
* @category Core
|
|
648
660
|
* @example
|
|
649
661
|
* ```js
|
|
650
662
|
* const spriteRenderer = entityManager.addComponent(entity, SpriteRenderer);
|
|
@@ -657,7 +669,6 @@ declare class EntityManager {
|
|
|
657
669
|
* @param component The instance of the component
|
|
658
670
|
* @returns The instance of the component
|
|
659
671
|
* @public
|
|
660
|
-
* @category Core
|
|
661
672
|
* @example
|
|
662
673
|
* ```js
|
|
663
674
|
* const spriteRenderer = new SpriteRenderer();
|
|
@@ -671,7 +682,6 @@ declare class EntityManager {
|
|
|
671
682
|
* @param componentType The class of the component
|
|
672
683
|
* @returns boolean
|
|
673
684
|
* @public
|
|
674
|
-
* @category Core
|
|
675
685
|
* @example
|
|
676
686
|
* ```js
|
|
677
687
|
* const hasSpriteRenderer = entityManager.hasComponent(entity, SpriteRenderer);
|
|
@@ -684,7 +694,6 @@ declare class EntityManager {
|
|
|
684
694
|
* @param componentType The class of the component
|
|
685
695
|
* @returns The instance of the component
|
|
686
696
|
* @public
|
|
687
|
-
* @category Core
|
|
688
697
|
* @example
|
|
689
698
|
* ```js
|
|
690
699
|
* const spriteRenderer = entityManager.getComponent(entity, SpriteRenderer);
|
|
@@ -696,7 +705,6 @@ declare class EntityManager {
|
|
|
696
705
|
* @param entity The entity
|
|
697
706
|
* @returns A collection of component instances
|
|
698
707
|
* @public
|
|
699
|
-
* @category Core
|
|
700
708
|
* @example
|
|
701
709
|
* ```js
|
|
702
710
|
* const components = entityManager.getComponents(entity);
|
|
@@ -708,7 +716,6 @@ declare class EntityManager {
|
|
|
708
716
|
* @param component The component instance
|
|
709
717
|
* @returns The found Entity
|
|
710
718
|
* @public
|
|
711
|
-
* @category Core
|
|
712
719
|
* @example
|
|
713
720
|
* ```js
|
|
714
721
|
* const entity = entityManager.getEntityForComponent(spriteRenderer);
|
|
@@ -719,7 +726,6 @@ declare class EntityManager {
|
|
|
719
726
|
* Removes the component instance from its Entity
|
|
720
727
|
* @param component The component instance
|
|
721
728
|
* @public
|
|
722
|
-
* @category Core
|
|
723
729
|
* @example
|
|
724
730
|
* ```js
|
|
725
731
|
* entityManager.removeComponent(spriteRenderer)
|
|
@@ -731,7 +737,6 @@ declare class EntityManager {
|
|
|
731
737
|
* @param entity The target entity
|
|
732
738
|
* @param componentType The component class
|
|
733
739
|
* @public
|
|
734
|
-
* @category Core
|
|
735
740
|
* @example
|
|
736
741
|
* ```js
|
|
737
742
|
* entityManager.removeComponent(entity, SriteRenderer)
|
|
@@ -743,7 +748,6 @@ declare class EntityManager {
|
|
|
743
748
|
* @param component The component instance
|
|
744
749
|
* @returns boolean
|
|
745
750
|
* @public
|
|
746
|
-
* @category Core
|
|
747
751
|
* @example
|
|
748
752
|
* ```js
|
|
749
753
|
* entityManager.isComponentEnabled(spriteRenderer)
|
|
@@ -756,7 +760,6 @@ declare class EntityManager {
|
|
|
756
760
|
* @param componentType The component class
|
|
757
761
|
* @returns boolean
|
|
758
762
|
* @public
|
|
759
|
-
* @category Core
|
|
760
763
|
* @example
|
|
761
764
|
* ```js
|
|
762
765
|
* entityManager.isComponentEnabled(entity, SpriteRenderer)
|
|
@@ -767,7 +770,6 @@ declare class EntityManager {
|
|
|
767
770
|
* Disables a component instance
|
|
768
771
|
* @param component The component instance
|
|
769
772
|
* @public
|
|
770
|
-
* @category Core
|
|
771
773
|
* @example
|
|
772
774
|
* ```js
|
|
773
775
|
* entityManager.disableComponent(spriteRenderer);
|
|
@@ -779,7 +781,6 @@ declare class EntityManager {
|
|
|
779
781
|
* @param entity The target entity
|
|
780
782
|
* @param componentType The component class
|
|
781
783
|
* @public
|
|
782
|
-
* @category Core
|
|
783
784
|
* @example
|
|
784
785
|
* ```js
|
|
785
786
|
* entityManager.disableComponent(entity, SpriteRenderer);
|
|
@@ -790,7 +791,6 @@ declare class EntityManager {
|
|
|
790
791
|
* Enables a component instance
|
|
791
792
|
* @param component The component instance
|
|
792
793
|
* @public
|
|
793
|
-
* @category Core
|
|
794
794
|
* @example
|
|
795
795
|
* ```js
|
|
796
796
|
* entityManager.enableComponent(spriteRenderer);
|
|
@@ -802,7 +802,6 @@ declare class EntityManager {
|
|
|
802
802
|
* @param entity The target entity
|
|
803
803
|
* @param componentType The component class
|
|
804
804
|
* @public
|
|
805
|
-
* @category Core
|
|
806
805
|
* @example
|
|
807
806
|
* ```js
|
|
808
807
|
* entityManager.enableComponent(entity, SpriteRenderer);
|
|
@@ -819,7 +818,6 @@ declare class EntityManager {
|
|
|
819
818
|
* @param includeDisabled TRUE to incluide disabled entities and components, FALSE otherwise
|
|
820
819
|
* @returns SearchResult
|
|
821
820
|
* @public
|
|
822
|
-
* @category Core
|
|
823
821
|
* @example
|
|
824
822
|
* ```js
|
|
825
823
|
* const searchResult = entityManager.search(SpriteRenderer);
|
|
@@ -843,7 +841,6 @@ declare class EntityManager {
|
|
|
843
841
|
* @param componentTypes A collection of component classes
|
|
844
842
|
* @returns A collection of entities
|
|
845
843
|
* @public
|
|
846
|
-
* @category Core
|
|
847
844
|
* @example
|
|
848
845
|
* ```js
|
|
849
846
|
* const entities = entityManager.searchEntitiesByComponents([Transform, SpriteRenderer, Animator]);
|
|
@@ -1115,7 +1112,7 @@ interface GameConfig {
|
|
|
1115
1112
|
};
|
|
1116
1113
|
}
|
|
1117
1114
|
|
|
1118
|
-
declare class
|
|
1115
|
+
declare class CreateSystemService {
|
|
1119
1116
|
private readonly container;
|
|
1120
1117
|
private readonly systemManager;
|
|
1121
1118
|
private lastSystemTypeId;
|
|
@@ -1264,7 +1261,7 @@ declare class SceneManager {
|
|
|
1264
1261
|
private sceneNameToBeLoaded;
|
|
1265
1262
|
private loadingScene;
|
|
1266
1263
|
/** @internal */
|
|
1267
|
-
constructor(systemManager: SystemManager, systemFactory:
|
|
1264
|
+
constructor(systemManager: SystemManager, systemFactory: CreateSystemService, entityManager: EntityManager, assetManager: AssetManager);
|
|
1268
1265
|
addScene(sceneType: SceneType, name: string, openingScene?: boolean): void;
|
|
1269
1266
|
loadScene(name: string): void;
|
|
1270
1267
|
loadOpeningScene(): void;
|