Skip to content

Commit fb5fbd7

Browse files
committed
Update 1.0.1
1 parent 138bf6e commit fb5fbd7

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ A lib to build 2D Games.
2525

2626
## Changelog
2727

28+
### V 1.0.1 : Fix Update - 10/05/19
29+
30+
- Enums : Add Controls in __all__
31+
- Entity : Can add custom component
32+
33+
Cette MAJ ne casse pas la combatilbilité avec la précédente.
34+
2835
### V 1.0.0 : First Update - 09/05/19
2936

3037
- Components : Create LifeBarComponent, MoveComponent

pyengine/Entity.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ def attach_entity(self, entity):
2828
self.attachedentities.append(entity)
2929

3030
def add_component(self, component):
31-
if type(component) not in [PositionComponent, SpriteComponent, ControlComponent, PhysicsComponent,
32-
TextComponent, LifeBarComponent, MoveComponent]:
31+
found = False
32+
for i in [PositionComponent, SpriteComponent, ControlComponent, PhysicsComponent,
33+
TextComponent, LifeBarComponent, MoveComponent]:
34+
if isinstance(component, i):
35+
found = True
36+
break
37+
if not found :
3338
raise WrongObjectError("Entity can't have "+str(component)+" as component.")
3439
component.set_entity(self)
3540
self.components.append(component)

pyengine/Enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from enum import Enum
22

3-
__all__ = ["ControlType", "MouseButton", "CollisionCauses", "WorldCallbacks"]
3+
__all__ = ["ControlType", "MouseButton", "CollisionCauses", "WorldCallbacks", "Controls"]
44

55

66
class ControlType(Enum):

pyengine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
__all__ = ["Window", "World", "Entity", "ControlType", "const", "MouseButton", "CollisionCauses",
99
"WorldCallbacks", "GameState"]
10-
__version__="1.0.0"
10+
__version__ = "1.0.1"

0 commit comments

Comments
 (0)