## WeaponDefinitions — Central registry of all weapon definitions. ## ## Provides a WEAPONS dictionary keyed by weapon_id for runtime lookup, ## plus a convenience getter. The data itself lives in WeaponData constants, ## so this file serves as a single import point for the full arsenal. ## ## Usage (as autoload singleton or direct preload): ## var data = WeaponDefinitions.get_weapon("rifle") ## # or: ## var all = WeaponDefinitions.WEAPONS ## extends RefCounted class_name WeaponDefinitions # --------------------------------------------------------------------------- # Weapon Registry # --------------------------------------------------------------------------- ## All weapons indexed by weapon_id — the single source of truth for the ## game's starter arsenal. Add new weapons here and in WeaponData. const WEAPONS: Dictionary = { "rifle": WeaponData.RIFLE, "pistol": WeaponData.PISTOL, "shotgun": WeaponData.SHOTGUN, "smg": WeaponData.SMG, } # --------------------------------------------------------------------------- # Lookup # --------------------------------------------------------------------------- ## Return the WeaponData for the given weapon_id, or null if unknown. static func get_weapon(id: String) -> WeaponData: return WEAPONS.get(id, null) as WeaponData