This file contains hidden or 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
from dataclasses import dataclass | |
from enum import StrEnum | |
from typing import Optional | |
# from flags import Size | |
@dataclass | |
class Item(object): |
This file contains hidden or 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
import logging | |
import textwrap | |
from dataclasses import asdict, dataclass, is_dataclass, field | |
from enum import Enum | |
""" | |
Goal: to display a settings menu. The way I think it should work: | |
- Enumerate through Player atributes, get a key (LINE_ENDING) | |
- Get a key name common to both SettingString.LINE_ENDING (to display in the menu item) and SettingValue.LINE_ENDING |
This file contains hidden or 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
import random | |
from dataclasses import dataclass, field | |
from enum import Enum | |
class ClientSettingsNames(str, Enum): | |
NAME = "Name" | |
ROWS = "Screen rows" | |
COLUMNS = "Screen columns" | |
RETURN_KEY = "Return key" |
This file contains hidden or 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
import re | |
import logging | |
import doctest | |
import tempfile | |
def process_macros(code: list): | |
""" | |
This function processes macro definitions and stores them in a dictionary. |
This file contains hidden or 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
""" | |
convert C64List symbols file... | |
chrout = $ffd2 | |
llen = $0ca4 | |
ones_digit = $0ca3 | |
...to Vice label file: | |
# al $addr .label | |
al $ffd2 .chrout | |
al $0c04 .llen |
This file contains hidden or 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
import logging | |
from dataclasses import dataclass, field | |
@dataclass | |
class ShopItem: | |
name: str | |
quantity: int | |
price: int |
This file contains hidden or 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
import logging | |
from enum import Enum | |
from dataclasses import dataclass, field | |
from typing import Tuple | |
import doctest | |
@dataclass | |
class PlayerFlagTypes(str, Enum): | |
YESNO: str = "yes/no" |
This file contains hidden or 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
# https://gist.github.com/anoryx/c34380a0a3ef4031f41c9ed8035e305b | |
# https://stackoverflow.com/questions/51575931/class-inheritance-in-python-3-7-dataclasses/53085935#53085935 | |
# combat considerations: | |
# https://codereview.stackexchange.com/questions/139121/my-implementation-of-item-objects-in-a-text-adventure | |
# thanks, volca & google gemini (née bard) | |
import doctest |
This file contains hidden or 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
import logging | |
from dataclasses import dataclass, field | |
import datetime | |
import doctest | |
from typing import Optional | |
# Totally Awesome Dungeon Adventure modules: | |
from server import Player, Room | |