From c3a26d02e63242ad7f2d21173f2079e11299cc1c Mon Sep 17 00:00:00 2001 From: JakubR Date: Sat, 27 Mar 2021 18:22:04 +0100 Subject: [PATCH] adjusted project constants for new implementation of JsonGenerator class --- project_constants.py | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/project_constants.py b/project_constants.py index 63ae841..b6e666c 100644 --- a/project_constants.py +++ b/project_constants.py @@ -33,8 +33,44 @@ SCREEN = pygame.display.set_mode( # === STRUCTS === # # =============== # +# # NORMAL STRUCTS + +# # USED BY JSON GENERATOR +# used to generate random tile colors STRUCT_TILE_COLORS = ["BLUE", "GREEN", "ORANGE", "PURPLE", "RED", "WHITE", "YELLOW"] -STRUCT_MINE_TYPES = ['A', 'B', 'F', 'K'] +# used to generate random mines and create not random mines +STRUCT_MINE_TYPES = ["standard", "chained", "time"] +STRUCT_MINE_ASSET_TYPES = ['A', 'B', 'F', 'K'] +# values that are predefined for certain mine types and can't be changed by changing any parameters +# put here all dict keys that have hardcoded values and are not supposed to be editable +HARDCODED_VALUES = ["asset", "mine_type"] +# default values and key-value pairs for JsonGenerator class +# when defining a new mine it's dict template must be put here +STRUCT_MINE_ATTRIBUTES = { + "standard": { + "asset": STRUCT_MINE_ASSET_TYPES.__getitem__(0), + "mine_type": "standard" + }, + "chained": { + "asset": STRUCT_MINE_ASSET_TYPES.__getitem__(1), + "mine_type": "chained", + "predecessor": None + }, + "time": { + "asset": STRUCT_MINE_ASSET_TYPES.__getitem__(2), + "mine_type": "time", + "timer": None + } +} +# types of attributes the mines have +# used for random mine generation +# int - integral number +# (int, int) - index "row,column" where row=int and column=int (used exclusively for chained mine) +STRUCT_MINE_ATTRIBUTE_TYPES = { + "standard": [], + "chained": [(int, int)], + "time": [int] +} # ============== # # ==== MAPS ==== #