@@ -73,7 +73,7 @@ const FULL_BEHAVIOR := "full"
7373# OPTIMIZE SLIDER: each group of spaces is indicated with a number
7474
7575
76- func encode (data : LevelData ) -> String :
76+ static func encode (data : LevelData ) -> String :
7777 var encode_data := ""
7878 var level_size := Vector2i (data .width , data .height )
7979 encode_data += MOVES [data .moves_left ]
@@ -93,7 +93,7 @@ func encode(data: LevelData) -> String:
9393 return encode_data
9494
9595
96- func _encode_cells_orizzontal (cell_list : Dictionary , level_size : Vector2i ) -> String :
96+ static func _encode_cells_orizzontal (cell_list : Dictionary , level_size : Vector2i ) -> String :
9797 var encode_cells := ""
9898 var last := ""
9999 var count : int = 1
@@ -124,7 +124,7 @@ func _encode_cells_orizzontal(cell_list: Dictionary, level_size: Vector2i) -> St
124124 return encode_cells
125125
126126
127- func _encode_cells_vertical (cell_list : Dictionary , level_size : Vector2i ) -> String :
127+ static func _encode_cells_vertical (cell_list : Dictionary , level_size : Vector2i ) -> String :
128128 var encode_cells := ""
129129 var last := ""
130130 var count : int = 1
@@ -155,7 +155,7 @@ func _encode_cells_vertical(cell_list: Dictionary, level_size: Vector2i) -> Stri
155155 return encode_cells
156156
157157
158- func _encode_sliders (slider_list : Dictionary , level_size : Vector2i ) -> String :
158+ static func _encode_sliders (slider_list : Dictionary , level_size : Vector2i ) -> String :
159159 var encode_sliders := ""
160160 var empty_count : int = 0
161161 for edge in range (4 ):
@@ -173,7 +173,7 @@ func _encode_sliders(slider_list: Dictionary, level_size: Vector2i) -> String:
173173 return encode_sliders
174174
175175
176- func _encode_slider (slider_data : SliderData ) -> String :
176+ static func _encode_slider (slider_data : SliderData ) -> String :
177177 var encode_slider := ""
178178 match slider_data .area_effect :
179179 GlobalConst .AreaEffect .ADD :
@@ -193,7 +193,7 @@ func _encode_slider(slider_data: SliderData) -> String:
193193 return SLIDER .find_key (encode_slider )
194194
195195
196- func decode (encode_data : String ) -> LevelData :
196+ static func decode (encode_data : String ) -> LevelData :
197197 var data := LevelData .new ()
198198 var splitted_data := encode_data .split ("-" )
199199 var moves_left := _decode_moves (encode_data [0 ])
@@ -224,14 +224,14 @@ func decode(encode_data: String) -> LevelData:
224224 return data
225225
226226
227- func _decode_moves (letter : String ) -> int :
227+ static func _decode_moves (letter : String ) -> int :
228228 for index in range (MOVES .size ()):
229229 if letter == MOVES [index ]:
230230 return index
231231 return - 1
232232
233233
234- func _decode_cell_list (encode_data : String , level_size : Vector2i , order : CellOrder ) -> Dictionary :
234+ static func _decode_cell_list (encode_data : String , level_size : Vector2i , order : CellOrder ) -> Dictionary :
235235 var cell_list : Dictionary
236236 var cell_count := level_size .x * level_size .y
237237 var count : int = 0
@@ -261,7 +261,7 @@ func _decode_cell_list(encode_data: String, level_size: Vector2i, order: CellOrd
261261 return cell_list
262262
263263
264- func _get_next_cell_coord (last_coord : Vector2i , level_size : Vector2i , order : CellOrder ) -> Vector2i :
264+ static func _get_next_cell_coord (last_coord : Vector2i , level_size : Vector2i , order : CellOrder ) -> Vector2i :
265265 var column := last_coord .x
266266 var row := last_coord .y
267267 match order :
@@ -278,7 +278,7 @@ func _get_next_cell_coord(last_coord: Vector2i, level_size: Vector2i, order: Cel
278278 return Vector2i (column , row )
279279
280280
281- func _decode_slider_list (encode_data : String , level_size : Vector2i ) -> Dictionary :
281+ static func _decode_slider_list (encode_data : String , level_size : Vector2i ) -> Dictionary :
282282 var slider_list : Dictionary
283283 var slider_count := level_size .x * 2 + level_size .y * 2
284284 var slider_coord := Vector2i .ZERO
@@ -319,7 +319,7 @@ func _decode_slider_list(encode_data: String, level_size: Vector2i) -> Dictionar
319319 return slider_list
320320
321321
322- func _get_next_slider_coord (last_coord : Vector2i , level_size : Vector2i , offset : int ) -> Vector2i :
322+ static func _get_next_slider_coord (last_coord : Vector2i , level_size : Vector2i , offset : int ) -> Vector2i :
323323 var edge := last_coord .x
324324 var pos := last_coord .y
325325 while offset > 0 :
0 commit comments