[O] Make snow particles mutable

This commit is contained in:
Azalea Gui
2023-03-07 23:31:29 -05:00
parent f04ffb1807
commit 73fc45c36c
+7 -4
View File
@@ -1,5 +1,7 @@
import asyncio import asyncio
import os import os
import random
from dataclasses import dataclass
from typing import NamedTuple from typing import NamedTuple
import telnetlib3 import telnetlib3
@@ -21,20 +23,21 @@ ASCII_HEIGHT = ASCII_CAT.count('\n')
ASCII_WIDTH = max(len(line.strip('\n')) for line in ASCII_CAT.splitlines()) ASCII_WIDTH = max(len(line.strip('\n')) for line in ASCII_CAT.splitlines())
COLORS = {RGB.from_hex(v) for v in { COLORS = [RGB.from_hex(v) for v in {
'#FFFFFF', '#FFFFFF',
'#F6AAB7', '#F6AAB7',
'#55CDFD' '#55CDFD'
}} }]
# Snow fall data structure # Snow fall data structure
class SnowParticle(NamedTuple): @dataclass
class SnowParticle:
x: int # x position x: int # x position
y: int # y position y: int # y position
xv: int # x velocity xv: int # x velocity
yv: int # y velocity yv: int # y velocity
color: RGB color: RGB # color
async def shell(reader: TelnetReaderUnicode, writer: TelnetWriterUnicode): async def shell(reader: TelnetReaderUnicode, writer: TelnetWriterUnicode):