Exclude weapon names and weights from comparisons.

Only the class ID matters, and the names sometimes change with new pydcs
updates.
This commit is contained in:
Dan Albert 2021-06-20 15:10:48 -07:00
parent 0b5bdf8151
commit dc85644d71

View File

@ -4,7 +4,7 @@ import datetime
import inspect
import logging
from collections import defaultdict
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Dict, Iterator, Optional, Set, Tuple, Union, cast
from dcs.unitgroup import FlyingGroup
@ -21,8 +21,8 @@ class Weapon:
"""Wraps a pydcs weapon dict in a hashable type."""
cls_id: str
name: str
weight: int
name: str = field(compare=False)
weight: int = field(compare=False)
def available_on(self, date: datetime.date) -> bool:
introduction_year = WEAPON_INTRODUCTION_YEARS.get(self)