Skip to content

Commit

Permalink
convert: Bunch of codestyle fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Jan 15, 2020
1 parent be82229 commit 0540d2f
Show file tree
Hide file tree
Showing 28 changed files with 244 additions and 160 deletions.
2 changes: 1 addition & 1 deletion libopenage/gamestate/game_spec.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2017 the openage authors. See copying.md for legal info.
// Copyright 2015-2020 the openage authors. See copying.md for legal info.

#include "game_spec.h"

Expand Down
2 changes: 1 addition & 1 deletion libopenage/unit/producer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014-2019 the openage authors. See copying.md for legal info.
// Copyright 2014-2020 the openage authors. See copying.md for legal info.

#include <initializer_list>

Expand Down
2 changes: 1 addition & 1 deletion libopenage/unit/unit_texture.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2018 the openage authors. See copying.md for legal info.
// Copyright 2015-2020 the openage authors. See copying.md for legal info.

#include "unit_texture.h"

Expand Down
4 changes: 2 additions & 2 deletions openage/convert/blendomatic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2019 the openage authors. See copying.md for legal info.
# Copyright 2013-2020 the openage authors. See copying.md for legal info.

"""
Conversion for the terrain blending masks.
Expand All @@ -11,7 +11,7 @@
from struct import Struct, unpack_from

from ..log import dbg
from openage.convert.dataformat.genie_structure import GenieStructure
from .dataformat.genie_structure import GenieStructure
from .dataformat.data_definition import DataDefinition
from .dataformat.struct_definition import StructDefinition

Expand Down
2 changes: 1 addition & 1 deletion openage/convert/dataformat/aoc/expected_pointer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

"""
Expected pointers reference an object that is not created yet.
Expand Down
8 changes: 7 additions & 1 deletion openage/convert/dataformat/aoc/genie_civ.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

from ...dataformat.converter_object import ConverterObject,\
ConverterObjectGroup
Expand All @@ -25,6 +25,9 @@ def __init__(self, civ_id, full_data_set, members=None):

self.data = full_data_set

def __repr__(self):
return "GenieCivilizationObject<%s>" % (self.get_id())


class GenieCivilizationGroup(ConverterObjectGroup):
"""
Expand Down Expand Up @@ -60,3 +63,6 @@ def __init__(self, civ_id, full_data_set):

tech_tree_id = self.civ.get_member("tech_tree_id").get_value()
self.disabled_techs = self.data.genie_effect_bundles[tech_tree_id]

def __repr__(self):
return "GenieCivilizationGroup<%s>" % (self.get_id())
14 changes: 13 additions & 1 deletion openage/convert/dataformat/aoc/genie_connection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.


from ...dataformat.converter_object import ConverterObject
Expand All @@ -24,6 +24,9 @@ def __init__(self, age_id, full_data_set, members=None):

self.data = full_data_set

def __repr__(self):
return "GenieAgeConnection<%s>" % (self.get_id())


class GenieBuildingConnection(ConverterObject):
"""
Expand All @@ -45,6 +48,9 @@ def __init__(self, building_id, full_data_set, members=None):

self.data = full_data_set

def __repr__(self):
return "GenieBuildingConnection<%s>" % (self.get_id())


class GenieTechConnection(ConverterObject):
"""
Expand All @@ -66,6 +72,9 @@ def __init__(self, tech_id, full_data_set, members=None):

self.data = full_data_set

def __repr__(self):
return "GenieTechConnection<%s>" % (self.get_id())


class GenieUnitConnection(ConverterObject):
"""
Expand All @@ -86,3 +95,6 @@ def __init__(self, unit_id, full_data_set, members=None):
super().__init__(unit_id, members=members)

self.data = full_data_set

def __repr__(self):
return "GenieUnitConnection<%s>" % (self.get_id())
8 changes: 7 additions & 1 deletion openage/convert/dataformat/aoc/genie_effect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

from ...dataformat.converter_object import ConverterObject

