bastd.stdmap
Defines standard map type.
1# Released under the MIT License. See LICENSE for details. 2# 3"""Defines standard map type.""" 4 5from __future__ import annotations 6 7from typing import TYPE_CHECKING 8 9import ba 10 11if TYPE_CHECKING: 12 from typing import Any 13 14 15def _get_map_data(name: str) -> dict[str, Any]: 16 import json 17 18 print('Would get map data', name) 19 with open( 20 'ba_data/data/maps/' + name + '.json', encoding='utf-8' 21 ) as infile: 22 mapdata = json.loads(infile.read()) 23 assert isinstance(mapdata, dict) 24 return mapdata 25 26 27class StdMap(ba.Map): 28 """A map completely defined by asset data.""" 29 30 _data: dict[str, Any] | None = None 31 32 @classmethod 33 def _getdata(cls) -> dict[str, Any]: 34 if cls._data is None: 35 cls._data = _get_map_data('bridgit') 36 return cls._data 37 38 def __init__(self) -> None: 39 super().__init__()
class
StdMap(ba._map.Map):
28class StdMap(ba.Map): 29 """A map completely defined by asset data.""" 30 31 _data: dict[str, Any] | None = None 32 33 @classmethod 34 def _getdata(cls) -> dict[str, Any]: 35 if cls._data is None: 36 cls._data = _get_map_data('bridgit') 37 return cls._data 38 39 def __init__(self) -> None: 40 super().__init__()
A map completely defined by asset data.
Inherited Members
- ba._map.Map
- preload
- get_play_types
- get_preview_texture_name
- on_preload
- getname
- get_music_type
- is_point_near_edge
- get_def_bound_box
- get_def_point
- get_def_points
- get_start_position
- get_ffa_start_position
- get_flag_position
- exists
- handlemessage
- ba._actor.Actor
- autoretain
- on_expire
- expired
- is_alive
- activity
- getactivity