-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
30 changed files
with
498 additions
and
117 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
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
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,51 +1,53 @@ | ||
# Copyright 2019-2019 the openage authors. See copying.md for legal info. | ||
|
||
from openage.convert.dataformat.converter_object import ConverterObject | ||
from ...dataformat.converter_object import ConverterObject | ||
|
||
|
||
class GenieEffectObject(ConverterObject): | ||
""" | ||
Single effect contained in GenieEffectBundle. | ||
""" | ||
|
||
def __init__(self, effect_id, bundle_id, full_data_set): | ||
def __init__(self, effect_id, bundle_id, full_data_set, members=None): | ||
""" | ||
Creates a new Genie effect object. | ||
:param effect_id: The index of the effect in the .dat file's effect | ||
bundle. (the index is referenced as tech_effect_id by techs) | ||
:param bundle_id: The index of the effect bundle that the effect belongs to. | ||
(the index is referenced as tech_effect_id by techs) | ||
:param full_data_set: GenieObjectContainer instance that | ||
contains all relevant data for the conversion | ||
process. | ||
:param members: An already existing member dict. | ||
""" | ||
|
||
super().__init__(effect_id) | ||
super().__init__(effect_id, members=members) | ||
|
||
self.bundle_id = bundle_id | ||
|
||
self.data = full_data_set | ||
self.data.genie_effect_bundles.update({self.get_id(): self}) | ||
|
||
|
||
class GenieEffectBundle(ConverterObject): | ||
""" | ||
A set of effects of a tech. | ||
""" | ||
|
||
def __init__(self, bundle_id, full_data_set): | ||
def __init__(self, bundle_id, effects, full_data_set, members=None): | ||
""" | ||
Creates a new Genie effect bundle. | ||
:param bundle_id: The index of the effect in the .dat file's effect | ||
block. (the index is referenced as tech_effect_id by techs) | ||
:param effects: Effects of the bundle as list of GenieEffectObject. | ||
:param full_data_set: GenieObjectContainer instance that | ||
contains all relevant data for the conversion | ||
process. | ||
:param members: An already existing member dict. | ||
""" | ||
|
||
super().__init__(bundle_id) | ||
super().__init__(bundle_id, members=members) | ||
|
||
self.effects = [] | ||
self.effects = effects | ||
|
||
self.data = full_data_set | ||
self.data.genie_effect_bundles.update({self.get_id(): self}) |
7 changes: 4 additions & 3 deletions
7
...ge/convert/dataformat/aoc/genie_sprite.py → ...e/convert/dataformat/aoc/genie_graphic.py
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,24 +1,25 @@ | ||
# Copyright 2019-2019 the openage authors. See copying.md for legal info. | ||
|
||
from bin.openage.convert.dataformat.converter_object import ConverterObject | ||
from ...dataformat.converter_object import ConverterObject | ||
|
||
|
||
class GenieGraphic(ConverterObject): | ||
""" | ||
Graphic definition from a .dat file. | ||
""" | ||
|
||
def __init__(self, graphic_id, full_data_set): | ||
def __init__(self, graphic_id, full_data_set, members=None): | ||
""" | ||
Creates a new Genie graphic object. | ||
:param graphic_id: The graphic id from the .dat file. | ||
:param full_data_set: GenieObjectContainer instance that | ||
contains all relevant data for the conversion | ||
process. | ||
:param members: An already existing member dict. | ||
""" | ||
|
||
super().__init__(graphic_id) | ||
super().__init__(graphic_id, members=members) | ||
|
||
self.data = full_data_set | ||
self.data.genie_graphics.update({self.get_id(): self}) |
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,24 +1,25 @@ | ||
# Copyright 2019-2019 the openage authors. See copying.md for legal info. | ||
|
||
from bin.openage.convert.dataformat.converter_object import ConverterObject | ||
from ...dataformat.converter_object import ConverterObject | ||
|
||
|
||
class GenieSound(ConverterObject): | ||
""" | ||
Sound definition from a .dat file. | ||
""" | ||
|
||
def __init__(self, sound_id, full_data_set): | ||
def __init__(self, sound_id, full_data_set, members=None): | ||
""" | ||
Creates a new Genie sound object. | ||
:param sound_id: The sound id from the .dat file. | ||
:param full_data_set: GenieObjectContainer instance that | ||
contains all relevant data for the conversion | ||
process. | ||
:param members: An already existing member dict. | ||
""" | ||
|
||
super().__init__(sound_id) | ||
super().__init__(sound_id, members=members) | ||
|
||
self.data = full_data_set | ||
self.data.genie_sounds.update({self.get_id(): self}) |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2019-2019 the openage authors. See copying.md for legal info. | ||
|
||
|
||
from ...dataformat.converter_object import ConverterObject | ||
|
||
|
||
class GenieTerrainObject(ConverterObject): | ||
""" | ||
Terrain definition from a .dat file. | ||
""" | ||
|
||
def __init__(self, terrain_id, full_data_set, members=None): | ||
""" | ||
Creates a new Genie terrain object. | ||
:param terrain_id: The index of the terrain in the .dat file's terrain | ||
block. (the index is referenced by other terrains) | ||
:param full_data_set: GenieObjectContainer instance that | ||
contains all relevant data for the conversion | ||
process. | ||
:param members: An already existing member dict. | ||
""" | ||
|
||
super().__init__(terrain_id, members=members) | ||
|
||
self.data = full_data_set | ||
self.data.genie_terrains.update({self.get_id(): self}) |
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
Oops, something went wrong.