Skip to content

Commit

Permalink
Update to 0.2.12 from 'dev' branch
Browse files Browse the repository at this point in the history
  • Loading branch information
KSneijders committed Nov 15, 2024
2 parents 7521b5b + f0408d0 commit 84cafe2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 7 deletions.
3 changes: 3 additions & 0 deletions AoE2ScenarioParser/datasets/object_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@ class Civilization(_DataSetIntEnums):
ROMANS = 43
ARMENIANS = 44
GEORGIANS = 45
ACHAEMENIDS = 46
ATHENIANS = 47
SPARTANS = 48
RANDOM = 65537
FULL_RANDOM = 65539
20 changes: 20 additions & 0 deletions AoE2ScenarioParser/datasets/techs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,3 +1002,23 @@ def civilization_techs() -> List[TechInfo]:
TECHNOLOGY_PLACEHOLDER_08 = 975, 107
TECHNOLOGY_PLACEHOLDER_09 = 976, 107
TECHNOLOGY_PLACEHOLDER_10 = 977, 107
BLANK_TECHNOLOGY_0 = 1180, -1
BLANK_TECHNOLOGY_1 = 1181, -1
BLANK_TECHNOLOGY_2 = 1182, -1
BLANK_TECHNOLOGY_3 = 1183, -1
BLANK_TECHNOLOGY_4 = 1184, -1
BLANK_TECHNOLOGY_5 = 1185, -1
BLANK_TECHNOLOGY_6 = 1186, -1
BLANK_TECHNOLOGY_7 = 1187, -1
BLANK_TECHNOLOGY_8 = 1188, -1
BLANK_TECHNOLOGY_9 = 1189, -1
BLANK_TECHNOLOGY_10 = 1240, -1
BLANK_TECHNOLOGY_11 = 1241, -1
BLANK_TECHNOLOGY_12 = 1242, -1
BLANK_TECHNOLOGY_13 = 1243, -1
BLANK_TECHNOLOGY_14 = 1244, -1
BLANK_TECHNOLOGY_15 = 1245, -1
BLANK_TECHNOLOGY_16 = 1246, -1
BLANK_TECHNOLOGY_17 = 1247, -1
BLANK_TECHNOLOGY_18 = 1248, -1
BLANK_TECHNOLOGY_19 = 1249, -1
4 changes: 4 additions & 0 deletions AoE2ScenarioParser/datasets/trigger_lists/action_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ class ActionType(_DataSetIntEnums):
PACK = 15
UNPACK = 16
ATTACK_MOVE = 17
LINE_FORMATION = 18
BOX_FORMATION = 19
STAGGERED_FORMATION = 20
FLANK_FORMATION = 21
12 changes: 6 additions & 6 deletions AoE2ScenarioParser/objects/managers/trigger_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
):
super().__init__(**kwargs)

self.triggers: List[Trigger] = triggers
self.triggers = triggers
self.trigger_display_order: List[int] = trigger_display_order
self._trigger_hash = hash_list(triggers)

Expand All @@ -51,12 +51,12 @@ def triggers(self) -> UuidList[Trigger]:
return self._triggers

@triggers.setter
def triggers(self, value: List[Trigger]) -> None:
value = UuidList(self._uuid, value, on_update_execute_entry=self._update_triggers_uuid)
def triggers(self, triggers: List[Trigger]) -> None:
triggers = UuidList(self._uuid, triggers, on_update_execute_entry=self._update_triggers_uuid)

self._trigger_hash = hash_list(value)
self._triggers = value
self.trigger_display_order = list(range(len(value)))
self._trigger_hash = hash_list(triggers)
self._triggers: UuidList[Trigger] = triggers
self.trigger_display_order = list(range(len(triggers)))

def _update_triggers_uuid(self, trigger):
"""Function to update inner UUIDs """
Expand Down
12 changes: 11 additions & 1 deletion AoE2ScenarioParser/objects/support/uuid_list.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from copy import deepcopy
from typing import Iterable, Sequence, TypeVar, List, Generic, Iterator
from typing import Iterable, Sequence, TypeVar, List, Generic, Iterator, overload
from uuid import UUID

from typing_extensions import SupportsIndex
Expand Down Expand Up @@ -100,6 +100,16 @@ def reverse(self) -> None:
def sort(self: List, *, key: None = ..., reverse: bool = ...) -> None:
super().sort(key=key, reverse=reverse)

@overload
def __getitem__(self, __i: SupportsIndex) -> _T: ...

@overload
def __getitem__(self, __s: slice) -> list[_T]: ...

def __getitem__(self, __i):
"""Only overwritten because Python Generics are... 'Interesting'"""
return super().__getitem__(__i)

def __setitem__(self, i: SupportsIndex, o: _T | Iterable[_T]) -> None:
"""
Set self[key] to value or set self[i:j] to slice.
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## 0.2.12 - 2024-November-16

### Added

- Support for the new civilizations -- Credits: [mardaravicius](https://github.com/KSneijders/AoE2ScenarioParser/pull/52)
- `Civilization.ACHAEMENIDS = 46`
- `Civilization.ATHENIANS = 47`
- `Civilization.SPARTANS = 48`
- Support for the new blank technologies -- Credits: [mardaravicius](https://github.com/KSneijders/AoE2ScenarioParser/pull/52)
- `TechInfo.BLANK_TECHNOLOGY_0` to `TechInfo.BLANK_TECHNOLOGY_19`
- Support for the new action types -- Credits: [mardaravicius](https://github.com/KSneijders/AoE2ScenarioParser/pull/52)
- `ActionType.LINE_FORMATION` = 18
- `ActionType.BOX_FORMATION` = 19
- `ActionType.STAGGERED_FORMATION` = 20
- `ActionType.FLANK_FORMATION` = 21

### Improved

- Type hinting for triggers and some other object lists

---

## 0.2.11 - 2024-November-02

### Fixed
Expand Down

0 comments on commit 84cafe2

Please sign in to comment.