I currently have a weapon component that contains common functionality across weapons (mainly guns).
class Weapon : Component
{
float fireRate;
float reloadTime;
void Reload() // Implements reload logic since it is common across all guns
}
The main thing that differentiates guns is firing (some deal splash damage, some fire in a cone, etc.)
The problem I am facing is how to implement the unique firing functionality? Should I make a ConeDamage component, a LinearShot component? If so how will it work?
Keep in mind I am using an EC architecture not ECS.
Weaponcomponent with those unique components to create multiple weapons. Ex. a shotgun has theWeaponandConeDamagecomponents. How would theWeaponcomponent know of its existence and use it. \$\endgroup\$