-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComponents.py
executable file
·70 lines (57 loc) · 1.7 KB
/
Components.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from numba import jit, njit
import numba as nb
from dataclasses import dataclass, field
from typing import List
from gs_map import get_district, Map
# could use numpy arrays for map, fov, navigation maps, etc.
# use dataclasses for most things here
#@jit("(None),(None)", nopython=True, nogil=True, cache=True)
@dataclass
class Position:
z:int = 0
y:int = 0
x:int = 0
district:int = 55
desire_z:int = None
desire_y:int = None
desire_x:int = None
desire_district:int = None
#
# class EntityMap:
# def __init__(self, district=55):
# self.district = district
# self.map = Map(district)
# class Velocity:
# #@nb.jit("void(int32,int32)", nopython=True, nogil=True)
# def __init__(self, x=0.0, y=0.0):
# self.x = x
# self.y = y
@dataclass
class ActiveDistricts:
active_districts: List[int] = field(default_factory=list) # todo change to a tuple of
class DistrictMaps:
def __init__(self):
self.mapList: List(Union(None, Map)) = [None] * 100
# todo add list of entities that can see this entity to Position or Renderable
@dataclass
class Renderable:
pass
class UpdateMap:
pass
@dataclass
class UpdateFov:
pass
@dataclass
class ConnectedPlayer:
# stuff that only counts for players, will be separated from the character entity
sid: str
username: str
charName: str = ""
character_entity: int = 0
@dataclass
class Person:
# sentient beings, probably differentiate from robots and ghosts later
name: str
fov = None #only the results of a FoV slabs query. Map district holds the FieldOfView object
visible_entities: List[int] = field(default_factory=list)
is_player_controlled: bool = False