-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
400 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# _factorio_version.py | ||
|
||
__factorio_version__ = "1.1.88.0" | ||
__factorio_version_info__ = (1, 1, 88, 0) | ||
__factorio_version__ = "1.1.89.0" | ||
__factorio_version_info__ = (1, 1, 89, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# version.py | ||
|
||
__version__ = "1.0.6" | ||
__version_info__ = (1, 0, 6) | ||
__version__ = "1.1.0" | ||
__version_info__ = (1, 1, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule factorio-data
updated
9 files
+1 −1 | base/info.json | |
+1 −0 | base/prototypes/entity/entities.lua | |
+45 −143 | base/prototypes/entity/sounds.lua | |
+1 −6 | base/prototypes/equipment.lua | |
+0 −6 | base/prototypes/item.lua | |
+1 −54 | changelog.txt | |
+2 −2 | core/prototypes/utility-constants.lua | |
+0 −10 | core/prototypes/utility-sounds.lua | |
+4 −4 | core/prototypes/utility-sprites.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# player_port.py | ||
|
||
from draftsman.classes.entity import Entity | ||
from draftsman.warning import DraftsmanWarning | ||
|
||
from draftsman.data import entities | ||
from draftsman.data.entities import player_ports | ||
|
||
import warnings | ||
|
||
|
||
class PlayerPort(Entity): | ||
""" | ||
A constructable respawn point typically used in scenarios. | ||
""" | ||
|
||
_exports = {} | ||
_exports.update(Entity._exports) | ||
|
||
def __init__(self, name=player_ports[0], **kwargs): | ||
# type: (str, **dict) -> None | ||
super(PlayerPort, self).__init__(name, player_ports, **kwargs) | ||
|
||
for unused_arg in self.unused_args: | ||
warnings.warn( | ||
"{} has no attribute '{}'".format(type(self), unused_arg), | ||
DraftsmanWarning, | ||
stacklevel=2, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# simple_entity_with_force.py | ||
|
||
from draftsman.classes.entity import Entity | ||
from draftsman.warning import DraftsmanWarning | ||
|
||
from draftsman.data import entities | ||
from draftsman.data.entities import simple_entities_with_force | ||
|
||
import warnings | ||
|
||
|
||
class SimpleEntityWithForce(Entity): | ||
""" | ||
A generic entity associated with a team of players. | ||
""" | ||
|
||
_exports = {} | ||
_exports.update(Entity._exports) | ||
_exports.update( | ||
{ | ||
"variation": { | ||
"format": "int", | ||
"description": "Graphical variation of the entity", | ||
"required": lambda x: x is not None, | ||
}, | ||
} | ||
) | ||
|
||
def __init__(self, name=simple_entities_with_force[0], **kwargs): | ||
# type: (str, **dict) -> None | ||
super(SimpleEntityWithForce, self).__init__( | ||
name, simple_entities_with_force, **kwargs | ||
) | ||
|
||
self.variation = 1 | ||
if "variation" in kwargs: | ||
self.variation = kwargs["variation"] | ||
self.unused_args.pop("variation") | ||
|
||
for unused_arg in self.unused_args: | ||
warnings.warn( | ||
"{} has no attribute '{}'".format(type(self), unused_arg), | ||
DraftsmanWarning, | ||
stacklevel=2, | ||
) | ||
|
||
@property | ||
def variation(self): | ||
# type: () -> int | ||
""" | ||
The number representing the graphical variation of the entity. | ||
:type: ``int`` | ||
""" | ||
return self._variation | ||
|
||
@variation.setter | ||
def variation(self, value): | ||
# type: (int) -> None | ||
self._variation = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# simple_entity_with_owner.py | ||
|
||
from draftsman.classes.entity import Entity | ||
from draftsman.warning import DraftsmanWarning | ||
|
||
from draftsman.data import entities | ||
from draftsman.data.entities import simple_entities_with_owner | ||
|
||
import warnings | ||
|
||
|
||
class SimpleEntityWithOwner(Entity): | ||
""" | ||
A generic entity owned by some other entity. | ||
""" | ||
|
||
_exports = {} | ||
_exports.update(Entity._exports) | ||
_exports.update( | ||
{ | ||
"variation": { | ||
"format": "int", | ||
"description": "Graphical variation of the entity", | ||
"required": lambda x: x is not None, | ||
}, | ||
} | ||
) | ||
|
||
def __init__(self, name=simple_entities_with_owner[0], **kwargs): | ||
# type: (str, **dict) -> None | ||
super(SimpleEntityWithOwner, self).__init__( | ||
name, simple_entities_with_owner, **kwargs | ||
) | ||
|
||
self.variation = 1 | ||
if "variation" in kwargs: | ||
self.variation = kwargs["variation"] | ||
self.unused_args.pop("variation") | ||
|
||
for unused_arg in self.unused_args: | ||
warnings.warn( | ||
"{} has no attribute '{}'".format(type(self), unused_arg), | ||
DraftsmanWarning, | ||
stacklevel=2, | ||
) | ||
|
||
@property | ||
def variation(self): | ||
# type: () -> int | ||
""" | ||
The number representing the graphical variation of the entity. | ||
:type: ``int`` | ||
""" | ||
return self._variation | ||
|
||
@variation.setter | ||
def variation(self, value): | ||
# type: (int) -> None | ||
self._variation = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# test_player_port.py | ||
# -*- encoding: utf-8 -*- | ||
|
||
from __future__ import unicode_literals | ||
|
||
from draftsman.entity import PlayerPort, player_ports | ||
from draftsman.error import InvalidEntityError | ||
from draftsman.warning import DraftsmanWarning | ||
|
||
import sys | ||
|
||
if sys.version_info >= (3, 3): # pragma: no coverage | ||
import unittest | ||
else: # pragma: no coverage | ||
import unittest2 as unittest | ||
|
||
|
||
class PlayerPortTesting(unittest.TestCase): | ||
def test_contstructor_init(self): | ||
turret = PlayerPort() | ||
|
||
with self.assertWarns(DraftsmanWarning): | ||
PlayerPort(unused_keyword="whatever") | ||
|
||
with self.assertRaises(InvalidEntityError): | ||
PlayerPort("this is not a player port") | ||
|
||
def test_mergable_with(self): | ||
port1 = PlayerPort("player-port") | ||
port2 = PlayerPort("player-port", tags={"some": "stuff"}) | ||
|
||
self.assertTrue(port1.mergable_with(port1)) | ||
|
||
self.assertTrue(port1.mergable_with(port2)) | ||
self.assertTrue(port2.mergable_with(port1)) | ||
|
||
port2.tile_position = (1, 1) | ||
self.assertFalse(port1.mergable_with(port2)) | ||
|
||
def test_merge(self): | ||
port1 = PlayerPort("player-port") | ||
port2 = PlayerPort("player-port", tags={"some": "stuff"}) | ||
|
||
port1.merge(port2) | ||
del port2 | ||
|
||
self.assertEqual(port1.tags, {"some": "stuff"}) |
Oops, something went wrong.