Expand Down Expand Up @@ -32,6 +32,9 @@ def get_type(self):
"""
return self.get_member("type_id").get_value()

def __repr__(self):
return "GenieEffectObject<%s>" % (self.get_id())


class GenieEffectBundle(ConverterObject):
"""
Expand Down Expand Up @@ -89,3 +92,6 @@ def is_sanitized(self):
Returns whether the effect bundle has been sanitized.
"""
return self.sanitized

def __repr__(self):
return "GenieEffectBundle<%s>" % (self.get_id())
5 changes: 4 additions & 1 deletion openage/convert/dataformat/aoc/genie_graphic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

from ...dataformat.converter_object import ConverterObject

Expand All @@ -25,3 +25,6 @@ def __init__(self, graphic_id, full_data_set, members=None):
super().__init__(graphic_id, members=members)

self.data = full_data_set

def __repr__(self):
return "GenieGraphic<%s>" % (self.get_id())
5 changes: 4 additions & 1 deletion openage/convert/dataformat/aoc/genie_object_container.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

from ...dataformat.converter_object import ConverterObjectContainer

Expand Down Expand Up @@ -57,3 +57,6 @@ def __init__(self):
self.nyan_files = []
self.sprite_files = []
self.terrain_files = []

def __repr__(self):
return "GenieObjectContainer"
5 changes: 4 additions & 1 deletion openage/convert/dataformat/aoc/genie_sound.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.

from ...dataformat.converter_object import ConverterObject

Expand All @@ -22,3 +22,6 @@ def __init__(self, sound_id, full_data_set, members=None):
super().__init__(sound_id, members=members)

self.data = full_data_set

def __repr__(self):
return "GenieSound<%s>" % (self.get_id())
23 changes: 22 additions & 1 deletion openage/convert/dataformat/aoc/genie_tech.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.


from ...dataformat.converter_object import ConverterObject,\
Expand Down Expand Up @@ -29,6 +29,9 @@ def __init__(self, tech_id, full_data_set, members=None):

self.data = full_data_set

def __repr__(self):
return "GenieTechObject<%s>" % (self.get_id())


class GenieTechEffectBundleGroup(ConverterObjectGroup):
"""
Expand Down Expand Up @@ -94,6 +97,9 @@ def has_effect(self):
else:
return False

def __repr__(self):
return "GenieTechEffectBundleGroup<%s>" % (self.get_id())


class AgeUpgrade(GenieTechEffectBundleGroup):
"""
Expand All @@ -120,6 +126,9 @@ def __init__(self, tech_id, age_id, full_data_set):

self.age_id = age_id

def __repr__(self):
return "AgeUpgrade<%s>" % (self.get_id())


class UnitLineUpgrade(GenieTechEffectBundleGroup):
"""
Expand All @@ -145,6 +154,9 @@ def __init__(self, tech_id, unit_line_id, upgrade_target_id, full_data_set):
self.unit_line_id = unit_line_id
self.upgrade_target_id = upgrade_target_id

def __repr__(self):
return "UnitLineUpgrade<%s>" % (self.get_id())


class BuildingLineUpgrade(GenieTechEffectBundleGroup):
"""
Expand All @@ -170,6 +182,9 @@ def __init__(self, tech_id, building_line_id, upgrade_target_id, full_data_set):
self.building_line_id = building_line_id
self.upgrade_target_id = upgrade_target_id

def __repr__(self):
return "BuildingLineUpgrade<%s>" % (self.get_id())


class UnitUnlock(GenieTechEffectBundleGroup):
"""
Expand All @@ -196,6 +211,9 @@ def __init__(self, tech_id, line_id, full_data_set):

self.line_id = line_id

def __repr__(self):
return "UnitUnlock<%s>" % (self.get_id())


class CivBonus(GenieTechEffectBundleGroup):
"""
Expand All @@ -219,3 +237,6 @@ def __init__(self, tech_id, civ_id, full_data_set):
super().__init__(tech_id, full_data_set)

self.civ_id = civ_id

def __repr__(self):
return "CivBonus<%s>" % (self.get_id())
5 changes: 4 additions & 1 deletion openage/convert/dataformat/aoc/genie_terrain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2019 the openage authors. See copying.md for legal info.
# Copyright 2019-2020 the openage authors. See copying.md for legal info.


from ...dataformat.converter_object import ConverterObject
Expand All @@ -24,3 +24,6 @@ def __init__(self, terrain_id, full_data_set, members=None):
super().__init__(terrain_id, members=members)

self.data = full_data_set

def __repr__(self):
return "GenieTerrainObject<%s>" % (self.get_id())
Loading

0 comments on commit 0540d2f

Please sign in to comment.